← all environments 09 · Advanced · UML statechart · v0.2.1
Live State Machine
UML statechartA traffic-signal controller drawn as a genuine UML state machine — initial pseudostate, three states, four guarded transitions. Firing an event (or letting the timer run) moves a live token: the active state glows, the taken transition pulses, and an event-trace log records the run. The diagram is not a picture of the machine; it is the machine.
4 components · 4 connections · event-driven finite-state executor
the ahaThe boxes-and-arrows diagram is not documentation of the machine — run an event through it and it is the machine.
why it works
A finite-state machine is a transition function : given the current state and an event , it names exactly one next state — but only if the transition’s guard is satisfied. That is the whole of it. A traffic light is and the events are timer expiries. What schemd lets you see, that a textbook cannot, is that the drawing and the behaviour are the same object: the token sitting on Red is the machine’s state, and firing literally advances along the arrow you drew. Composability, unreachable states, and deadlocks stop being abstractions — they are places the token can or cannot go.
governing model
structural inventory
- initial pseudostate
- Red / Green / Yellow states
- 4 guarded transitions
- event queue + trace log
boundaries
- deterministic
- one active state
- guarded, timed transitions
fault relay transition guard inverted (deadlock)
-
Fire the timer events in sequence.
Red → Green → Yellow → Red. The active state glows and each taken transition pulses; the trace log is the exact run . -
Try to fire an event with no matching transition.
Nothing happens — and that nothing is meaningful. A well-formed machine simply has no arrow for an impossible input; the token holds. -
Invert a guard.
Flip one transition’s condition and the machine reaches a state it can never leave — a deadlock. You are watching a liveness bug happen, not reading about one.
causal signal trace paused
Enter the machine Power-on follows the initial transition into Red.
step 1 / 4 Enter the machine
Loading Live State Machine model…