A variable state
stands for state of a system, for instance state \in {"ready", "prepare", "do", "cleanup", "done"}
. How to express condition that state
should eventually pass all the five states (in any order)?
Working example (accepted answer):
EXTENDS Naturals
VARIABLE n
Init == n = 1
Next == IF n < 3 THEN n' = n + 1 ELSE n' = n
Spec == Init /\ [][Next]_<<n>> /\ WF_<<n>>(Next)
Check == \A s \in {1,2,3}: <>(s = n) \* This goes: Model Overview >
\* > "What to check?" > Properties
Given
States = {"ready", "prepare", "do", "cleanup", "done"}
, you can check that it reaches some given state withAnd you can check that it reaches all states with