Liveness & Fairness · Page 1 of 5
Model Values & Parameterized Actions
Concurrent and distributed systems involve multiple processes, nodes, or clients. Subclass
ModelValue to declare opaque, distinct identities (TLA⁺ model values):
class Proc(ModelValue):
pass
An action with parameters like def acquire(self, p: Proc) is existentially
quantified in Next: a step may take acquire(p) for any
p in the model's domain for Proc.
Inside predicates, Python's all(...) and any(...) over finite sets
are TLA⁺'s ∀ and ∃. You can also check whether an action
is enabled in the current state with enabled(s.acquire(p)) — a Level-1 expression,
so it is legal inside an Invariant like never_stuck!
Try it: Click Check to verify all 8 states of the 2-process
mutex. Notice how
s.waiting | {p} and s.waiting - {p} use ordinary
Python frozenset operators.