Documentation

CslibFrontier.Computability.Machines.Turing.MultiTape.Complexity.LogSpace.BitsGetElem

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 #

Number of binary digits of a natural number, computed in logarithmic space.

Looking up an optional bit of w at a binary index i is computable in logarithmic space.