Animation Support for Traces
See original GitHub issueGoals and Motivation
The Animation module is a TLA+ module that provides operators that serve as the basis of a simple vector graphics description language, as well as the ability to animate TLC execution traces. The current instructions for using this module are described in the linked Github repository. The goal is to integrate the functionality of the Animation module with TLC and the Toolbox, so that animation traces can be generated without impacting model checking performance, and so that animations can be easily viewed directly inside the toolbox. An animation trace would be automatically generated by TLC and opened in a web viewer pane in the Toolbox when a trace violates an invariant, analogous to how the Error Trace Explorer works. Using TLA+ itself as a graphics description language will be easier and more natural for existing users of TLA+. They will not need to learn a new language or framework to create animations of their specifications.
Design Ideas
We can add a new flag (e.g. --animationSpec
) to TLC that takes as a parameter a user’s “animated spec” expression, call it AnimSpec. AnimSpec contains the same variables as an original spec, but adds auxiliary variables that track animation related state. It is not necessary for this animation related state to be tracked during the entire model checking procedure. Currently, when TLC finds a violating error trace, it does not have access to all states of that trace. It only has the fingerprints of each state. For error trace exploration, TLC already re-constructs the full state of each step in an error trace. If a user wants to view the animated error trace, then during this re-construction process, TLC can use AnimSpec instead of the original specification. This will produce the animation for that specific error trace. Since AnimSpec adds auxiliary variables, we will want these variables to be ignored by using a “view”, so that the state fingerprints generated during animated trace generation are identical to the original fingerprints. Once TLC generates the animated trace, the generated HTML/SVG string can be copied into a standard HTML template, which can then be opened in a web viewer pane in the toolbox.
Note that If the evaluation of AnimSpec fails during trace re-construction, TLC can always fall back to the standard Spec, print an error message, and not produce or open the animation.
Issue Analytics
- State:
- Created 5 years ago
- Comments:23 (23 by maintainers)
From what my current implementation looks like, I think the changes should be relatively isolated, without much risk of breaking any existing functionality. Ideally the changes will have no impact for users if they don’t choose to use the feature. I will keep the “blast radius” in mind, though, as I continue to work on this.
@will62794 As per last week’s discussion, I consider this feature done.