Given this spec
----------------------------- MODULE PickAndAdd ----------------
EXTENDS Integers, TLC
VARIABLES pc, i
vars == <<pc, i>>
Init == /\ i = 0
/\ pc = "start"
Pick == /\ pc = "start"
/\ i' \in 1..10
/\ pc' = "middle"
Add == /\ pc = "middle"
/\ i' = i + 1
/\ pc' = "done"
Next == Pick \/ Add
Spec == Init /\ [][Next]_vars
================================================================
Checking SPECIFICATION Spec causes TLC to fail with deadlock.
If I replace Next with:
Next == Pick \/ Add \/ UNCHANGED vars
The deadlock error goes away.
My questions are:
1. isn't that UNCHANGED what the [][Next]_vars is supposed to do?
2. why do I have to add the extra UNCHANGED statement?
3. Is there a convention or a better way to check for program termination?
Thanks!