The successor in binary #
encNat encodes a natural number by its binary digits, least significant first (Nat.bits).
The successor is a left fold over the digits that keeps a carry and appends one digit per round,
followed by a final carry digit. Its tidy computability is derived from that of the fold
(Turing.MultiTapeTM.ComputableTidilyInTimeAndSpace.foldl) and of the parts of a round.
Main definitions #
Turing.MultiTapeTM.encNat: natural numbers encoded by their binary digits.
Main results #
Turing.MultiTapeTM.computableTidilyInTimeAndSpace_succ: the successor is tidily computable in quadratic time and linear space.
The final carry digit is appended in linear time and space.
The successor is tidily computable in quadratic time and linear space, in the binary encoding
encNat.