Documentation

Complexitylib.Circuits.Encoding.Formula.Defs

Compile Boolean formulas to raw circuit fragments #

This file defines a proof-free compiler from BoolFormula trees to appendable CircuitCode.RawCircuit fragments. Given available existing wires, the compiler emits one new gate per formula node. Variables are absolute references into the existing prefix, and the last new wire carries the formula value.

Variables are copied through a duplicated AND gate. Constants use an arbitrary existing wire together with its negation, while formula negation uses the raw gate's free edge-negation flags. Binary formulas are emitted in postorder.

Absolute wire carrying the output of a compiled formula fragment.

Equations
Instances For

    Compile a formula after available existing wires.

    The result is a fragment rather than a complete circuit: it may be appended to an existing raw prefix without renumbering its absolute wire references.

    Equations
    Instances For