Framed native routines for nondeterministic query machines #
The abstract state is framed on a work tape. The initializer writes the start state of the input, which may depend on the input. Each deterministic pass reads the input in place, performs one selected transition, and writes the continuation flag. Only the finalizer emits.
Main definitions #
Turing.NondeterministicQueryMachine.Routines: finite native routines and their specifications.
Main results #
Turing.NondeterministicQueryMachine.exists_routines: constructs the routines from local linear-space computability and a start state computable in spaceO(S), with one space bound for all reachable boundary states.
Concrete finite routines, sharing tape origins and a common linear space budget. On the input
enc a the abstract run starts in start a; the passes and the finalizer do not depend on a.
- k : ℕ
The shared number of work tapes.
- SI : Type
Finite control of the initialization routine.
Finite control of each binary-choice pass routine.
- SF : Type
Finite control of the final verdict routine.
- I : MultiTapeTM self.k Bool self.SI
The initialization machine.
- P (b : Bool) : MultiTapeTM self.k Bool (self.SP b)
The pass machine selected by one nondeterministic bit.
- F : MultiTapeTM self.k Bool self.SF
The machine emitting the final verdict.
The tape holding the continuation flag.
The encoded abstract state and flag at the common tape origins.
- c : ℕ
A common coefficient for the routines' space windows.
- pass_spec (a : α) (s : σ) : (M.withInit (start a)).Reachable (enc a) s → ∀ (choice flag : Bool), ∃ (t : ℕ), (self.P choice).TransformsTapes (fun (inp : List Bool) (ws : Fin self.k → List Bool) => inp = enc a ∧ ws = self.boundary s flag) (fun (x : List Bool) (x_1 ws' : Fin self.k → List Bool) (e : List Bool) => ws' = self.boundary (M.step (enc a) s choice) !M.halted (M.step (enc a) s choice) ∧ e = []) t (self.c * S a)
- final_spec (a : α) (s : σ) : (M.withInit (start a)).Reachable (enc a) s → ∀ (flag : Bool), ∃ (t : ℕ), self.F.TransformsTapes (fun (inp : List Bool) (ws : Fin self.k → List Bool) => inp = enc a ∧ ws = self.boundary s flag) (fun (x : List Bool) (x_1 x_2 : Fin self.k → List Bool) (e : List Bool) => e = [M.accept s]) t (self.c * S a)
Instances For
Compile local query-machine callbacks and a start state computable in space O(S) into
concrete finite native routines.