Documentation

MIPRE.Foundations.SAT.Circuit

Boolean circuits as data #

The circuits of the succinct Cook–Levin theorem (planning/succinct-cook-levin.md, S0; answer_reduction.tex sec:ar-tms): a circuit is a list of gates in topological order, each gate reading input bits or the values of earlier gates, the last gate being the output. Fan-in is at most two by the shape of the gates; fan-out at most two and a terminal output gate are the well-formedness conditions (Circuit.WellFormed) that the arithmetization of the Tseitin formula needs for its individual-degree bound (prop:tseitin-arith-degree). The gate count is the paper's size parameter s. Circuits are first-order data with a SizedEncoding, so that a program of the ambient model can output one (MIPRE.SAT.SuccinctCookLevin.describe).

inductive MIPRE.SAT.Gate :

A gate: an input bit, a constant, or a binary/unary gate on the values of earlier gates, named by their positions in the gate list.

Instances For
    def MIPRE.SAT.instDecidableEqGate.decEq (x✝ x✝¹ : Gate) :
    Decidable (x✝ = x✝¹)
    Equations
    Instances For
      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        @[instance_reducible]
        Equations

        The gates a gate reads, with multiplicity.

        Equations
        Instances For
          def MIPRE.SAT.Gate.eval (x : ℕ → Bool) (vals : List Bool) :

          The value of a gate given the input bits x and the values vals of the earlier gates (a missing reference reads false).

          Equations
          Instances For

            Decoding gates.

            Equations
            Instances For

              A Boolean circuit: inputs input bits and a list of gates in topological order, the last gate being the output.

              • inputs : ℕ

                The number of input bits.

              • gates : List Gate

                The gates, in an order in which every gate reads only earlier ones.

              Instances For
                def MIPRE.SAT.instDecidableEqCircuit.decEq (x✝ x✝¹ : Circuit) :
                Decidable (x✝ = x✝¹)
                Equations
                Instances For
                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    @[irreducible]

                    The value of gate g of C on the input bits x: the gate evaluated on the values of the earlier gates (a gate beyond the list reads as the constant false).

                    Equations
                    Instances For

                      The output of C on the input bits x: the value of the last gate (false for the empty circuit).

                      Equations
                      Instances For
                        theorem MIPRE.SAT.Circuit.valueAt_eq (C : Circuit) (x : ℕ → Bool) (g : ℕ) :
                        C.valueAt x g = Gate.eval x (List.ofFn fun (k : Fin g) => C.valueAt x ↑k) (C.gates.getD g (Gate.const false))

                        The output of C on a bit string (missing bits read false).

                        Equations
                        Instances For

                          The number of gates: the paper's size parameter.

                          Equations
                          Instances For

                            The number of wires leaving gate u.

                            Equations
                            Instances For

                              Well-formedness (sec:ar-tms): every gate reads earlier gates and existing inputs, fan-out is at most two, the output gate is read by no gate, and there is an output gate.

                              Instances For
                                @[instance_reducible]

                                Circuits as data: the pair of the input count and the gate list.

                                Equations
                                • One or more equations did not get rendered due to their size.

                                The m-bit binary encoding of i (least significant bit first; rem:plugging-in-integers).

                                Equations
                                Instances For
                                  @[simp]