------------------------------- MODULE Numbers ------------------------------ EXTENDS Integers ----------------------------------------------------------------------------- CONSTANT \* @type: Int; MaxNumber VARIABLE \* @type: Int; a, \* @type: Int; b, \* @type: Str; action, \* @type: Str; actionOutcome Init == /\ a = 0 /\ b = 0 /\ action = "None" /\ actionOutcome = "OK" IncreaseA == action' = "IncreaseA" /\ LET nextA == a + 1 IN IF nextA <= MaxNumber THEN /\ a' = nextA /\ actionOutcome' = "OK" /\ UNCHANGED <> ELSE /\ UNCHANGED <> /\ actionOutcome' = "FAIL" IncreaseB == action' = "IncreaseB" /\ LET nextB == b + 2 IN IF nextB <= MaxNumber THEN /\ b' = nextB /\ actionOutcome' = "OK" /\ UNCHANGED <> ELSE /\ UNCHANGED <> /\ actionOutcome' = "FAIL" Next == \/ IncreaseA \/ IncreaseB \/ /\ action' = "None" /\ actionOutcome' = "OK" /\ UNCHANGED <> TypeOK == /\ a \in Int /\ b \in Int /\ action \in STRING /\ actionOutcome \in STRING Inv == /\ a <= MaxNumber /\ b <= MaxNumber ============================================================================