Welcome to TLA+ By Example! This platform lets you learn TLA+ by reading explanations and running specifications directly in your browser.
On the right side of this page, you'll see the playground. It has two tabs:
Click ▶ Run TLC to model-check the specification. The output will appear in the panel at the bottom of the playground.
TLA+ is a formal specification language developed by Leslie Lamport. It's used to design, model, and verify concurrent and distributed systems. Companies like Amazon, Microsoft, and Intel use TLA+ to find bugs in critical systems before they're built.
A TLA+ specification describes:
The playground on the right has a classic example: the DieHard water jugs puzzle from the movie Die Hard 3. The heroes need exactly 4 gallons using a 5-gallon and a 3-gallon jug.
Click ▶ Run TLC to see TLC find a solution (it will report an invariant violation — which is actually the solution!).
You can also install the TLA+ VS Code Extension to write and check specs on your machine.