Proof-carrying binary stream routines #
BinaryRoutine is an experimental composition layer for append-only machines
whose complete work state is a vector of canonical rewound binary naturals.
Each routine carries a pure domain, exact value-vector effect, exact emitted
word, and explicit time/all-prefix-space bounds. BinaryRoutine.Sound ties
those fields to one HoareTimeSpace contract and transducer proof on every
canonical state in the domain.
The pure domain is deliberate: predecessor honestly requires a positive value, while copying and gate emission honestly require their reusable scratch value to be zero. Sequential composition conjoins those obligations at the correct intermediate value vector. Loop, branch, and polynomial adapters are outside this initial layer.
Main results #
BinaryRoutine.Sound.seqcomposes proofs acrossseqTM.BinaryRoutine.identity_soundproves the empty-emission identity.BinaryRoutine.emitBits_soundadapts fixed-word emission.BinaryRoutine.binarySucc_soundandbinaryPred_soundadapt arithmetic.BinaryRoutine.binaryCopy_soundadapts framed canonical copying.BinaryRoutine.emitRawGateStep_soundadapts one streaming raw gate.
The canonical tape realizes its advertised natural value.
Every canonical binary natural tape is parked.
Each tape in a canonical work vector realizes its corresponding value.
Every tape in a canonical work vector is parked.
Updating one pure value is exactly a literal update of its canonical tape.
Sound routines compose, with second-phase obligations and bounds evaluated at the first routine's exact value effect.
Strengthening a routine's pure precondition preserves soundness without changing its concrete behavior or resource bounds.
Empty fixed-word emission is a sound routine identity.
Canonical binary successor is a sound value-vector leaf.
Canonical positive binary predecessor is a sound value-vector leaf. Its
routine domain is exactly 0 < values idx.
Framed canonical binary copying is sound when the three indices are distinct; its routine domain records that the private counter value is zero.
One raw-gate stream step is a sound routine leaf. Its pure effect advances
only availableIdx, and its emitted word is exactly RawGate.encode.