Documentation

MIPRE.Foundations.CL.DetypingClock

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.

Instances For

    A concrete executable clock, useful independently of any index-growth routine.

    Equations
    Instances For

      Any polynomial-time unary index routine supplies an executable clock.

      Equations
      Instances For
        theorem MIPRE.CL.Detyping.ClockProgram.evalWithin_eq_some_iff (c : Cost.Prog) (x r : Cost.Data) (k : ℕ) :
        Cost.evalWithin c x k = some r ↔ ∃ time ≤ k, c.Runs x r time

        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

              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.

                Equations
                Instances For
                  theorem MIPRE.CL.Detyping.ClockProgram.wrap_accepts_iff {T : Type u_1} [Cost.SizedEncoding T] (C : ClockProgram) (U : Cost.ClockedUniversalMachine) (source : Cost.Prog) (n : ℕ) (u : T) (x : Cost.BitStr) (v : T) (y a b : Cost.BitStr) :
                  (C.wrap U source).Accepts n u x v y a b ↔ ∃ time ≤ C.budget n, source.Runs (Cost.encode (n, u, x, v, y, a, b)) (Cost.encode true) time
                  theorem MIPRE.CL.Detyping.ClockProgram.wrap_accepts_iff_of_bounded {T : Type u_1} [Cost.SizedEncoding T] (C : ClockProgram) (U : Cost.ClockedUniversalMachine) (D : TypedDecider T) (n : ℕ) (u : T) (x : Cost.BitStr) (v : T) (y a b : Cost.BitStr) (h : Cost.HaltsWithin D.prog (Cost.encode (n, u, x, v, y, a, b)) (C.budget n)) :
                  (C.wrap U D.prog).Accepts n u x v y a b ↔ D.Accepts n u x v y a b

                  Whenever a source run is known to fit, clocking preserves its acceptance predicate.

                  The wrapper instantiated with the proved clocked self-interpreter.

                  Equations
                  Instances For
                    theorem MIPRE.CL.Detyping.ClockProgram.decider_accepts_iff {T : Type u_1} [Cost.SizedEncoding T] (C : ClockProgram) (source : Cost.Prog) (n : ℕ) (u : T) (x : Cost.BitStr) (v : T) (y a b : Cost.BitStr) :
                    (C.decider source).Accepts n u x v y a b ↔ ∃ time ≤ C.budget n, source.Runs (Cost.encode (n, u, x, v, y, a, b)) (Cost.encode true) time