Documentation

CslibFrontier.Computability.Circuit.Boolean.NonconstantCost

Boolean gate cost with free constants #

nonconstantCost charges NOT, AND and OR gates, while constants are free. This is the cost convention used by the mass-production source; ordinary Circuit.size also charges constants. The source's free identity gates are represented by native wiring.

Main definitions #

Main results #

References #

Charge NOT, AND and OR once, and constants zero times. Designated outputs and wiring are already free in the underlying circuit model.

@[simp]

Constant gates have nonconstantCost equal to 0.

@[simp]

Disjunction gates have nonconstantCost equal to 1.

Every De Morgan operation has nonconstantCost at most 1.

Ignoring constant gates cannot increase the gate count.