Turing machines over a universe, without a vocabulary #
The semantics half of the machine bridge: what it means for a nondeterministic
Turing machine, presented as relations on a universe, to accept. No
vocabulary appears here – DescriptiveComplexity.Problems.Machine.Defs supplies one and
reads these definitions off a structure – so that the reductions, which build
machines rather than read them, can reason about runs without unfolding any
RelMap.
The model #
A machine is DescriptiveComplexity.TMData: the sorts (Posn, Tr), the marks
(Start, Acc, Blank, Right), the binary attributes of a transition
(Src, Read, Dst, Write), the initial tape Inp, and a linear order
Le. Two decisions from the plan are visible in the types.
- Transitions are elements. A transition is an element
τof the universe with four binary attributes, rather than a 5-ary relation; every relation here has arity at most two, which is what keeps the defining formulas of an interpretation indexed by pairs of tags. - Time steps and tape cells are the same sort. A configuration's head is a
position, and the time bound of
DescriptiveComplexity.TMData.Acceptsis the number of positions – a unary bound by construction, with no arithmetic. A head at the last position moving right has no successor (DescriptiveComplexity.SuccPosfails), and the run simply stops.
The tape is a total function A → A, so the semantics is total: reading a cell
never fails. Which functions count as initial tapes is
DescriptiveComplexity.TMData.InitTape – the input where it is defined, blank elsewhere –
stated as a relation so that no choice is needed and so that the first-order
kernel of the membership proof can check it literally.
Transport #
DescriptiveComplexity.TMData.Agree records that two machines over different universes
correspond along an equivalence, fieldwise; DescriptiveComplexity.TMData.accepts_congr
transports acceptance along it. This is all the isomorphism-invariance proof of
the decision problems needs.
A configuration: the current state, the position of the head, and the contents of the tape.
- state : A
The current state.
- head : A
The cell the head is on.
- tape : A → A
The symbol in each cell.
Instances For
Dependency graph
Dependency graph
Dependency graph
A Turing machine presented as relations on a universe: the sorts, the marks, the attributes of the transitions, the initial tape and the order along which the head moves.
- Posn : A → Prop
Being a position – a tape cell, and equally a time step.
- Le : A → A → Prop
The order on positions, along which the head moves.
- Tr : A → Prop
Being a transition.
- Start : A → Prop
Being a start state.
- Acc : A → Prop
Being an accepting state.
- Blank : A → Prop
Being the blank symbol.
- Right : A → Prop
This transition moves the head right (rather than left).
- Src : A → A → Prop
The state a transition applies in.
- Read : A → A → Prop
The symbol a transition reads.
- Dst : A → A → Prop
The state a transition moves to.
- Write : A → A → Prop
The symbol a transition writes.
- Inp : A → A → Prop
The input: the symbol initially in a cell.
Instances For
Dependency graph
The symbols a cell may initially hold: the input symbol where the input is defined, the blank elsewhere.
Instances For
Dependency graph
Being an initial configuration: a start state, the head on the lowest position, and an initial tape.
Equations
Instances For
Dependency graph
One step. Some transition applies in the current state to the symbol under the head: it writes in that cell, changes state, and moves the head to the neighbouring position in the direction it names. Cells other than the one under the head are unchanged, and a move off the end of the tape is impossible – there being no such neighbour, no step is available and the run stops.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Reaching one configuration from another in exactly n steps.
Equations
Instances For
Dependency graph
Acceptance: some run from an initial configuration reaches an accepting state within as many steps as there are positions.
The bound is unary by construction – it counts elements of the universe – which
is what makes this an NP problem rather than an NEXP one, with no arithmetic
anywhere. A reduction buys itself |Tag| · nᵈ steps by choosing the dimension
d of its interpretation.
The bound is strict because the positions index the time points of the run:
N of them leave N - 1 steps between them, which is what makes
DescriptiveComplexity.TMData.accepts_iff_exists_walk an equivalence on the nose.
Equations
Instances For
Dependency graph
Acceptance in bounded space: some run from an initial configuration reaches an accepting state, with no bound on its length.
This is DescriptiveComplexity.TMData.Accepts with the step bound dropped, and
that is all the difference between the time-bounded and the space-bounded model:
the space is already bounded by construction, since the tape is indexed by the
positions and a reduction of dimension d therefore buys nᵈ cells exactly as
it buys nᵈ steps. What changes is that a run no longer fits inside the
structure – it may visit exponentially many configurations – so acceptance is
reachability in the configuration graph rather than a walk indexed by the
positions, which is why the membership proof for the space-bounded problems is
an SO(TC) specification rather than a Σ₁ definition.
Equations
- M.AcceptsSpace = ∃ (c₀ : DescriptiveComplexity.Config A) (c : DescriptiveComplexity.Config A), M.IsInit c₀ ∧ Relation.ReflTransGen M.Step c₀ c ∧ M.Acc c.state
Instances For
Dependency graph
A run extended by one more step at its end.
Dependency graph
A run decomposed at its far end: n + 1 steps are n steps and then
one. DescriptiveComplexity.TMData.StepsIn recurses at the near end; inductions along
the time order – the fixed-point description of a deterministic run – need
this reading.
Dependency graph
A run splits anywhere: m + k steps decompose into m and then k,
through the configuration reached halfway. This is what lets two runs from the
same configuration be compared at a common time.
Dependency graph
Runs compose. Phases of a constructed machine are proved one at a time and chained with this; the step counts add, which is the form the budget obligation of a reduction takes.
Dependency graph
Well-formedness, folded into the yes-instances in the style of
DescriptiveComplexity.IsLinOrd for Knapsack: the order is linear, there is a position
to start on, the input is functional, and there is exactly one blank symbol.
Every conjunct is first-order, so the Σ₁ kernel can check it.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Determinism, folded into the yes-instances of
DescriptiveComplexity.DTMAccept: one start state, at most one transition applicable
in a given state on a given symbol, and at most one destination and written
symbol per transition. Together with well-formedness this leaves at most one
step from any configuration (DescriptiveComplexity.TMData.step_functional) and at
most one initial configuration (DescriptiveComplexity.TMData.isInit_unique), so the
run is unique – the shape a least fixed point can compute. Every conjunct is
first-order.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
A well-formed initial tape is functional: a cell holds either its unique input symbol or the unique blank, and the two cases exclude each other.
Dependency graph
A machine with one start state has at most one initial configuration: the start state and the lowest position are pinned, and well-formedness makes the initial tape functional.
Dependency graph
A well-formed machine with a start state has an initial configuration: put the head on the lowest position and read the tape off the input, filling the unwritten cells with the blank.
Dependency graph
Transport along an equivalence of universes #
Two machines over different universes agree along an equivalence when every relation of one is the pullback of the other's.
The positions correspond.
The orders correspond.
The transitions correspond.
The start states correspond.
The accepting states correspond.
The blanks correspond.
The directions correspond.
The sources correspond.
The read symbols correspond.
The destinations correspond.
The written symbols correspond.
The inputs correspond.
Instances For
Dependency graph
Transport of a configuration along an equivalence.
Equations
Instances For
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Every configuration over A is the transport of one over B.
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Acceptance transports along an equivalence.
Dependency graph
Reachability in the configuration graph transports along an equivalence.
Dependency graph
Acceptance in bounded space transports along an equivalence.
Dependency graph
Determinism transports along an equivalence.