TM0 Re-rooting and Chain Infrastructure #
This file provides infrastructure for the Partrec → TM0 compilation chain.
Main results #
TM0 Re-rooting #
ParrecToTM0.Rooted— wrapper type with custom defaultParrecToTM0.tm0Reroot— re-root a TM0 to start from an arbitrary stateParrecToTM0.tm0Reroot_eval_dom— re-rooting preserves halting (Dom)
Chain Dom Preservation #
ParrecToTM0.tm2to1_dom_general— TM2 → TM1 preserves Dom for arbitrary initial configsParrecToTM0.tm1to0_dom_general— TM1 → TM0 preserves Dom for arbitrary initial configs
TM0 Re-rooting #
Wrapper type that allows re-rooting to a specified initial state.
- val : Λ
Instances For
Re-root a TM0 machine to start from state q₀ instead of default.
Equations
- ParrecToTM0.tm0Reroot M q₀ { val := q } a = Option.map (fun (x : Λ × Turing.TM0.Stmt Γ) => match x with | (q', s) => ({ val := q' }, s)) (M q a)
Instances For
Evaluation of the re-rooted TM0 starting from q₀ preserves halting.
Chain Dom Preservation for Arbitrary Initial Configs #
TM2 → TM1 preserves Dom for arbitrary initial configs related by TrCfg.
TM1 → TM0 preserves Dom for arbitrary initial configs.
Fintype States #
The TM1 → TM0 translation preserves support (re-exported for convenience).
Re-rooting Support #
If TM0.Supports M S and q₀ ∈ S, then tm0Reroot M q₀ is supported
by the image of S under the Rooted embedding.
Restrict + reroot a TM0: combine re-rooting and restriction into one step.
Given TM0.Supports M S with q₀ ∈ S, produce a TM0 with Fintype states
that halts on l iff the original does when started from q₀.
Equations
- ParrecToTM0.tm0RestrictReroot M S hS q₀ hq₀ = Turing.TM0.restrict (ParrecToTM0.tm0Reroot M q₀) (Finset.map ParrecToTM0.rootedEmbFn S) ⋯
Instances For
Equations
Instances For
The restrict+reroot machine halts iff the original does when started from q₀.