← Labs 07

Live State Machine

UML statechart

A 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.

live circuit · mode=full state RED
Live State Machine4 components and 4 connections.powert > Tredt > Tgreent > TyellowRedGreenYellow
Live State Machine

Run the machine or fire events by hand. Click a state or transition to read it.

The token sits on the active state. Let the guarded timers run, or fire the next event by hand — the diagram is the machine.

Auto-run uses the causal stage delay configured in the timeline above.

enabled transition RED→  t > T  GREEN\htmlData{math-slot=from}{\text{RED}}\xrightarrow{\;\htmlData{math-slot=guard}{\text{t > T}}\;} \htmlData{math-slot=to}{\text{GREEN}}

switchboard · fault injection

causal signal trace paused

Enter the machine Power-on follows the initial transition into Red.

step 1 / 4 Enter the machine

Notebook · 4 parts · 4 wires · event-driven finite-state executor

recommended lab 7 of 18

Predict guarded state transitions and identify a liveness failure.

Builds on: 8-Bit Digital Adder

predict · then test

An event arrives with no enabled transition from the current state. What must a deterministic machine do?

Commit before the explanation appears. This is a prediction, not a quiz score.

governing model
δ:S×Σ→S  ⋅  (s,e)↦snext if guard(e)\delta : S \times \Sigma \rightarrow S \;\cdot\; (s, e) \mapsto s_{\text{next}} \text{ if guard}(e)
structural inventory
  • initial pseudostate
  • Red / Green / Yellow states
  • 4 guarded transitions
  • event queue + trace log
boundaries
  • deterministic δ\delta
  • one active state
  • guarded, timed transitions
diagnosis challenge Fault identity withheld: infer it from the changed outputs first.