Binary-indexed lookup in logarithmic space #
A counter program reads the bit of a word at a binary index: it scans the word to learn its
length, then reads the index bit by bit, stopping as soon as the index provably exceeds the word,
and finally reads the indexed bit. It stores counters of O(log (|w| + |i|)) bits.
Main results #
Turing.MultiTapeTM.computableInLogSpace_natBitLength: the binary length of a number.Turing.MultiTapeTM.computableInLogSpace_bitsGetElem?: the optional bit of a word at a binary index.
Number of binary digits of a natural number, computed in logarithmic space.