Step machines of tidily computable functions #
A step machine (Turing.StepMachine) whose initial state, halting test and step are tidily
computable is tidily computable. Each step costs the time of the step function and of a few
operations linear in the size of the state, but nothing for the input: the realizing machine keeps
its input head where the step machine has it. The space is that of the step function plus the size
of the states.
Main definitions #
Turing.MultiTapeTM.encMove: the encoding of moves of the input head.Turing.MultiTapeTM.encPeek: the encoding of a state behind the symbol under the input head.Turing.StepMachine.Tidy: step machines with tidily computable halting test and step.
Main results #
Turing.MultiTapeTM.ComputableTidilyInTimeAndSpace.stepMachine: step machines of tidily computable functions are tidily computable, with no cost for the input head.Turing.StepMachine.Tidy.computableTidilyInTimeAndSpace: the same for tidy step machines, with the bounds of the steps along the run.
A flag as a word #
A flag as a word: [true] if set, blank otherwise.
Instances For
Tidy machines on selected tapes #
A tidy machine writing its output to tape V.
A tidy machine run on the word on tape V, emitting its output.
A tidy machine run on the word on tape V, writing its output to tape O.
The parts of a round #
The theorem #
Step machines of tidily computable functions are tidily computable. Let the step machine
⟨init x, halt, step⟩ halt on the input encIn x after rounds x steps with the output
encOut (g x). If init, halt and step are tidily computable, then so is g, in time
O(TI x + (rounds x + 1) * (tMax x + lMax x + 1) + n) and space O(SI x + sMax x + lMax x + 1),
where tMax, sMax bound the time and space of halt and step along the run and lMax the
size of the states. The input head is never rewound between steps.
Tidy step machines: the halting test and the step of m are tidily computable within
T and S of the state.
- computable_halt : MultiTapeTM.ComputableTidilyInO m.halt encS MultiTapeTM.encBool T S
- computable_step : MultiTapeTM.ComputableTidilyInO (fun (p : σ × Option Bool) => m.step p.1 p.2) (MultiTapeTM.encPair encS (MultiTapeTM.encOption MultiTapeTM.encBool)) (MultiTapeTM.encPair encS (MultiTapeTM.encPair MultiTapeTM.encMove MultiTapeTM.encBits)) (fun (p : σ × Option Bool) => T p.1) fun (p : σ × Option Bool) => S p.1
Instances For
The step machine m started in the state s.
Instances For
Tidy step machines compute tidily. If the tidy step machine m, started in the state
init x computed within TI x and SI x, halts on encIn x after rounds x steps with the
output encOut (g x), and its steps along the run take time tMax x and space sMax x, then g
is tidily computable in time O(TI x + (rounds x + 1) * (tMax x + sMax x + SI x + 1) + n) and
space O(SI x + sMax x): the initial state bounds the states along the run, besides the steps.
Tidy step machines compute tidily, from their initial state: as
Turing.StepMachine.Tidy.computableTidilyInTimeAndSpace_of_init, in time
O((rounds x + 1) * (tMax x + sMax x + 1) + n) and space O(sMax x).