Documentation

CslibFrontier.Computability.Complexity.Problems.CircuitValue.Writer

Writing circuits chunk by chunk in logarithmic space #

A writer (Cslib.Complexity.CircuitValue.WriterSpec) is a read machine on a framed input frame w that counts the length n of w, emitting a fixed word for each bit and another at the end, then emits the chunks chunk n 0, …, chunk n (N n - 1) and a trailer, keeping only the number of the current chunk, and finally emits a word for each bit of w (Cslib.Complexity.CircuitValue.WriterSpec.run_machine). When the number of chunks is polynomially bounded and the chunks and the trailer are computed within work space linear in the binary lengths of n and of the number of the chunk, the writer runs in logarithmic space (Cslib.Complexity.CircuitValue.WriterSpec.computableInLogSpace). This is how encoded instances of circuit value problems built from uniform circuits, such as the tableau of a machine, are written in logarithmic space.

Main definitions #

Main results #

The read address of the writer: the markers true of the framed input while counting, the input bits while copying.

The space budget of a state of the writer: the length of its encoding.

What a writer emits: a word for each bit of the input and a word at the end while it counts the input, then numChunks n chunks and a trailer, then a word for each bit of the input while it copies the input.

  • countUnit : List Bool

    The word emitted for each bit of the input while counting.

  • countEnd : List Bool

    The word emitted at the end of the count.

  • numChunks : ℕ → ℕ

    The number of chunks, for an input of length n.

  • chunk : ℕ → ℕ → List Bool

    Chunk i, for an input of length n.

  • trailer : ℕ → List Bool

    The word emitted after the chunks, for an input of length n.

  • copyBit : Bool → List Bool

    The word emitted for each bit of the input while copying.

The step of the writer. Its state is a phase, the length n of the input and a counter: phase 0 counts the input, phase 1 writes the chunks, phase 2 copies the input, phase 3 halts.

The writer, as a read machine on the framed input.

The word written on the input w.

The number of steps of the writer on an input of length n.

The writer halts with its output.

Logarithmic space #

@[reducible, inline]

The step input of the writer and its budget.

A writer runs in logarithmic space when it has polynomially many chunks and its chunks and trailer are computed within the budget of its states.