Direct binary counter resource certificates #
The original borrow and leading-zero normalization folds compute the predecessor. Its time is
quadratic and its charged workspace linear in the binary input length. The successor's
certificate here is a weakening of the streaming transducer computableInTimeAndSpace_succ; the
carry rounds remain as the shared step of binary addition. The zero test uses the existing
empty-word machine. All round certificates are plain; normalization occurs only when the internal
machine combinators construct the fold.
Main results #
ComputableInO.succStep,ComputableInO.succFinish: shared linear carry-round certificates for binary addition.ComputableInO.natSucc,ComputableInO.natPred: quadratic-time, linear-space binary counters.ComputableInO.natIsZero: linear zero testing.
One consuming carry round has linear time and charged workspace.
Appending the final carry has linear time and charged workspace.
A fold over binary words retains quadratic time and linear charged workspace when its reachable encoded prefix states have length at most the original word length plus a constant.
Binary successor within the quadratic clock and linear charged workspace used by its
clients, weakened from the linear-time, zero-work-space transducer certificate
computableInTimeAndSpace_succ.