Expression Primitives

Declarative expression primitives used inside specification predicates. All primitives raise NotImplementedError if invoked at runtime by Python — checkers read them statically from source.

implies(antecedent: bool, consequent: bool) -> bool#

Any levelTLA⁺: P => Q

Logical implication (not antecedent or consequent). Valid at any level.

choose(domain: Iterable[T], predicate: Callable[[T], bool] | None = None) -> T#

Level 1TLA⁺: CHOOSE x \in S : P(x)

Hilbert choice operator: picks one deterministic element from domain satisfying predicate (not random).

enabled(action: Any) -> bool#

Level 1TLA⁺: ENABLED A

True in the current state iff the given action call (e.g. s.acquire(p)) has at least one valid successor step. State-level (legal inside Invariant).

prime(value: T) -> T#

Level 2TLA⁺: x'

Refers to the value of a state or ghost variable in the next state after a transition step.

unchanged(*values: Any) -> bool#

Level 2TLA⁺: UNCHANGED <<x, ...>>

Asserts that every listed expression keeps its pre-step value after the step.

always(formula: bool) -> bool#

Level 3TLA⁺: []P

Temporal box operator: formula holds in every state of the behaviour.

eventually(formula: bool) -> bool#

Level 3TLA⁺: <>P

Temporal diamond operator: formula holds in at least one state of the behaviour.

leads_to(cause: bool, effect: bool) -> bool#

Level 3TLA⁺: P ~> Q

Temporal leads-to: whenever cause holds, effect eventually holds.

weak_fairness(action: Any, *, on: Any = None) -> bool#

Level 3 (Fairness)TLA⁺: WF_vars(A)

Weak fairness assumption inside Fairness: if action stays continuously enabled, it must eventually occur. on defaults to all variables.

strong_fairness(action: Any, *, on: Any = None) -> bool#

Level 3 (Fairness)TLA⁺: SF_vars(A)

Strong fairness assumption inside Fairness: if action is enabled infinitely often, it must eventually occur. on defaults to all variables.