Canonical binary addition #
This module exposes binary addition assembled from the canonical count-up loop and binary successor. Three pairwise-distinct work tapes hold a preserved source, an updated destination, and scratch counter. The scratch tape starts at canonical zero and is restored literally after the addition.
The endpoint is a full frame equality: only the destination tape changes,
from dstValue to dstValue + srcValue. The all-prefix space theorem is
width-based rather than derived from total loop runtime.
Main results #
binaryAddLoopTM_reachesIn_framegives the exact loop runtime and endpoint.binaryAddIntoTM_hoareTime_framerestores scratch zero with a full frame.binaryAddIntoTM_hoareTimeSpace_frameadds an all-prefix space bound.binaryAddIntoTM_isTransducerproves append-only-output safety.
The addition loop has an exact runtime and literal endpoint. It preserves
the source and external frame, increments the destination by srcValue, and
leaves the scratch counter equal to srcValue.
Addition changes only the destination tape, from dstValue to
dstValue + srcValue. In particular, source, scratch zero, input, output,
and every unrelated work tape are restored literally.
Time-and-space form of binaryAddIntoTM_hoareTime_frame. Every reachable
configuration stays within binaryAddSpace; the bound depends on the source
and final-destination binary widths, not on the total iteration count.
Binary addition never moves its output head left.