Theory Multitape_Finite_Control
theory Multitape_Finite_Control
imports Multitape_Substrate
begin
section ‹Finite-control small-input recogniser›
text ‹A reusable substrate construction for the ubiquitous low-level
move: finitely many bounded-length inputs are decided directly by
the finite control, reading the input in a fixed number of moves;
only longer inputs need run a real machine.
This theory provides the atom ∗‹finite recogniser›: given a finite
input alphabet ‹Sg›, a concrete tape alphabet ‹Gamma› with a blank
and a left endmarker, a finite set ‹F› of words over ‹Sg›, and a
tape count ‹k›, it builds a deterministic machine that decides ‹F›
--- accepting each member reading only its input. The combinator
∗‹finite patch›, which reuses the recogniser on short inputs and
hands off to an arbitrary machine on long inputs, is built on top.
The construction is read-only: it never modifies the tape (the
write component of every transition equals its read component), so
the left-endmarker write discipline is vacuous and only the head
movement carries the left-endmarker read discipline.›
subsection ‹Recogniser state space›
text ‹Three phases: @{text "FR_Scan u"} has read the prefix ‹u› of the
input so far, @{text FR_Acc} has accepted, @{text FR_Rej} has
rejected. The scan payload ranges over words of length at most the
recogniser's cutoff, so the state set is finite.›