tlaplus: Ability to save TLC error trace in user-defined formats
In some cases it would be helpful to have the ability to save the error trace generated by TLC in an easily parseable format (e.g. JSON) for use by other tools, scripts, applications, etc. I have implemented a minimal prototype of this, using the previously developed functionality from the Json community module. The prototype usage is:
java -cp tla2tools.jar tlc2.TLC -jsonTrace <specname>
which saves a JSON error trace file to trace.json. Of course, the exact CLI interface could be worked out more carefully, but that is just one, basic idea. See an example trace.json file for a broken run of Peterson’s algorithm.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 17 (14 by maintainers)
Commits related to this issue
- Ability to save TLC error trace in JSON format Part of Github issue #640 https://github.com/tlaplus/tlaplus/issues/640 [Feature][TLC][Changelog] — committed to tlaplus/tlaplus by lemmy 2 years ago
- Ability to save TLC error trace in JSON format Evaluate POSTCONDITION also when liveness checking reports a counter-example. When final liveness checking on the complete (behavior) graph finds a cou... — committed to tlaplus/tlaplus by lemmy 2 years ago
- Ability to save TLC error trace in JSON format Add TLCExt!CounterExample Part of Github issue #640 https://github.com/tlaplus/tlaplus/issues/640 [Feature][TLC][Changelog] — committed to tlaplus/tlaplus by lemmy 2 years ago
- Ability to save TLC error trace in JSON format Add TLCExt!ToTrace(CounterExample) Part of Github issue #640 https://github.com/tlaplus/tlaplus/issues/640 [Feature][TLC][Changelog] — committed to tlaplus/tlaplus by lemmy 2 years ago
- Ability to save TLC error trace in JSON format. Handle case that succState is null. Part of Github issue #640 https://github.com/tlaplus/tlaplus/issues/640 [Feature][TLC] — committed to tlaplus/tlaplus by lemmy 2 years ago
- Ability to save TLC error trace in JSON format. Support evaluating multiple post-conditions (not exposed in the config file). Part of Github issue #640 https://github.com/tlaplus/tlaplus/issues/640 ... — committed to tlaplus/tlaplus by lemmy 2 years ago
- Ability to save TLC error trace in JSON format. Pass a generic map of command-line parameters to Tool and SpecProcessor. Part of Github issue #640 https://github.com/tlaplus/tlaplus/issues/640 [Fea... — committed to tlaplus/tlaplus by lemmy 2 years ago
- Ability to save TLC error trace in JSON format. Instantiate SpecObj outside of SpecProcessor. Part of Github issue #640 https://github.com/tlaplus/tlaplus/issues/640 [Feature][TLC] — committed to tlaplus/tlaplus by lemmy 2 years ago
- Ability to save TLC error trace in JSON format. Add ability to dynamically add post-conditions on the command-line. Part of Github issue #640 https://github.com/tlaplus/tlaplus/issues/640 [Feature]... — committed to tlaplus/tlaplus by lemmy 2 years ago
- Ability to save TLC error trace in JSON format. Add "-dumpTrace" parameter to TLC (currently support for json). Part of Github issue #640 https://github.com/tlaplus/tlaplus/issues/640 [Feature][TLC... — committed to tlaplus/tlaplus by lemmy 2 years ago
- Ability to save TLC error trace in JSON format. Show error message instead of exception when -dumpTrace command lacks file sub-parameter. Part of Github issue #640 https://github.com/tlaplus/tlaplus... — committed to tlaplus/tlaplus by lemmy 2 years ago
- Ability to save TLC error trace in JSON format. Print success *after* serialization. Part of Github issue #640 https://github.com/tlaplus/tlaplus/issues/640 [Feature][TLC] — committed to tlaplus/tlaplus by lemmy 2 years ago
- Ability to save TLC error trace in JSON format. Add TLA+ ("tla") format. Part of Github issue #640 https://github.com/tlaplus/tlaplus/issues/640 [Feature][TLC] — committed to tlaplus/tlaplus by lemmy 2 years ago
- Ability to save TLC error trace in JSON format. Document new -dumpTrace and -postCondition parameters in current-tools.md and command-line help. Part of Github issue #640 https://github.com/tlaplus/... — committed to tlaplus/tlaplus by lemmy 2 years ago
- Ability to save TLC error trace in TLC's binary format. Part of Github issue #640 https://github.com/tlaplus/tlaplus/issues/640 [Feature][TLC] — committed to tlaplus/tlaplus by lemmy 2 years ago
- Fall back to newly introduced TLCStateInfo#action if TLCState#hasAction is false. TLCState#hasAction is true if TLC is running simulation, or when debugging (-debugger) a spec in BFS mode. Part of G... — committed to tlaplus/tlaplus by lemmy 7 months ago
From a user perspective, I would prefer to have a dedicated command line flag that dumps the error trace to a specified JSON file. This seems the most straightforward approach. I would prefer to not have to write extra commands in TLA+ just to dump an error trace to a file. Using the
POSTCONDITIONfeature/syntax just feels too esoteric.This is done:
@konnov @danwt Adding support for ITFTrace is a matter of writing a TLA+ definition that converts the
CounterExampleinto your format and serializing your format withJsonSerialize. The code-level changes will be a one-liner in (TLC.java](https://github.com/tlaplus/tlaplus/blob/386eaa19f4d610781a79c95730638ba193cec614/tlatools/org.lamport.tlatools/src/tlc2/TLC.java#L589-L595)./cc @konnov @andrey-kuprianov @danwt related to https://apalache.informal.systems/docs/adr/015adr-trace.html
I’m happy to review a PR that adds a command-line flag as described in https://github.com/tlaplus/tlaplus/issues/640#issuecomment-869070134 that is based on the infrastructure provided in https://github.com/tlaplus/tlaplus/commit/b9ab320da557646d174528b5c92b995611378e6e.