Liveness & Fairness · Page 3 of 5
Weak Fairness
A Fairness clause tells the checker what we assume about the scheduler.
weak_fairness(s.release()) — TLA⁺'s WFvars(release) —
says: if release() stays continuously enabled, it must eventually happen.
Notice the syntax: inside Fairness (and enabled), actions are
written like method calls on s — s.release(). You can optionally pass
on=e to specify a different TLA⁺ subscript (WFe(A)),
defaulting to all state and ghost variables.
When available == 0, acquire() is disabled and
release() stays continuously enabled until it fires. So weak fairness on
release() eliminates the stuttering loop and makes progress hold!
Try it: Click Check to verify
progress passes.
Then comment out the fair=Fairness(...) line and check again to watch the
stuttering counterexample return!