Linear-time canonical binary subtraction -- composed semantics #
This file composes the exact forward borrow scan with its backward canonicalization pass, then restores both preserved operands through the checked rewind tail. The complete machine computes natural-number monus, preserves the external tape frame literally, and carries explicit time and all-prefix auxiliary-space bounds.
Postcondition at the end of the core binary ripple-subtraction phase.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The direct core executes its forward and backward passes in exactly twice the larger operand width plus the two turn/bounce transitions.
Hoare-time form of the exact direct-core execution.
The complete direct subtraction machine restores both operands and returns canonical natural-number monus within the advertised width-linear bound.
Time-and-space contract for complete direct subtraction. The generic all-prefix envelope charges at most one additional cell per possible step.