Created
July 8, 2026 02:51
-
-
Save jmcph4/035f33f35bf02f651425cb90dcf81d67 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| INIT Init | |
| NEXT Next | |
| INVARIANT TypeOK |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --------------------------- MODULE TrafficLight ----------------------------- | |
| EXTENDS Naturals | |
| VARIABLE light | |
| TypeOK == light \in {"red", "green", "yellow"} | |
| ToGreen == /\ light = "red" | |
| /\ light' = "green" | |
| ToYellow == /\ light = "green" | |
| /\ light' = "yellow" | |
| ToRed == /\ light = "yellow" | |
| /\ light' = "red" | |
| Init == light = "red" | |
| Next == \/ ToGreen | |
| \/ ToYellow | |
| \/ ToRed | |
| NeverSkipYellow == (light = "green") => (light' # "red") | |
| ============================================================================= |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment