fabracht/tla-rs

Rust

72

148 commits

updated Sep 23, 2026

See the code

README

tla-rs

A TLA+ model checker and interactive exploration tool written in Rust.

tla-rs verifies TLA+ specifications by exploring all reachable states, checking invariants, and reporting counterexamples. Beyond pass/fail checking it offers an interactive TUI for stepping through state spaces, scenario-driven exploration, property-satisfaction analytics, parameter sweeps, tested demo walkthroughs (with an optional in-browser explorer), and an MCP server for agentic clients. The core library compiles to WebAssembly for browser embedding. It's a lightweight alternative to the official TLC model checker for specs that fit its supported subset.

Installation

cargo build --release

The binary will be at target/release/tla. Prebuilt binaries and the tla-mcp server are available via Homebrew, an install script, or GitHub releases — see the MCP Server guide.

Quick Start

tla spec.tla
tla spec.tla -c 'N=5' -c 'Procs={"p1","p2","p3"}'
tla spec.tla -c 'Proc={a,b,c}' --symmetry Proc
tla spec.tla --config model.cfg
tla spec.tla --quick    # limit to 10,000 states
tla spec.tla -i         # interactive TUI

Constants accept integers (42), booleans (TRUE), quoted strings ("hello"), sets ({1,2,3}), tuples (<<1,2>>), records ([hp |-> 100]), and functions (a :> 1 @@ b :> 2).

A bare identifier is a model value — an uninterpreted, pairwise-distinct atom, matching TLC. n1 is not equal to the string "n1", so -c 'Proc={a,b,c}' yields three model values, not three strings. Symmetry reduction requires a set of model values (--symmetry rejects a set of quoted strings, as TLC does).

Options

OptionDescription
-c NAME=VALUESet a constant value
-s CONSTEnable symmetry reduction for a constant
--config PATHLoad TLC-style cfg file (auto-discovers Spec.cfg next to Spec.tla)
--max-states NMaximum states to explore (default: 1000000)
--max-depth NMaximum trace depth (default: 100)
-qQuick exploration (limit: 10,000 states)
--export-dot FILEExport state graph to DOT format
--dot-mode MODEDOT mode: full, trace, clean (default), choices
--allow-deadlockAllow states with no successors
--check-livenessCheck liveness and fairness properties
--continueContinue past invariant violations
--count-satisfying NAMECount states satisfying a definition (repeatable)
--sweep NAME=V1;V2;...Sweep a constant across values, compare results
--scenario TEXTExplore a specific scenario (or @file)
-iInteractive TUI exploration mode
--present FILERun a demo manifest (.json/.toml); TUI walkthrough, or --validate for a pass/fail report
--export-md FILEWith --present: write a Markdown walkthrough
--export-html FILEWith --present: write a self-contained HTML walkthrough
--explorableWith --export-html: embed the wasm engine for in-browser state exploration
--jsonJSON output
-vVerbose output (depth breakdowns, etc.)
--version, -VShow version information

Documentation

GuideContents
CLI GuideConfiguration files, scenarios, demo walkthroughs (incl. the --explorable browser explorer), interactive mode, analytics, output, and state-graph visualization
TLA+ SupportSupported operator subset, module instances, spec structure, and limitations
WebAssemblyBrowser-embeddable WASM API, including the live stepping bindings
MCP Servertla-mcp install, client registration, and tool reference
Syntax StatusOperator-by-operator coverage table
ArchitectureInternal design
Practical TLA+ GuideWorked guidance for writing checkable specs

License

MIT

Contributors

fabracht

144 commits

BaldDemian

1 commits

eras

1 commits

fabracht/tla-rs

Rust

72

148 commits

updated Sep 23, 2026

See the code

README

tla-rs

A TLA+ model checker and interactive exploration tool written in Rust.

tla-rs verifies TLA+ specifications by exploring all reachable states, checking invariants, and reporting counterexamples. Beyond pass/fail checking it offers an interactive TUI for stepping through state spaces, scenario-driven exploration, property-satisfaction analytics, parameter sweeps, tested demo walkthroughs (with an optional in-browser explorer), and an MCP server for agentic clients. The core library compiles to WebAssembly for browser embedding. It's a lightweight alternative to the official TLC model checker for specs that fit its supported subset.

Installation

cargo build --release

The binary will be at target/release/tla. Prebuilt binaries and the tla-mcp server are available via Homebrew, an install script, or GitHub releases — see the MCP Server guide.

Quick Start

tla spec.tla
tla spec.tla -c 'N=5' -c 'Procs={"p1","p2","p3"}'
tla spec.tla -c 'Proc={a,b,c}' --symmetry Proc
tla spec.tla --config model.cfg
tla spec.tla --quick    # limit to 10,000 states
tla spec.tla -i         # interactive TUI

Constants accept integers (42), booleans (TRUE), quoted strings ("hello"), sets ({1,2,3}), tuples (<<1,2>>), records ([hp |-> 100]), and functions (a :> 1 @@ b :> 2).

A bare identifier is a model value — an uninterpreted, pairwise-distinct atom, matching TLC. n1 is not equal to the string "n1", so -c 'Proc={a,b,c}' yields three model values, not three strings. Symmetry reduction requires a set of model values (--symmetry rejects a set of quoted strings, as TLC does).

Options

OptionDescription
-c NAME=VALUESet a constant value
-s CONSTEnable symmetry reduction for a constant
--config PATHLoad TLC-style cfg file (auto-discovers Spec.cfg next to Spec.tla)
--max-states NMaximum states to explore (default: 1000000)
--max-depth NMaximum trace depth (default: 100)
-qQuick exploration (limit: 10,000 states)
--export-dot FILEExport state graph to DOT format
--dot-mode MODEDOT mode: full, trace, clean (default), choices
--allow-deadlockAllow states with no successors
--check-livenessCheck liveness and fairness properties
--continueContinue past invariant violations
--count-satisfying NAMECount states satisfying a definition (repeatable)
--sweep NAME=V1;V2;...Sweep a constant across values, compare results
--scenario TEXTExplore a specific scenario (or @file)
-iInteractive TUI exploration mode
--present FILERun a demo manifest (.json/.toml); TUI walkthrough, or --validate for a pass/fail report
--export-md FILEWith --present: write a Markdown walkthrough
--export-html FILEWith --present: write a self-contained HTML walkthrough
--explorableWith --export-html: embed the wasm engine for in-browser state exploration
--jsonJSON output
-vVerbose output (depth breakdowns, etc.)
--version, -VShow version information

Documentation

GuideContents
CLI GuideConfiguration files, scenarios, demo walkthroughs (incl. the --explorable browser explorer), interactive mode, analytics, output, and state-graph visualization
TLA+ SupportSupported operator subset, module instances, spec structure, and limitations
WebAssemblyBrowser-embeddable WASM API, including the live stepping bindings
MCP Servertla-mcp install, client registration, and tool reference
Syntax StatusOperator-by-operator coverage table
ArchitectureInternal design
Practical TLA+ GuideWorked guidance for writing checkable specs

License

MIT

Contributors

fabracht

144 commits

BaldDemian

1 commits

eras

1 commits

Languages

Rust

87.0%

TLA

9.6%

HTML

2.4%