Nondeterministic query machines #
A query machine with one binary nondeterministic choice per step. An abstract state can be
infinite; it is data to be encoded on work tapes, rather than native finite control. The input
is read by position, with none returned beyond its end. Halted states self-loop.
Finite lists of choices describe paths at the proof level. They are not additional inputs or work tapes of the machine. Acceptance requires both halting and an accepting state.
Main definitions #
Turing.NondeterministicQueryMachine: the binary-choice query model.Turing.NondeterministicQueryMachine.replay: replay choices from an arbitrary state.Turing.NondeterministicQueryMachine.RunPath: finite paths of the step relation.Turing.NondeterministicQueryMachine.Accepts: existential acceptance by a halted branch.Turing.NondeterministicQueryMachine.withInit: the same machine with another start state.
Main results #
Turing.NondeterministicQueryMachine.exists_runPath_iff: paths are exactly finite replays.Turing.NondeterministicQueryMachine.accepts_iff_length: an all-branches halting bound lets acceptance be checked at one common abstract time.
References #
A decision-only query machine with one binary nondeterministic choice per step.
- init : σ
The initial state.
- query : σ → ℕ
The queried input position.
The next state, given the current state, input answer and nondeterministic choice.
- halted : σ → Bool
Whether the state has halted.
- accept : σ → Bool
Whether a halted state accepts. This field is ignored before halting.
Instances For
The input answer, none past the end of the input.
Instances For
A step selected by one choice; halted states are fixed.
Instances For
The existential one-step relation, including halted self-loops.
Instances For
Replay a finite sequence of choices from a supplied state.
Instances For
Run from the initial state with a finite sequence of choices.
Instances For
Finite paths of the abstract step relation.
Instances For
A state reached by some finite branch.
Instances For
Some finite branch halts and accepts.
Instances For
Every branch of exactly t abstract steps has halted.
Instances For
The same machine started in s. The compiler uses it to start each input in its own state.
Instances For
Every finite relational path is a choice replay of the same length, and conversely.
A common all-branches clock also bounds every longer branch.
Acceptance can be tested at the common clock: short branches are padded by halted self-loops, and longer branches already halted at the clock. The padding is proof-level data only.
A branch longer than the common clock has the same state as its clock-length prefix.
Any total local runtime has a common finite bound on all reachable states of an abstract machine with an all-branches clock. This maximum is proof-level data: it need not be computed by the simulator, encoded in a state, or stored on a tape.
Every branch of t steps from the supplied abstract state has halted.
Instances For
A clock for the initial state is also a clock from every reachable state. The extra history only makes the complete branch longer than the original clock.
The least all-branches halting clock from a state, or zero when no such clock exists. This is a ghost ranking function, not a counter stored by the native simulator.
Instances For
The ghost clock strictly decreases on every branch from a running state. The native machine can therefore be proved terminating without computing or storing any runtime maximum.
Reusing the deterministic input pass #
Fixing the choice gives a deterministic query machine. This does not enumerate choices or store a witness: it supplies either of the two local transition routines.
Instances For
The deterministic input scan fetches exactly the abstract query answer.
The end of a deterministic pass performs the selected nondeterministic abstract step and resets the position counter and fetched answer.
Local computation and space bounds #
Fixing the native choice preserves linear-space computability of the transition routine.
The input-scan callback is the deterministic one and does not depend on the choice.
Either end-of-pass routine is computable in space linear in the encoded pass state.
The pass continuation test is computable in linear space.
The finalizer emits exactly the acceptance bit, with linear-space computation.
The encoded scan state fits in the abstract-state budget plus the binary input counter. This estimate is independent of the number of passes and of all earlier choices.
Every abstract prefix state has the same space bound when the bound holds on reachable states. No choice history is included in the encoded state.