Proof-carrying binary routine control #
This module exposes a canonical zero branch and a reusable count-up-loop
adapter for BinaryRoutine. The loop accepts arbitrary starting counters,
requests body obligations only along the reachable segment, and treats body
times as upper bounds rather than falsely claiming exact runtimes.
Its auxiliary-space bound is width-sensitive: comparison space and every reachable body-plus-successor budget are maximized rather than accumulated. Thus many iterations can retain logarithmic auxiliary space.
Main results #
BinaryRoutine.Sound.branchZeroverifies canonical zero/nonzero dispatch.BinaryRoutine.Sound.binaryForverifies bounded count-up iteration.TM.BinaryForSegmentSpec.reachesIncomposes a bounded reachable segment.TM.BinaryForSegmentSpaceSpec.prefix_withinAuxSpacecovers all prefixes.
A bounded reachable-segment certificate terminates within the standard recursive binary-loop bound.
Phase-local segment bounds cover every reachable prefix of the whole count-up loop.
Canonical binary zero branching preserves routine soundness.
A sound body yields a sound canonical count-up loop when the routine domain supplies the reachable body obligations and controller preservation.