Request for comment: adding EXPECT statements to model files

48 views
Skip to first unread message

Andrew Helwer

unread,
Apr 6, 2026, 12:56:56 PMApr 6
to tla...@googlegroups.com
Hi all,

I've implemented a feature in TLC to accept an EXPECT statement in model files. This lets you assert that a given model file is expected to produce a violation. You can see the PR here; please leave feedback if you have any! https://github.com/tlaplus/tlaplus/pull/1269

Currently all this does is make TLC exit with code 0 if the expected violation is generated. It exits with a nonzero code if a different violation was generated, or if no violation was generated. You can assert one of the following in your model file:
  • EXPECT NO_VIOLATION
  • EXPECT ASSUMPTION_VIOLATION
  • EXPECT DEADLOCK_VIOLATION
  • EXPECT SAFETY_VIOLATION
  • EXPECT LIVENESS_VIOLATION
  • EXPECT ASSERT_VIOLATION
If feedback all seems positive I will write some tests for the feature.

Andrew Helwer

Andrew Helwer

unread,
May 30, 2026, 2:44:57 PM (6 days ago) May 30
to tla...@googlegroups.com
Thank you to all who responded with your feedback. I somewhat arduously added unit tests for the various cases (would have been much easier if TLC could be run multiple times from within the same process but alas) so the changes implementing this feature are now ready for review and hopefully merge! https://github.com/tlaplus/tlaplus/pull/1269

Andrew Helwer
Reply all
Reply to author
Forward
0 new messages