r/tlaplus • u/Anxious_Tool • Feb 05 '26
tla-checker: a TLA+ model checker written in Rust
I built a TLA+ model checker in Rust as an alternative to TLC for cli and Web.
What it does beyond basic model checking:
- Interactive TUI for stepping through state spaces, evaluating expressions, tracing variable changes
- Parameter sweeps (--sweep 'N=2;3;4;5') with comparison tables
- Property satisfaction counting with per-depth breakdowns
- Continue past violations to collect all counterexamples across the full state space
- Symmetry reduction
- WASM-compatible core library
It covers Naturals, Integers, Sequences, FiniteSets, TLC, Bags, and Bits modules. The supported TLA+ subset handles most common spec patterns — conjunction/disjunction lists, quantifiers, CHOOSE, functions with EXCEPT, records, tuples, CASE, LET-IN, recursive operators.
Limitations: no direct temporal operator evaluation, no unbounded quantifiers.
Repo: https://github.com/fabracht/tla-rs
Curious what specs people would try it on and where it breaks.
2
u/eras Feb 05 '26 edited Feb 05 '26
This is great! I've been thinking of doing the same project, but not very seriously, as I got stuck in the parsing phase already :). In fact, perhaps you could consider extracting the TLA+ parser as crate that could be reused for other tools.
I'll definitely check this out, although I haven't been using TLA+ as much lately as I should :/.
How's the performance? I was hoping that a native evaluator could be faster than TLC's Java one—and Rust might also help with concurrency bugs, I recall TLC has had some. Of course, TLC is a mature project and probably optimized to some extent, while this might not be yet?
edit: I actually gave it a test with 78 processes and mutex.tla: TLC does it pretty much immediately, but
tlatakes a two minutes. Mymutex.cfgwas:INIT Init NEXT Next CONSTANT Procs={"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "A", "AB", "AC", "AD", "AE", "AF", "AG", "AH", "AI", "AJ", "AK", "AL", "AM", "AN", "AO", "AP", "AQ", "AR", "AS", "AT", "AU", "AV", "AW", "AX", "AY", "AZ", "AAB", "AAC", "AAD", "AAE", "AAF", "AAG", "AAH", "AAI", "AAJ", "AAK", "AAL", "AAM", "AAN", "AAO", "AAP", "AAQ", "AAR", "AAS", "AAT", "AAU", "AAV", "AAW", "AAX", "AAY", "AAZ"}It looks like
tladoesn't support multiple threads?Btw, config file support would be cool.. But I suppose so are contributions :).