Boolean arithmetic in the De Morgan basis #
Boolean-ring addition is XOR and multiplication is AND. This module gives a
concrete translation from arithmetic circuits over Bool to the manuscript's
De Morgan basis. XOR is implemented by
(left OR right) AND NOT (left AND right),
so it costs four standard gates; AND costs one; Boolean constants are free in
the weighted model. Composing this translation with the reusable arithmetic
expression compiler yields verified De Morgan circuits for Boolean
polynomials, together with an exact 4 * additions + multiplications cost.
The number of De Morgan gates simulating each Boolean arithmetic operation.
Equations
Instances For
The De Morgan circuit simulating each Boolean arithmetic operation: exclusive or for addition, conjunction for multiplication, and a constant gate.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The simulation of each Boolean arithmetic operation uses
arithmeticGateCount gates.
Translate Boolean-ring arithmetic to the De Morgan basis.
Equations
Instances For
The concrete operation circuits have the intended Boolean-ring semantics.
The pulled-back manuscript cost is exactly four per XOR and one per AND.
XOR a finite family of Boolean-ring expressions. The empty sum is the constant false expression.
Equations
- One or more equations did not get rendered due to their size.
- Algebraic.DeMorgan.ArithmeticExpression.finSum 0 x_2 = Algebraic.Arithmetic.Expression.constant false
Instances For
Evaluation of the expression-level finite sum is Boolean-ring summation.
Exact weighted expression cost of a finite XOR fold.
Compile a Boolean-ring expression into the De Morgan basis.
Equations
- Algebraic.DeMorgan.ArithmeticExpression.circuit expression = Algebraic.DeMorgan.arithmeticTranslation.compile expression.circuit
Instances For
The exact gate count of circuit.
Compiled Boolean expressions have exactly their Boolean-ring semantics.
Exact standard De Morgan cost of a compiled Boolean expression.