A Tour of Temporal Typing Refinement & Models · 2/5
Refinement & Models · Page 2 of 5

Finite Models & Domains

A Model is the Python equivalent of a TLC .cfg file: it makes a specification finite by giving concrete values for its constants and finite collections (range, frozenset, list) for the types it quantifies over in domains.

When resolving the domain of a parameter's type, the front-end checks in strict order:

  1. Exact entry in domains (including a type alias like Priority).
  2. Optional[T] / T | None: the domain of T plus None.
  3. Inherently finite types: bool, Literal[...], and Enum — these need no entry!
  4. The underlying base type under any Where clauses (e.g., int for Priority), then narrowed by Where.

Golden rule: A checker never invents a domain. If an action quantifies over a type with no domain, the front-end rejects the model with missing-domain.

Try it: Notice Status (an Enum) needs no domain, while Priority does. Delete , domains={Priority: range(1, 4)} from worker_model and click Check to see ERROR [missing-domain]!
Click Check (or press Shift+Enter) to run the front-end and check this specification. Switch to TLA⁺ to view its TLA⁺ meaning.
---- MODULE Worker ----
VARIABLES status, priority

Init == status = "idle" /\ priority = NULL
Start(p) == status = "idle" /\ p \in 1..3 /\ status' = "running" /\ priority' = p
Finish   == status = "running" /\ status' = "idle" /\ priority' = NULL
Next == (\E p \in 1..3 : Start(p)) \/ Finish

Valid == status = "idle" \/ priority # NULL
====