Circuits adding dictionary terms #
Nullary gates produce members of a prescribed dictionary, interpreted in any additive carrier. The standard dictionary cost charges those terms and makes binary addition and wiring free. Separate addition costs and arbitrary uniform weights are also provided.
Main definitions #
Cslib.Circuits.SumOfTerms.signature: additions and nullary dictionary terms.Cslib.Circuits.SumOfTerms.interpretation: interpret the dictionary in an additive carrier.Cslib.Circuits.SumOfTerms.dictionaryCost,Cslib.Circuits.SumOfTerms.termCost: term weights.Cslib.Circuits.SumOfTerms.addCost,Cslib.Circuits.SumOfTerms.weightedCost: addition counts and separate uniform weights for additions and terms.
Main results #
Cslib.Circuits.SumOfTerms.cost_weightedCost: separate the two gate counts.
References #
- Adapted from Basis/SumOfTerms.lean in S. Schlesinger, Algebraic circuit formalizations in Complexitylib.
def Cslib.Circuits.SumOfTerms.instDecidableEqOp.decEq {T✝ : Type u_1} [DecidableEq T✝] (x✝ x✝¹ : Op T✝) :
Instances For
@[instance_reducible]
instance Cslib.Circuits.SumOfTerms.instDecidableEqOp {T✝ : Type u_1} [DecidableEq T✝] :
DecidableEq (Op T✝)
@[reducible, inline]
Addition reads two wires; dictionary terms read none.
Instances For
@[reducible, inline]
The signature for sums of dictionary terms.
Instances For
def Cslib.Circuits.SumOfTerms.interpretation {T : Type u_1} {V : Type u_2} [Add V] (value : T → V) :
Interpretation (signature T) V
Interpret dictionary terms by their values and addition by carrier addition.
Instances For
@[simp]
theorem Cslib.Circuits.SumOfTerms.interpretation_add {T : Type u_1} {V : Type u_2} [Add V] (value : T → V) (args : Fin 2 → V) :
@[simp]
theorem Cslib.Circuits.SumOfTerms.interpretation_term {T : Type u_1} {V : Type u_2} [Add V] (value : T → V) (t : T) (args : Fin 0 → V) :
@[simp]
@[simp]
@[reducible, inline]
Count dictionary gates, with free addition.
Instances For
Count additions; dictionary gates are free.