SCENARIOS / SC-023 / PALINDROME DECIDER
SC-023 Turing Machine

Palindrome Decider

A decider that erases matching ends and sweeps inward — halting in Accept or Reject.

Sync Tick Turing
Machine replay — erasing matching ends, halting in Accept FULLSCREEN ⤢
Clock Tick — one step per turn
Update Synchronous
States 6 + Accept / Reject
Symbols 3 (blank, a, b)
Halts Accept or Reject
OVERVIEW

A genuine decider — a machine that halts with a yes/no answer. Over the alphabet { a, b } it remembers the first symbol in its control state, erases it, walks to the opposite end, and checks the symbol there matches what it remembered; if so it erases that too and turns back. The input shrinks from both ends until either the tape is empty (Accept) or a mismatch is found (Reject). The seeded input abba is a palindrome, so the head finishes in the Accept halt state.

The counterpoint to the non-halting examples: a machine that terminates with a decision. It exercises both halt states, the remember-in-state trick that lets a finite control compare two distant symbols, and the full two-directional sweep over a bounded tape — a compact, fully observable test of accept/reject reasoning.

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, left_id, right_id, current_state One row per tape square over { blank, a, b }, with left/right neighbour references; squares are erased to blank as the ends are matched.
head ID, current_id, nc, current_state The read/write head: the cell beneath it and its control state, including the Accept and Reject halt states.
LIVE API

Generated REST endpoints. Also exposed as MCP tools.

POST /scenarios/palindrome/experiments Seed a tape with an input word
POST /scenarios/palindrome/experiments/{eid}/run Run the decider to its halt state
GET /scenarios/palindrome/experiments/{eid}/entities/head Read the head's final Accept/Reject state
GET /scenarios/palindrome/experiments/{eid}/events Append-only step log
GET /scenarios/palindrome/experiments/{eid}/dataset Download the exported dataset
SEMANTIC LAYER

OSI-compatible definition, emitted with the dataset.

# palindrome.osi.yaml — emitted automatically
semantic_model:
  name: "palindrome"
  source: "duckdb://palindrome.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'"