TLC turns a TLA+ spec into an executable artifact. It generates every reachable state, then checks your properties against the entire state space — mechanically and exhaustively.
.cfg) — which properties to check, and any constant bindings.Init.Next to each state, deduplicate, repeat.
The diagram below is a tiny state graph. State s4 violates the invariant
TypeOK. Press Run check to see breadth-first exploration and the error trace TLC reconstructs.
| Check | Kind | Configured as |
|---|---|---|
| Type invariant | Safety | INVARIANT |
| State invariants | Safety | INVARIANT |
| Temporal formulas | Liveness | PROPERTY |
| Deadlock detection | Liveness | built in (a state with no successor) |
A TLC model is declared in a .cfg file alongside the module:
SPECIFICATION Spec INVARIANT TypeOK PROPERTY Live
TLC's real value isn't the green checkmark — it's the trace you get when something fails. The trace is a concrete sequence of states from a valid initial state to the violation, so you can replay the bug and understand exactly which interleaving broke your design.
The trace is deterministic — feed it back and TLC walks the same path. No flaky tests, no "it works on my machine."
TLC finds the shortest path to the violation (breadth-first), so the trace is the smallest scenario that exposes the bug.
The reachable state space grows exponentially with the spec's variables. That's the fundamental constraint on all explicit-state model checkers. TLA+ practice has standard countermeasures:
| Technique | What it does |
|---|---|
| Symmetry sets | Collapse states that are permutations of each other (identical processes, messages). |
| Model values | Replace a large/unbounded data set with a few abstract tokens. |
| State constraints | Bound the search (e.g. limit queue length) for a partial, targeted check. |
| Apalache | A symbolic model checker for TLA+ that reasons about sets of states, extending reach. |
Even a small model (a handful of processes, a bounded queue) routinely finds the concurrency bugs that ship to production. You don't need an exhaustive 1030-state search to be valuable.