The input-scanning query machine for inductive counting #
The machine first counts the read-only input in binary. It then runs the streaming counting
controller on the compact configuration graph of a stored radix, starting from
Turing.MultiTapeNTM.ConfigurationGraph.startRadix, in two modes:
- while the radix is unchecked, the controller's bad vertices are those whose source step leaves
the radix (
Turing.MultiTapeNTM.ConfigurationGraph.overflow). If the final count check of a branch is complete and has met such a vertex, that vertex is certifiably reachable, and the machine moves to four times the radix. If the controller accepts, the radix is closed (Turing.InductiveCounting.Closed), and the machine checks it; - once the radix is checked, the bad vertices are the accepting ones, and the controller's verdict is final.
So the radix grows only as far as the source's reachable views require, and the source needs no constructible space bound: as in Immerman's remark after his Theorem 1, the space is allowed to increase as needed [Imm88]. Neither the input nor a sequence of choices is stored in the state. Each query phase requests exactly the input symbol of its vertex.
Main definitions #
Turing.InductiveCounting.Runtime: the input counter, the radix, the mode and the controller.Turing.InductiveCounting.queryMachine: the complete binary-choice query machine.Turing.InductiveCounting.RuntimeInvariant: the semantic invariant of reachable states.
Main results #
Turing.InductiveCounting.runtimeInvariant_run: every prefix satisfies the invariant.Turing.InductiveCounting.queryMachine_accepts_iff_not_accepts: the machine accepts exactly the inputs the source does not accept, when some radix is closed.
References #
Before counting, counting = none and length is the next input position to inspect.
Afterward length is the full input length, radix the current radix, checked records that the
radix is closed, and counting is the bounded controller state.
- length : ℕ
A binary input-length counter.
- radix : ℕ
The radix of the current compact graph.
- checked : Bool
Whether the radix has been certified closed.
- counting : Option Cslib.InductiveCounting.State
The controller is installed only after the end of the input has been read.
Instances For
The bad vertices of a mode: those whose step leaves the radix while it is unchecked, the accepting ones once it is checked.
Instances For
Answer a pending graph request using at most the one supplied input symbol.
Instances For
The input position of the controller's pending request: that of its first vertex.
Instances For
Input lookup for the length scan or the controller's pending request.
Instances For
The controller installed on the graph of radix B.
Instances For
The final count check is complete and has met a bad vertex.
Instances For
The first phase increments a binary input counter. The second executes one checked controller instruction, unless the unchecked radix is found to overflow or to be closed. There is no unbounded search for a valid random guess.
Instances For
A runtime halts when its controller rejects, or accepts on a checked radix.
Instances For
Acceptance is the controller's acceptance on a checked radix.
Instances For
The full uniform query machine. The original native machine is fixed when its program is selected; the runtime input does not supply code or advice.
Instances For
Steps of the machine #
One controller step on the graph of radix B.
Instances For
A controller replay on the graph of radix B.
Instances For
A request reads the same original input symbol as the compact configuration graph.
A controller step from a state at the final count check halts.
Replays of a halted controller state stay halted.
After the length scan, a step that neither moves to a larger radix nor checks the radix is exactly one checked controller step, including on halted branches.
A complete final count check meeting an overflowing vertex moves to four times the radix.
Acceptance on an unchecked radix checks it.
On a checked radix, the machine's replays are exactly the controller's replays.
On an unchecked radix, a controller replay ending at the final count check is also a replay of the machine: no earlier state can move to another radix or check this one.
On an unchecked radix, a controller replay ending in acceptance has a prefix that is a replay of the machine reaching acceptance on this radix.
Reading the first absent input bit installs the controller on the first radix.
Every choice sequence of bootstrap length reaches exactly the installed controller.
The semantic invariant #
The semantic invariant of every runtime state reachable on input: the radix is that of a
round whose earlier radices are not closed, the controller satisfies the semantic and storage
invariants of its graph and mode, and a checked radix is closed.
Instances For
A complete final count check meeting an overflowing vertex shows that the radix is not closed.
Every step preserves the invariant, whatever the choice.
Every choice prefix satisfies the invariant.
Acceptance #
Every accepting branch certifies native nonacceptance: it accepted on a checked, hence closed, radix. No space bound of the source is used.
The machine accepts exactly the inputs the source does not accept, provided some round's radix is closed, as a space bound of the source guarantees.