The stages of the decoder circuit of the succinct tableau #
The decoder computes, from the bits of a clause number, the bits of the clause of the tableau
formula on bit-field labels (Cslib.Circuits.Boolean.Tableau.clauseAt): for each of its three
literals, the label in labelBits bits, least significant first, then the sign (litBits). It
composes three stages:
- the field stage (
CslibFrontier/Computability/Circuit/Boolean/Tableau/Decoder/Fields.lean): comparison chains, borrows and carries, and the lookup of the fixed prefixx; - a circuit of constant size (
tableCircuit) that computes the shapes of the three literals (CslibFrontier/Computability/Circuit/Boolean/Tableau/Decoder/Shape.lean) from the clause and tag bits, the slot bits and the comparisons (ofBits_keyWire); - the output stage: one copy of a fixed formula of 63 gates (
outTemplate) per output bit, reading the wireswireNat, which selects the bit of the label from the fields chosen by the shape (eval_outTemplate_wireNat).
The stages are assembled, with the correctness and the linear size of the whole circuit, in
CslibFrontier/Computability/Circuit/Boolean/Tableau/Decoder/Assembly.lean.
Main definitions #
Cslib.Circuits.Boolean.Tableau.Decoder.litBits: the bits of a literal.Cslib.Circuits.Boolean.Tableau.Decoder.outTemplate: the formula of an output bit.Cslib.Circuits.Boolean.Tableau.Decoder.tableFn,Cslib.Circuits.Boolean.Tableau.Decoder.tableCircuit: the constant stage.Cslib.Circuits.Boolean.Tableau.Decoder.wireNat,Cslib.Circuits.Boolean.Tableau.Decoder.keyWire: the wires read by the output stage and by the constant stage.Cslib.Circuits.Boolean.Tableau.Decoder.fieldCircuit: the field stage as a circuit.
Main results #
Cslib.Circuits.Boolean.Tableau.Decoder.eval_fieldCircuit: the field stage computes the intended values.Cslib.Circuits.Boolean.Tableau.Decoder.ofBits_keyWire: the constant stage reads the key of the fields of the clause number.Cslib.Circuits.Boolean.Tableau.Decoder.eval_outTemplate_wireNat: each output bit computesoutBit.
References #
The formula of an output bit #
The formula of an output bit: the input 0, or one of nine terms, each the conjunction
of a selector with the exclusive or of two bits.
The formula of an output bit on the values of numbered wires.
The bits of a literal #
The bits of a literal: its label in w bits, least significant first, then its sign.
The constant stage #
The function of the constant stage: bit f of literal r (f < 13 + s) is a tag or slot
bit or a selector of the shape of literal r of the key of the input bits.
The constant stage: a circuit computing tableFn, one disjunctive normal form per output.
Its size depends only on the machine.
The wires of the output stage #
The wire of the constant b, after N inputs.
The wire of bit q of the field of width w at offset off, or of false.
The wire of chain k after q bits, true for q = 0.
The first wire of the term kk of the payload bit q.
The second wire of the term kk of the payload bit q: a borrow or a carry.
The wire read at input j of the formula of output bit o of the output stage. Output
o is bit o % (3 + P) of literal o / (3 + P), where P = s + cb + tb: two tag bits, P
payload bits and the sign. The output r * (13 + s) + f of the constant stage is wire
aWidth + r * (13 + s) + f.
The wire of input i of the constant stage: a clause, tag or slot bit, or the last gate of a
comparison chain.
Wire bounds #
The circuit #
Values of the wires read by the output stage #
The formula of an output bit computes outBit on the values of its wires: the values of
the field stage, and the outputs ts of the constant stage for its literal.
The key read by the constant stage is the key of the fields of the clause number.