The universal machine satisfies the generic universality interface -- internals #
The concrete utmTM is connected to TM.IsEfficientlyUniversal through three
exact simulations, each proved in both directions:
- a
k-work-tape machine is simulated by a single-work-tape machine under the identity compiler (singleTapeSim, orpad0whenk = 0); - a single-work-tape machine is simulated step for step by the interpreted
description
descOfTM; - the interpreted description of
αis simulated byutmTMunder the compilerpair α.
Each stage supplies two facts to one generic engine
(simulates_and_simulatesInTime_of_forward): a forward simulation of halting
runs that preserves the exact output, and unbounded simulator runs on every
program where the source diverges. Determinism then reflects halting and
output: a simulator run that halts at time T admits no run longer than T.
The divergence facts are the new content. For the single-tape stage they come
from the macro-step correspondence corr_trace_macroPos, which holds on
non-halting runs; for the universal machine they come from loop_iteration,
which simulates one source step from an arbitrary configuration and takes at
least one step.
Two tapes that agree through the first blank of the second one have the same exact outputs.
Simulation from forward runs and divergence. A compiler and a monotone clock yield an exact semantic simulation and a timed simulation when
- every halting source run is reproduced within the clock by a halting simulator run with the same exact outputs, and
- on every program where the source diverges, the simulator has runs of unbounded length.
Reflection of halting and of outputs is by determinism: a simulator run that
halts at time T admits no longer run, and halted endpoints are unique.
A non-halted trace configuration of a deterministic NTM is reached by
toTM in exactly the trace length.
The single-tape stage's clock: the quadratic overhead of
NTM.singleTapeSimTime at a fixed source budget.
Equations
Instances For
Stage 1. Every k-work-tape machine is simulated exactly by a
single-work-tape machine under the identity compiler, with quadratic
overhead.
Embed a loop configuration into utmTM: phase two of the outer sequence,
phase one of the inner loop/extract sequence.
Equations
- One or more equations did not get rendered due to their size.
Instances For
After initialization, utmTM reaches the loop's start state with the
standing invariant at the interpreted machine's initial configuration.
On a divergent interpreted run, utmTM has runs of every length: each loop
iteration simulates one more source step and takes at least one step.
Stage 3. For a canonical description α, utmTM simulates the
interpreted machine exactly under the compiler pair α, within utmTime.
The composed clock: single-tape overhead followed by universal simulation
of the extracted description α.
Equations
- Complexity.TM.UTMBody.utmClock α k program time = Complexity.TM.UTMBody.utmTime α (Complexity.TM.singleTapeClock k program time) program.length
Instances For
utmTM simulates every machine through a fixed description. For every
k-work-tape machine there is a description α such that utmTM simulates it
exactly under the uniform compiler pair α, within utmClock α k.
The compiler pair α is computable; indeed it is polynomial-time.
pair α adds exactly 2|α| + 2 bits.
The composed clock is polynomial in program length plus source time.
The concrete universal machine is polynomially efficiently universal.