Request for comment: adding EXPECT statements to model files

19 views
Skip to first unread message

Andrew Helwer

unread,
Apr 6, 2026, 12:56:56 PM (yesterday) Apr 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
Reply all
Reply to author
Forward
0 new messages