The nondeterministic universal machine within a space budget #
A description d (Turing.MultiTapeTM.Universal.Desc), read nondeterministically
(Turing.MultiTapeTM.Universal.NStep), accepts x within the budget b
(Turing.MultiTapeTM.Universal.BAccepts) when some computation of it on x halts with the output
[1] and every configuration of the simulation it reaches after the first is encoded within b
bits (Turing.MultiTapeTM.Universal.BStep).
The universal recognizer Turing.MultiTapeTM.Universal.budgetedNUniversal decides this by guessing
the computation one transition at a time, as a nondeterministic query machine
(Turing.NondeterministicQueryMachine): its state holds the table of d, a cursor into the table,
the budget, the configuration of the simulation and the first two symbols of the output, and it
reads the input in place, at the simulated input head. A choice false moves the cursor to the
next entry; a choice true fires the entry under the cursor, if its key matches the
configuration, and returns the cursor to the start of the table. A branch rejects when the cursor
runs off the table, when the entry under the cursor does not match, or when the configuration
leaves the budget. So the machine accepts exactly when d accepts within the budget
(Turing.MultiTapeTM.Universal.budgetedNUniversal_accepts_iff).
Its state takes space linear in the description, the budget and the configuration, so the native
compiler of query machines gives a nondeterministic recognizer within space O(S) for any S
that bounds the description, the budget and log₂ n
(Turing.MultiTapeTM.Universal.exists_recognizesInSpace_bAccepts). Unlike the deterministic
Turing.MultiTapeTM.Universal.budgetedUniversal, the input is never copied and no clock is kept:
a recognizer may run forever.
Main definitions #
Turing.MultiTapeTM.Universal.BStep,Turing.MultiTapeTM.Universal.BAccepts: the steps and the acceptance of a description read nondeterministically, within a budget.Turing.MultiTapeTM.Universal.budgetedNUniversal: the universal recognizer within a budget.
Main results #
Turing.MultiTapeTM.Universal.BAccepts.mono,Turing.MultiTapeTM.Universal.BAccepts.exists_reflTransGen_nStep: a larger budget accepts more, and acceptance within a budget is acceptance.Turing.MultiTapeTM.Universal.budgetedNUniversal_accepts_iff: the recognizer accepts exactly when the description accepts within the budget.Turing.MultiTapeTM.Universal.accepts_iff_bAccepts_descN: a machine withinScells accepts exactly when its description accepts within any budget at least the size of its configurations.Turing.MultiTapeTM.Universal.budgetedNUniversal_query_inSpaceand its siblings fornext,haltedandaccept,Turing.MultiTapeTM.Universal.length_eNU_run_le: the parts of the recognizer are computable in linear space, and its states are linear in the description and the budget, as the native compiler of query machines requires.Turing.MultiTapeTM.Universal.exists_recognizesInSpace_bAccepts: a native recognizer within spaceO(S).
References #
- M. Sipser, Introduction to the Theory of Computation, Theorem 9.3: the simulation within a space budget in the proof of the space hierarchy theorem.
Acceptance within a budget #
The universal recognizer #
The state of the universal recognizer: the table of the description, the entries from the cursor on, the budget, the configuration of the simulation and the first two symbols of the output.
The universal recognizer within a budget, as a nondeterministic query machine: it queries
the input under the simulated input head, guesses the transitions one entry of the table at a
time, halts with the simulation and accepts on the output [1].
Its initial state is irrelevant: it is started at Turing.MultiTapeTM.Universal.nuStart with
Turing.NondeterministicQueryMachine.withInit.
The start of the universal recognizer on the description d within the budget b.
Correctness #
Space certificates #
The size of the reachable states #
The start of the universal recognizer, for a description and a budget computed within a space bound, is computed within that bound.
Machines within a space bound #
A machine within S cells accepts exactly when its description accepts within a budget
b at least the size bound Turing.MultiTapeTM.Universal.cfgSpaceBound of its configurations.
The compiled recognizer #
A native nondeterministic recognizer of acceptance within a budget, in space O(S): for a
description D a and a budget B a computed from the input a within the space S a ≥ log₂ |a|,
the inputs a on which D a accepts a within the budget B a.