Documentation

Complexitylib.Classes.PCP.Internal.BinToUnary

Counting out the value of a bit string #

A verifier turns its coins into an index — into a list of edges, say — and an index has to be counted out in unary before a polynomial-time loop can use it. This module does that: it reads a bit string as a little-endian binary number and writes that many marks.

The conversion is only polynomial time when the value is, which is why the result is clamped: the fold's state is truncated to a width the caller supplies. On strings short enough for the clamp — logarithmically many coins, say — the answer is exact.

Main definitions #

Main results #

Reading a one: the value doubles and gains one.

Equations
Instances For

    The value of a bit string, in unary, computed on pair anything bits.

    Equations
    Instances For

      The fold really counts out the value, as long as the clamp is wide enough.

      The conversion is exact when the clamp is wide enough for the value.