Step machines with plain resource certificates #
The halting test, step and initial state have charged plain resource certificates. Their realizing machines are normalized only within this internal compiler proof. The input head stays where the step machine has it between rounds, so each round pays for its callbacks and state, not a new traversal of the whole input.
Whole-run conclusions use independent, uncharged ComputableInBigO bounds. An emitter may write
an unbounded output with constant workspace; no bound on the whole output is added.
Main definitions #
Turing.MultiTapeTM.encMove,.encPeek: the unchanged encodings used by the compiler.Turing.StepMachine.ResourceCertificate: charged plain certificates for halt and step.
Main results #
Turing.StepMachine.ResourceCertificate.computableInBigO_of_init: compile a computed initial state, retaining the original time/workspace formulas and halting/output hypotheses.Turing.StepMachine.ResourceCertificate.computableInBigO: the fixed-initial-state case.
A flag as a word #
A flag as a word: [true] if set, blank otherwise.
Instances For
The parts of a round #
The theorem #
Plain certificates for the halting test and step. Each callback charges its encoded result
to S; the whole-run output is not charged to workspace.
- computable_halt : MultiTapeTM.ComputableInO m.halt encS MultiTapeTM.encBool T S
- computable_step : MultiTapeTM.ComputableInO (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
Compile a resource-certified step machine. If 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 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.
Compile a resource-certified step machine, from its initial state: as
Turing.StepMachine.ResourceCertificate.computableInBigO_of_init, in time
O((rounds x + 1) * (tMax x + sMax x + 1) + n) and space O(sMax x).