Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| using:debugger [2024/09/28 15:58] – created - external edit 127.0.0.1 | using:debugger [2026/04/11 13:27] (current) – fponzi | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| TLA+ tools come with a debugger that allow you to debug your specifications. See it in action: | TLA+ tools come with a debugger that allow you to debug your specifications. See it in action: | ||
| - | <HTML> | + | {{youtube>x6u8LYSso6s? |
| - | <iframe width=" | + | {{youtube> |
| - | </ | + | |
| - | <iframe width=" | + | ===== Graphical |
| - | </ | + | |
| - | </ | + | |
| - | ===== graphical | + | |
| You will need the SVG extension: https:// | You will need the SVG extension: https:// | ||
| + | {{youtube> | ||
| + | |||
| + | ======= interactive state-space exploration - added 2026-01 ======= | ||
| + | |||
| + | The TLA+ Debugger has a new major capability: **interactive state-space exploration**. This feature changes how you can interact with your TLA+ specifications by letting you explore the state space of your models interactively, | ||
| + | |||
| + | This represents a shift in how you can work with TLA+ specifications, | ||
| + | |||
| + | ====== What is Interactive State-Space Exploration? | ||
| + | |||
| + | Interactive state-space exploration allows you to: | ||
| + | |||
| + | * **Interactively select the initial state** from the set of all initial states satisfying your '' | ||
| + | * **Choose successor states** by selecting from the set of all valid next states computed by your '' | ||
| + | * **Step backward** through the trace to any predecessor state, including all the way back to the set of initial states | ||
| + | * **Navigate freely** through your specification' | ||
| + | |||
| + | This approach emphasizes the **state-machine perspective of TLA+**, making it natural to think about your specification as a state transition system rather than just formulas and temporal properties. | ||
| + | |||
| + | ====== Combining with TLA+ Animations ====== | ||
| + | |||
| + | When combined with TLA+ animations, interactive state-space exploration truly shines. The textual TLA+ specification is conceptually lifted into the application domain of the system being modeled. Instead of examining raw variable assignments, | ||
| + | |||
| + | Connecting animations to the debugger is **trivial with Watch expressions**—simply add a watch for your animation module' | ||
| + | |||
| + | The first screencast (linked below) demonstrates how to combine the TLA+ Debugger, interactive state-space exploration, | ||
| + | |||
| + | ====== Enhanced Breakpoint Support ====== | ||
| + | |||
| + | The new "Halt (break) after Init and Next" breakpoint that enables interactive state-space exploration supports **breakpoint conditions**, | ||
| + | |||
| + | * For specs that terminate or deadlock, the breakpoint condition '' | ||
| + | * Breakpoint conditions are evaluated both after '' | ||
| + | * The debugger halts even when '' | ||
| + | |||
| + | ====== Loading External Modules ====== | ||
| + | |||
| + | Breakpoint conditions, Watch expressions, | ||
| + | |||
| + | **Exporting trace prefixes** in various formats (JSON, TLA+, binary, etc.) dynamically during a debugging session. For example, you can evaluate this Watch expression: | ||
| + | |||
| + | < | ||
| + | LET J == INSTANCE _JsonTrace | ||
| + | WITH _JsonTraceFile <- " | ||
| + | IN J!_JsonTrace | ||
| + | </ | ||
| + | |||
| + | This exports the current trace to JSON without needing to preconfigure the debugger or manually trigger violations. Several [[https:// | ||
| + | |||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | This export capability is a first step towards the goal outlined in [[https:// | ||
| + | |||
| + | ====== Background ====== | ||
| + | |||
| + | The TLA+ Debugger was first released in 2022 (see [[https:// | ||
| + | |||
| + | ====== Credit Where Credit is Due ====== | ||
| + | |||
| + | Interactive state-space exploration was pioneered by Will Schultz in [[https:// | ||
| + | |||
| + | The TLA+ Debugger implementation builds on this concept while offering complementary capabilities: | ||
| + | |||
| + | * **Step through individual formulas** of your specification at the expression level | ||
| + | * **Support for the largest fragment of TLA+** by virtue of being implemented on top of TLC | ||
| + | * **Integration with the full debugging ecosystem** (breakpoints, | ||
| + | |||
| + | Both tools have their strengths, and I encourage you to explore both approaches! | ||
| + | |||
| + | ====== Screencasts ====== | ||
| + | |||
| + | Three screencasts demonstrate these new features in action: | ||
| + | |||
| + | 1. [[https:// | ||
| + | 1. [[https:// | ||
| + | 1. [[https:// | ||
| + | |||
| + | ====== Technical Details ====== | ||
| + | |||
| + | For those interested in implementation details, the last 39 commit messages up to and including [[https:// | ||
| + | |||
| + | * Support for conditional breakpoints on initial and next states | ||
| + | * Deterministic sorting of successor states by action location and state values | ||
| + | * Unified infrastructure for Watch and Debug expressions | ||
| + | * Step-in functionality using minimal Hamming distance to select " | ||
| + | * Step-over functionality using maximal Hamming distance to select " | ||
| + | * Preservation of finite stuttering in debugger traces for faithful behavior representation | ||
| + | |||
| + | ====== Feedback Welcome ====== | ||
| + | |||
| + | I'd love to hear your thoughts on these new capabilities! Please feel free to provide feedback here on the mailing list or on GitHub. | ||
| - | < | ||
| - | <iframe width=" | ||
| - | </ | ||
| - | </ | ||