Direct work-symbol branch combinator #
TM.branchWorkBlankTM idx onBlank onNonblank reads one work-tape symbol and
runs onBlank exactly on blank, or onNonblank on any other symbol. The
dispatcher performs one framed, tape-preserving step. It never writes a test
result to the output tape, and branch simulation adds no trailing seam step.
The preservation results require every head to be off the left marker. This
is the necessary boundary condition imposed by the one-sided tape model:
heads reading ▷ must move right.
Main results #
TM.branchWorkBlankTM_reachesIn_blank_frameand its nonblank counterpart give exact selected-branch execution and literal tape frames.TM.branchWorkBlankTM_hoareTimecomposes two branch contracts with one dispatch step.TM.branchWorkBlankTM_hoareTimeSpacepreserves the maximum branch budget.Tape.HasBinaryNat.read_eq_blank_iffspecializes blank dispatch to canonical binary zero.TM.IsTransducer.branchWorkBlankTMpreserves one-way output behavior.
A canonical little-endian natural reads blank exactly when its value is
zero. Consequently the direct blank/nonblank work branch is a canonical
zero/nonzero branch on HasBinaryNat tapes.
Blank dispatch takes one step, selects the blank branch, and preserves all tapes exactly.
Nonblank dispatch takes one step, selects the nonblank branch, and preserves all tapes exactly.
Exact framed execution through the blank branch. The combined controller
uses one dispatch transition followed by the branch's exact t transitions.
Exact framed execution through the nonblank branch.
Compose two time-bounded branch contracts. The precondition supplies the off-marker frame and translates the initial read into the selected branch's precondition. The postcondition records which branch contract completed.
Compose two time-and-space branch contracts. Dispatch preserves the starting tapes, so the all-reachable space bound is exactly the maximum of the two branch budgets rather than an additional seam allowance.
Direct work branching preserves one-way output when both selected branches do. The dispatch step itself never moves the output head left.