Total clocking of arbitrary typed decision programs #
An executable index clock writes a unary cost budget. The clocked universal
machine simulates the arbitrary source program under that budget, and the
wrapper accepts exactly an in-budget return of encode true. No termination
or well-scopedness assumption is imposed on the source program.
An actual index routine that supplies a unary simulation budget.
- prog : Cost.Prog
- closed : Cost.Prog.WellScoped 1 self.prog
- runs (n : ℕ) : ∃ (time : ℕ), self.prog.Runs (Cost.encode n) (Cost.Data.ofNat (self.budget n)) time
Instances For
A concrete executable clock, useful independently of any index-growth routine.
Equations
- MIPRE.CL.Detyping.ClockProgram.constant k = { budget := fun (x : ℕ) => k, prog := MIPRE.Cost.Prog.const (MIPRE.Cost.Data.ofNat k), closed := trivial, runs := ⋯ }
Instances For
Any polynomial-time unary index routine supplies an executable clock.
Equations
- MIPRE.CL.Detyping.ClockProgram.ofPolyTimeFun f = { budget := fun (n : ℕ) => List.length (f.toFun n), prog := f.code, closed := ⋯, runs := ⋯ }
Instances For
The success tag carries precisely the source result of an in-budget run.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Equations
- C.wrapProg U source = (C.clockStage source).let_ (U.univT.let_ MIPRE.CL.Detyping.ClockProgram.checkResult.code)
Instances For
The exact Boolean returned by the executable clock wrapper on every raw input.
The explicit wrapper cost, including clock generation and universal simulation.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Runtime overhead is explicit once the executable clock's own runtime is bounded.
Acceptance is exactly acceptance of the source within the computed cost budget.
The genuine typed decider obtained by clocking arbitrary source code.
Instances For
Whenever a source run is known to fit, clocking preserves its acceptance predicate.
The wrapper instantiated with the proved clocked self-interpreter.
Equations
- C.decider source = C.wrap MIPRE.Cost.selfClockedUniversal source