Skip to content
Tape‑n‑Trace
PracticeSearch 26 tools

← All case studies

Traffic light controller

CO1BTL 4 – AnalyzeSDG 11 — Sustainable Cities & CommunitiesModule 1

Red, red-amber, green, amber, back to red — one step per tick "t", with an emergency "e" that drops straight to red from wherever it is. Green is the accepting state, so the machine accepts exactly those tick sequences that leave the light on green. A controller is not really an acceptor, and framing it as one is the modelling step worth noticing.

tttt, eeeeRedRedAmberGreenAmber
Try
tttt, eeeeRedRedAmberGreenAmber

Input

0 of 2 read

Narration

Red

Start in state Red with "tt" still to read.

Hopcroft 2e, §2.2.4

Accepted

Run many strings

One string per line. A blank line means the empty string.