Frame rules for composite machines #
Two things a machine built out of sub-machines needs to know: that a
sub-machine's Hoare triple still holds once its tapes are embedded in a larger
tape space (TM.placeWorkTM_hoareTime_frame), and that a run of bounded length
cannot have touched cells far from where its heads started
(TM.reachesIn_work_cells_far). The second is what lets a bounded wipe reset
an opaque machine's scratch completely.
Main results #
TM.placeWorkTM_hoareTime_frame— a Hoare triple survives tape embeddingTM.reachesIn_work_cells_far— at-step run leaves cells beyondhead + taloneTM.reachesIn_startInvariant— runs preserveTape.StartInvariantTM.seqTM_det— sequential composition is deterministic on its componentsTM.IdlesInput— machines that never move their input head
The parked blank tape every scratch tape starts and ends at.
Instances For
Embedding a Hoare triple in a larger tape space #
A composite machine runs sub-machines that each own a fixed number of work
tapes, while carrying persistent state (running values, fuel registers) on tapes
those sub-machines never touch. TM.placeWorkTM already gives the exact
frame-preserving simulation
(placeWorkTM_reachesIn_placeWorkCfg_of_startInvariant); the lemma below turns
that into a Hoare-triple-level tool, so each embedding is a single lemma
application instead of a fresh reachesIn argument.
Placing a Hoare triple. If tm : TM n satisfies a Hoare triple, then
placeWorkTM pre post tm satisfies the triple obtained by reindexing tm's
work-tape predicate through the middle block, with an arbitrary Parked-style
frame (extras) held exactly fixed outside it.
What a bounded run can have disturbed #
Resetting an opaque machine's scratch tapes between calls needs
to know how far out the machine could possibly have written. Since each head
moves by at most one cell per step and a machine only ever writes under its
heads, a t-step run leaves every cell beyond head + t exactly as it found
it. That is what makes the bounded wipe of TM.resetTapesTM complete rather
than merely partial.
The standing left-marker invariant survives an entire run, on every tape.
A fully parked tape frame passes through a combinator seam unchanged —
the boundary obligation of TM.seqTM_hoareTime in the common case where every
tape is parked on both sides of the seam.
Chaining two fully-determined phases. When each phase pins down the entire tape family and every intermediate tape is parked, sequential composition needs no boundary reasoning at all.
A machine that never moves its real input head off a parked position: its
transition function always returns idleDir for the input tape. Machines that
read their input from a work tape instead (TM.retargetInput and everything
built on it) satisfy this.
Equations
- tm.IdlesInput = ∀ (q : tm.Q) (iHead : Complexity.Γ) (wHeads : Fin n → Complexity.Γ) (oHead : Complexity.Γ), (tm.δ q iHead wHeads oHead).2.2.2.1 = Complexity.TM.idleDir iHead
Instances For
The blank tape satisfies the left-marker invariant.
A tape initialized with a Boolean string satisfies the left-marker
invariant: Γ.ofBool never produces ▷.