Documentation

Complexity.Logics.FirstOrder.Encoding.Layout

The positions of the bits of an encoded structure #

The encoding encStructure (n, tables) of an input is the framed cardinality in unary followed by the framed truth tables (Cslib.Logic.encStructure_eq). This file locates its bits: the markers of the unary cardinality, and for each table its start (Cslib.Logic.tableStart), its markers, its bits and its terminator. Past the last table there is nothing to read. These are the facts an algorithm with random access to the encoding needs, such as the logarithmic-space model checker Cslib.Logic.Vocabulary.modelChecker.

Main definitions #

Main results #

References #

The encoding of an input: its framed cardinality in unary, then its framed tables.

The position of the i-th truth table in the encoding of an input; past the last table, the length of the encoding.

Instances For

    Indexing encStructure a at tableStart a i + q reads position q in the framed tables starting at index i.

    The total length of encStructure a equals tableStart a a.2.length.

    theorem Cslib.Logic.tableStart_succ {a : EncodedStructure} {i : ℕ} (hi : i < a.2.length) :
    tableStart a (i + 1) = tableStart a i + 2 * a.2[i].length + 1

    For i < a.2.length, tableStart a (i + 1) advances past the framed i-th table of length 2 * a.2[i].length + 1.

    tableStart a is monotone in the table index.

    Every table start position is at most (encStructure a).length.

    The framed unary cardinality prefix of length 2 * a.1 + 1 fits within encStructure a.

    The bits #

    The markers of the cardinality.

    The terminator of the cardinality.

    The markers of a table.

    The bits of a table.

    There is a bit at the start of every table.