Documentation

CslibFrontier.Computability.Machines.Turing.MultiTape.Internal.NativeCompiler.BitString

Retained lookup and prefix copying on raw bit words #

Both compilers first convert the raw input into a framed list of Booleans. bitsGetDNatCompiler looks up a binary index and returns the supplied fallback if necessary. takeBits copies a unary-bounded prefix and unframes it. Its certified time and workspace are linear in the input length and requested count, including the full initial scan.

Binary-indexed access to a raw bit word, with an explicit out-of-range fallback. The compiler retains the framing conversion and the complete framed-list scan.

Canonical retained raw-bit prefix compiler. The executed machine first frames every raw bit, uses the direct unary encoded-list prefix machine, then removes the frames.

theorem Turing.MultiTapeTM.Internal.NativeCompiler.time_takeBits_expanded (input : List Bool × ℕ) :
takeBits.time input = 124 * input.1.length + 21 * input.2 + 24 * (List.take input.2 input.1).length + 135

Fully expanded exact clock in the raw-word length, unary count and emitted-prefix length.

theorem Turing.MultiTapeTM.Internal.NativeCompiler.workspace_takeBits_expanded (input : List Bool × ℕ) :
takeBits.workspace input = 60 * input.1.length + 13 * input.2 + 15 * (List.take input.2 input.1).length + 268

Fully expanded exact workspace in the raw-word length, unary count and emitted-prefix length.

A direct linear clock bound in the actual raw-word length and unary count.

A direct linear workspace bound in the actual raw-word length and unary count.