The machine-level universal simulation theorems (specification) #
The target interface of the machine-level programme (Milestones E–G of
planning/tm-infrastructure.md), frozen here as sorry-ed theorems so that later work
can be planned and verified against a fixed specification, independently of the open
interpreter-ownership decision (plan document, roadmap gate).
Turing.exists_universalCode— blueprintlem:universal-machine, tracked by issue #17: a machine codeUwithi + 1input tapes simulating[α]_ion the remaining tapes, exactly (produces-iff) and with polynomial time and space overhead in|α| + t.Turing.exists_boundedUniversalCode— blueprintlem:bounded-universal-machine, tracked by issue #18: the budgeted variant, always halting withinP(|α| + T)and outputting the canonically encoded budgeted result. This is the variant the pipeline-style uses (timeout simulation, bounded interpretation) need first.
Both statements are existential (∃ U : Code _, …), mirroring how
MIPRE/Foundations/Cost/Toolkit.lean states its ambient-model counterparts
(blueprint lem:universal-tm): a sorry-ed def universalCode would be poisoned data
— every consumer would inherit sorryAx and nothing could compute with it — so the
concrete definition, with its #eval-able canonical description, only arrives with the
construction in Milestone F. The specification vocabulary is entirely that of
Milestones C and D: total decoding decodeCode, the relational semantics
Code.Produces, and the budgeted evaluator Code.evalWithin.
encodeBoundedResult (the output format of the bounded machine) is the one defined
object here — computable, sorry-free — completing the Milestone F output interface
deferred from Code/Evaluator.lean (decision D12).
The canonical bit encoding of a budgeted result — the output format of the bounded
universal machine: timeout ↦ 0, halted y ↦ 1 · encodeNat |y| · y.
Equations
Instances For
Universal machine (blueprint lem:universal-machine; specification for
Milestones E–G, tracked by issue #17).
There are a machine code U with i + 1 input tapes and a polynomial P such that,
with a description α on the first input tape and source inputs x on the others:
Uproducesyexactly when the decoded machine[α]_iproducesyonx(in particular,Uhalts exactly when[α]_idoes), and- whenever
[α]_ihalts withintsteps,Uhalts withinP(|α| + t)time and space.
Bounded universal machine (blueprint lem:bounded-universal-machine;
specification for Milestones E–G, tracked by issue #18).
There are a machine code U with i + 2 input tapes and a polynomial P such that,
with a description α on the first input tape, a budget T in binary on the second,
and source inputs x on the others, U always halts, within P(|α| + T) steps,
outputting the canonical encoding of the budgeted evaluation of [α]_i on x with
budget T.