A Tour of Temporal Typing Refinement & Models · 4/5
Refinement & Models · Page 4 of 5

Front-End Diagnostics & Subset

Before any backend runs, the shared front-end (python -m temporal_typing PATH ...) parses your source and rejects anything no checker could verify soundly — always in plain Python terms with a diagnostic code and file:line:

  • level-error — e.g., prime(...) inside an Invariant.
  • no-transition — Action() on a method whose body is ....
  • no-init, missing-domain, bad-binding, misplaced-clause.
  • unsupported — constructs outside the verifiable Python subset (such as float division / instead of //, try, with, or I/O).
Exercise — Fix the Diagnostics: Click Check to see the two front-end errors on the right. Fix both:
1. Change Invariant to ActionInvariant (and import it).
2. Replace ... in step with a real body (e.g., if self.x < 5: self.x += 1).
Click Check until you get PASS!
Click Check (or press Shift+Enter) to run the front-end and check this specification. Switch to TLA⁺ to view its TLA⁺ meaning.
---- MODULE FixedSpec ----
EXTENDS Integers
VARIABLE x

Init == x = 0
Step == x' = IF x < 5 THEN x + 1 ELSE x
Next == Step
Spec == Init /\ [][Next]_x

NonDecreasing == [][x' >= x]_x
====