SCENARIOS / SC-021 / TURING'S FIRST EXAMPLE
SC-021 Turing Machine

Turing's First Example

Turing's 1936 first machine — prints 0 1 0 1 … rightward forever, never halting.

Sync Tick Turing
Machine replay — the head printing 0 1 0 1 … rightward FULLSCREEN ⤢
Clock Tick — one step per turn
Update Synchronous
States 4 (b, c, e, f)
Symbols 1 (blank-only)
Halts Never
OVERVIEW

Turing's 1936 first example, modelled as a true Turing machine rather than a hard-coded loop. The tape is a chain of Cell entities and the read/write head is a single Head entity holding a reference to the cell under it. The head cycles through four states — b prints a 0 and steps right, c steps right, e prints a 1 and steps right, f steps right — so the tape fills with the sequence 0 _ 1 _ 0 _ 1 _ … forever. There is no halt state; the machine runs as long as you let it.

The smallest possible introduction to the modelling pattern shared by every Turing scenario: a one-dimensional tape that extends itself on demand. When the head needs a square that does not yet exist, the current cell spawns a new neighbour, wires up the left/right references, and goes passive again — so the tape is always exactly as long as the computation has reached, with no global scan and no pre-allocated bound.

TRAITS
Sync
Advances on a single global clock
Tick
Discrete fixed-step time
Turing
A head reads & writes an unbounded tape
SCHEMA

Linked tables with guaranteed referential integrity.

TABLECOLUMNSDESCRIPTION
cell ID, symbol, written, has_right, left_id, right_id, current_state One row per tape square: the printed digit, a written flag (0 = blank), and the self-built left/right neighbour references.
head ID, current_id, nc, current_state The single read/write head: a reference to the cell beneath it, a state counter, and its b/c/e/f control state.
LIVE API

Generated REST endpoints. Also exposed as MCP tools.

POST /scenarios/turing-first-example/experiments Seed a fresh tape and head
POST /scenarios/turing-first-example/experiments/{eid}/run Advance the machine N steps
GET /scenarios/turing-first-example/experiments/{eid}/entities/cell Read the tape, one row per square
GET /scenarios/turing-first-example/experiments/{eid}/events Append-only step log
GET /scenarios/turing-first-example/experiments/{eid}/dataset Download the exported dataset
SEMANTIC LAYER

OSI-compatible definition, emitted with the dataset.

# turing-first-example.osi.yaml — emitted automatically
semantic_model:
  name: "turing-first-example"
  source: "duckdb://turing-first-example.db"
  entities:
    - name: cell
      primary_key: id
  dimensions:
    - name: state
      type: categorical
    - name: t
      type: time
  measures:
    - name: row_count
      agg: count
    - name: active
      agg: sum
      filter: "state = 'ACTIVE'"