Hello, as you observed, both your fairness conditions ensure that the property that you are interested in holds, but they do so for quite different reasons. The first condition, which I'll write equivalently as UnivFairSpec == /\ Spec /\ \A self \in ProcSet : SF_vars(RETRY_BEGIN(self) /\ pc'[self] = "RETRY_SUCCEED")
-- asserts that every process that infinitely may succeed (i.e., move from BEGIN to SUCCEED) will succeed eventually. The second condition, ExistFairSpec == /\ Spec /\ SF_vars(\E self \in ProcSet : RETRY_BEGIN(self) /\ pc'[self] = "RETRY_SUCCEED") asserts that if infinitely often some process may succeed, then eventually some process will. The two conditions are equivalent for your spec because processes that succeed terminate. In particular, the first process that succeeds will never move back to BEGIN. Now, the second process will continue looping and must therefore eventually succeed. (And clearly the "universal" condition implies the "existential" one.) In order to make this more concrete, consider the variant below of your algorithm, where a process restarts after having succeeded. For this variant, the expected correctness property would be that both processes succeed infinitely often: EveryProcessSucceeds == \A self \in ProcSet : []<>(succeeded[self]) You will see that this property holds with the "universal" fairness hypothesis, but not with the "existential" one, and TLC generates a counter-example where only one of the processes succeeds infinitely often. Regards, Stephan (*--algorithm retry_example variables \* Both processes have not yet succeeded. succeeded = [p \in 1..NumProcesses |-> FALSE]; define all_succeeded == \A p \in 1..NumProcesses: succeeded[p] end define; fair process retry_example \in 1..NumProcesses begin RETRY_BEGIN: either RETRY_SUCCEED: succeeded[self] := TRUE; or RETRY_ERROR: goto RETRY_BEGIN; end either; RESTART: succeeded[self] := FALSE; goto RETRY_BEGIN; end process; end algorithm *)
You received this message because you are subscribed to the Google Groups "tlaplus" group. To unsubscribe from this group and stop receiving emails from it, send an email to tlaplus+unsubscribe@xxxxxxxxxxxxxxxx. To post to this group, send email to tlaplus@xxxxxxxxxxxxxxxx. Visit this group at https://groups.google.com/group/tlaplus. For more options, visit https://groups.google.com/d/optout. |