Hoare-style composition rules for TM combinators #
This file provides Hoare-triple composition rules for all four TM combinators. Each rule specifies how pre/postconditions and time bounds compose.
Main results #
seqTM_hoareTime— sequential composition: timeb₁ + 1 + b₂phaseTransition_eq_self_of_reads_ne_start— identify a stable phase boundarycomplementTM_hoareTime— complement flips output cell 1: timeb + p_bound + 4ifTM_hoareTime— if-then-else branching: timeb_test + p_bound + max b_then b_else + 5loopTM_hoareTime— loop invariant with variant: time(k + 1) * b_iter
Tape transition effects #
All combinators apply transitionTape / transitionInput at phase boundaries.
A current read other than ▷ is exactly what their fixed-point rules require;
parked tapes, or AllTapesWF together with positive-head facts, provide common
stronger certificates.
Sequential composition of Hoare triples.
The input, work family, and output transition maps are jointly the identity when every tape is reading something other than the left-end marker. This shared read-local boundary certificate matches the transition shape accepted by both time-only and time-space sequential composition; it deliberately does not require parked heads or global tape well-formedness.
AllTapesWF is preserved through the standard combinator phase transition
(transitionTape / transitionInput).
Complement Hoare triple. If tm satisfies a Hoare triple whose
postcondition provides output WF (for rewind), a head bound, and a
property of output cell 1, then complementTM tm satisfies a triple
where output cell 1 is flipped. Time: b + p_bound + 4.
If-then-else Hoare triple. Composes test, then-branch, and else-branch
Hoare triples. The test postcondition must include AllTapesWF (for rewind)
and a head bound. Branch routing maps the test postcondition to the branch
precondition on transitioned tapes (output gets head = 1, cells preserved).
Time: b_test + p_bound + max b_then b_else + 5
(test + transition + rewind + check + branch + halt).
Loop invariant rule. Each iteration (≤ b_iter steps) either halts with
post or returns to the loop start with inv preserved and variant decreased.
The variant is bounded by k under inv, giving total time (k + 1) * b_iter.