Documentation

Complexitylib.Algebraic.MassProduction.Nonuniform.MaskedOr

Combining shared point flags #

Compute valid AND (collision OR occupied) once per point. The two arrays of collision flags and occupancy flags, and the validity array, are supplied as shared subcircuits; their costs are each charged once.

def Algebraic.MassProduction.Nonuniform.MaskedOr.expression {count : ℕ} (index : Fin count) :
DeMorgan.Expression (count + count + count)

Two Boolean operations combine the three flags of one point.

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

    Compile one constant-size expression per point.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      @[simp]

      The exact gate count of combineCircuit.

      theorem Algebraic.MassProduction.Nonuniform.MaskedOr.combineCircuit_eval {count : ℕ} (left right valid : Fin count → Bool) (index : Fin count) :
      (combineCircuit count).eval DeMorgan.interpretation (Fin.append (Fin.append left right) valid) index = (valid index && (left index || right index))

      The combining stage reads the corresponding bits of each shared array.

      Combining costs exactly two gates per point.

      def Algebraic.MassProduction.Nonuniform.MaskedOr.circuit {inputs count : ℕ} (left right valid : Circuit DeMorgan.signature inputs count) :

      Evaluate each shared subcircuit once and combine their pointwise outputs.

      Equations
      Instances For
        @[simp]
        theorem Algebraic.MassProduction.Nonuniform.MaskedOr.circuit_size {inputs count : ℕ} (left right valid : Circuit DeMorgan.signature inputs count) :
        (circuit left right valid).size = left.size + right.size + valid.size + (combineCircuit count).size

        The exact gate count of circuit.

        theorem Algebraic.MassProduction.Nonuniform.MaskedOr.circuit_eval {inputs count : ℕ} (left right valid : Circuit DeMorgan.signature inputs count) (input : Fin inputs → Bool) (index : Fin count) :
        (circuit left right valid).eval DeMorgan.interpretation input index = (valid.eval DeMorgan.interpretation input index && (left.eval DeMorgan.interpretation input index || right.eval DeMorgan.interpretation input index))

        Exact pointwise semantics of the shared composition.

        Each shared subcircuit is charged once, plus two gates per point.