---- MODULE BoxTrace ---- \* The box office's one promise: no seat is sold twice. The monitor rebuilds \* who holds each seat from the journal's `hold` entries, checks every `free` \* answer against it, and refuses the run at the first hold of a seat that \* is already sold. EXTENDS Integers, Sequences, TLC, TraceData Unmodeled == {"Env.Vars.get", "Io.Stdout.println"} VARIABLES sold Init == sold = [s \in {} |-> ""] MapEvent(e) == \/ /\ e.op = "Box.Seats.free" /\ e.vBool = (e.argv[1] \notin DOMAIN sold) /\ sold' = sold \/ /\ e.op = "Box.Seats.hold" /\ e.argv[1] \notin DOMAIN sold /\ sold' = sold @@ (e.argv[1] :> e.argv[2]) \/ /\ e.op \in Unmodeled /\ sold' = sold Ended == Ending.method = "returned" ====