Documentation

Complexitylib.Models.TuringMachine.UTM.ClockedUtm

The clocked universal machine #

clockedUtmTM — the 7-tape time-bounded universal machine that the time-hierarchy diagonalizer runs under retargetInput. On input pair α x with the unary clock V preloaded on the clock tape (clkT):

Main results #

both within clockedUtmTime α x V steps from the started tapes clockedUtmPre α x V (the shape delivered by the diagonalizer's retargetInput mid-sequence).

theorem Complexity.TM.HoareTime.with_output_wf {n : } {tm : TM n} {pre post : TapePred n} {b : } (h : tm.HoareTime pre post b) (hpre : ∀ (inp : Tape) (work : Fin nTape) (out : Tape), pre inp work outout.cells 0 = Γ.start ∀ (j : ), 1 jout.cells j Γ.start) :
tm.HoareTime pre (fun (inp : Tape) (work : Fin nTape) (out : Tape) => post inp work out out.cells 0 = Γ.start ∀ (j : ), 1 jout.cells j Γ.start) b

Output-WF strengthening for Hoare triples. If the precondition puts a well-formed output tape at the start (cell 0 = and nowhere else), the postcondition may be strengthened with the same well-formedness of the final output tape — writes are Γw and cell 0 is immutable, so the shape survives any run. This is what lets branch postconditions survive the combinators' final transitionTape (which preserves cells only on -clean tapes).

The clocked universal machine: initialize the six UTM tapes (the lifted initTM, clock tape pinned), park the clock head at the frontier, run the clocked simulate/decrement loop, then test whether the simulation halted: extract its output on verdict Γ.one, write the timeout sentinel Γw.one on verdict Γ.zero.

Equations
  • One or more equations did not get rendered due to their size.
Instances For

    The clocked universal machine's precondition, in started form (the machine runs under retargetInput mid-sequence): input pair α x with the head parked at cell 1, the six UTM tapes blank and parked, the clock tape holding the canonical unary register regTape V, and the output tape blank and parked.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For

      The clocked universal machine's time bound, covering both the halt-within-budget and timeout cases: initialization, the frontier seek, the clocked loop (at most V + 1 iterations), and the final halt-test/extract-or-write branch.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        theorem Complexity.TM.UTMBody.clockedUtmTM_hoareTime_halt (α x : List Bool) (hterm : TerminatedRegion α) (V T : ) (mcF : Cfg 1 (decodeDesc α).toTM.Q) (hTV : T V) (hrun : (decodeDesc α).toTM.reachesIn T ((decodeDesc α).toTM.initCfg x) mcF) (hhalt : (decodeDesc α).toTM.halted mcF) :
        clockedUtmTM.HoareTime (clockedUtmPre α x V) (fun (x : Tape) (x_1 : Fin 7Tape) (out : Tape) => mT, mcF.output.cells (m + 1) = Γ.blank (∀ j < m, mcF.output.cells (j + 1) Γ.blank) jm, out.cells (j + 1) = mcF.output.cells (j + 1)) (clockedUtmTime α x V)

        The clocked universal machine, halting case. On the started tapes clockedUtmPre α x V, if the interpreted machine (decodeDesc α).toTM halts on x at mcF within T ≤ V steps, then clockedUtmTM halts within clockedUtmTime α x V steps with its real output tape agreeing with mcF's output tape through the latter's first blank — i.e. the clocked UTM computes exactly the simulated machine's output.

        theorem Complexity.TM.UTMBody.clockedUtmTM_hoareTime_timeout (α x : List Bool) (hterm : TerminatedRegion α) (V : ) (hV : 1 V) (mcV : Cfg 1 (decodeDesc α).toTM.Q) (hrun : (decodeDesc α).toTM.reachesIn V ((decodeDesc α).toTM.initCfg x) mcV) (hnh : ¬(decodeDesc α).toTM.halted mcV) :
        clockedUtmTM.HoareTime (clockedUtmPre α x V) (fun (x : Tape) (x_1 : Fin 7Tape) (out : Tape) => out.cells 1 = Γ.one) (clockedUtmTime α x V)

        The clocked universal machine, timeout case. On the started tapes clockedUtmPre α x V, if the interpreted machine (decodeDesc α).toTM is still running after V ≥ 1 steps on x, then clockedUtmTM halts within clockedUtmTime α x V steps with the timeout sentinel Γ.one at output cell 1.