Specifications & State · Page 2 of 6
Initial States & Defaults
The initial-state predicate Init is the conjunction of two sources:
- Every
Init(lambda s: ...)clause in@spec. - Every class-level or dataclass default on a
State/Ghostfield (e.g.,target: State[int] = 20meanss.target == 20).
__init__ is ordinary Python and does not take part in
Init. A state variable with no default and no Init clause mentioning
it is a static error (no-init).
An Init clause may allow several starting values — for example
s.current in range(18, 23) — causing the checker to explore from every matching
initial state. Note: if a field has both a default and an Init clause, both are
conjoined; remove = 20 on current if you want all 5 starting temperatures
to be explored independently!
Try it: Notice
current has both = 20 and
s.current in range(18, 23) — so only current = 20 starts!
Remove = 20 on current to explore all 5 initial states (18..22).
Then remove = 20 on target too and see ERROR [no-init].