Welcome · Page 1 of 3

Hello, Temporal Typing

Welcome to A Tour of Temporal Typing.

Python's typing module says what values a program takes and gives. temporal-typing says how its state may change: invariants, actions, contracts, fairness, temporal properties, and refinement — with the semantics of TLA⁺.

The specification sits directly on the Python code it describes, so the two cannot drift apart silently. On the right is Leslie Lamport's classic HourClock — a clock that shows only the hour from 1 to 12.

The tour is interactive. Click Check (or press Shift+Enter) to run the front-end and check the model. Switch to the TLA⁺ tab in the bottom-right pane at any time to see the equivalent TLA⁺ specification.

Try it: Click Check to verify all 12 reachable states. Then break the implementation by changing self.hr != 12 to self.hr != 13 in the method body and click Check again — watch the checker catch the mismatch between code and specification. Click Reset to restore the original code.

Navigate with the < and > buttons below (or PageUp / PageDown), or open the Table of Contents from the top-right menu.

Click Check (or press Shift+Enter) to run the front-end and check this specification. Switch to TLA⁺ to view its TLA⁺ meaning.
---- MODULE HourClock ----
EXTENDS Integers
VARIABLE hr

HCini == hr \in 1..12
HCnxt == hr' = IF hr # 12 THEN hr + 1 ELSE 1
HC    == HCini /\ [][HCnxt]_hr

TypeOK == hr \in 1..12
====