Documentation

Complexitylib.Circuits.Shallow.Layer.Defs

Alternating layers for constructing shallow circuits #

Layer n d is construction syntax: a signed input at depth zero, or a list of children at the preceding depth. Evaluation alternates AND and OR, starting with the supplied root operation. Its compiler produces an ordinary CSLib circuit, with exactly the counted AND/OR gates and no extra literal layer. Empty lists supply constants without introducing special constant gates.

This syntax records formulas, so duplicating a subtree duplicates its gates. It supplies upper-bound witnesses in CSLib's shared circuit model.

@[reducible, inline]

Alternating unbounded layers, with signed primary inputs at depth zero.

Equations
Instances For

    The number of AND/OR gates; literal occurrences are free.

    Equations
    Instances For
      def Complexity.Shallow.Layer.mapInputs {n m : ℕ} (ρ : Fin n → Fin m × Bool) {d : ℕ} :
      Layer n d → Layer m d

      Substitute signed inputs. This changes no gates or layers.

      Equations
      Instances For
        def Complexity.Shallow.Layer.neg {n d : ℕ} (f : Layer n d) :
        Layer n d

        De Morgan negation flips the root operation and every input sign.

        Equations
        Instances For