Unfolding fan-in-two circuit outputs into Boolean formulas -- definitions #
These definitions recursively unfold the DAG below one selected circuit wire or output gate. Shared subcircuits are intentionally duplicated in the resulting formula tree; no formula-size claim is implicit in this bridge.
Negate a formula exactly when the Boolean edge flag is set.
Equations
Instances For
def
Complexity.Gate.toBoolFormula
{W : ℕ}
(gate : Gate Basis.andOr2 W)
(wireFormula : Fin W → BoolFormula)
:
Replace the two inputs of a fan-in-two AND/OR gate by formulas, retaining the gate operation and its two edge-negation flags.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[irreducible]
def
Complexity.Circuit.wireFormula
{N M G : ℕ}
[NeZero N]
[NeZero M]
(circuit : Circuit Basis.andOr2 N M G)
(wire : Fin (N + G))
:
Recursively unfold the fan-in-two circuit DAG below wire wire into a
Boolean formula over the primary-input indices.
Equations
- One or more equations did not get rendered due to their size.
Instances For
def
Complexity.Circuit.outputFormula
{N M G : ℕ}
[NeZero N]
[NeZero M]
(circuit : Circuit Basis.andOr2 N M G)
(output : Fin M)
:
Unfold one selected output gate into a Boolean formula.
Equations
- circuit.outputFormula output = (circuit.outputs output).toBoolFormula fun (wire : Fin (N + G)) => circuit.wireFormula wire