Skip to content

Instantly share code, notes, and snippets.

@hwayne
Created June 9, 2026 15:41
Show Gist options
  • Select an option

  • Save hwayne/1104255d2ddaaf08e6d8b53661b49fc6 to your computer and use it in GitHub Desktop.

Select an option

Save hwayne/1104255d2ddaaf08e6d8b53661b49fc6 to your computer and use it in GitHub Desktop.
How to override a spec operator with itself and something else
---- MODULE foo ----
EXTENDS Integers
VARIABLE x
\* ...
Init == x \in 1..1000
\* ...
====
Same as the foo spec, expect it forces the initialized value of x to be 1.
Tying FastInit to a quantified import prevents the stack overflow bug we get otherwise
---- MODULE foo_fast ----
EXTENDS foo
Overrides == INSTANCE foo
FastInit == Overrides!Init /\ x = 1
====
---- CONFIG foo_fast ----
CONSTANT Init <- FastInit
====
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment