Unfolding fan-in-two circuit outputs into Boolean formulas #
This module recursively unfolds a selected wire or output of a typed fan-in-two
AND/OR circuit into a BoolFormula. The translation preserves evaluation
exactly. Since edge negations are explicit formula nodes, formula depth is at
most twice the corresponding circuit depth.
Circuit gates form a DAG, while formulas are trees. Consequently this unfolding duplicates shared subcircuits, and these theorems deliberately make no formula size claim.
Main results #
Complexity.Circuit.eval_wireFormula— exact semantics for an unfolded wire.Complexity.Circuit.eval_outputFormula— exact semantics for a selected output.Complexity.Circuit.vars_outputFormula_lt— every unfolded variable is below the circuit's input arity.Complexity.Circuit.depth_wireFormula_le— wire-formula depth is at most twice wire depth.Complexity.Circuit.depth_outputFormula_le_outputDepth— output-formula depth is at most twice the selected output depth.
Replacing a fan-in-two gate's source wires by formulas preserves its evaluation.
Unfolding an internal circuit wire into a formula preserves its value.
Unfolding one selected circuit output into a formula preserves that output's value exactly.
Every variable in an unfolded wire formula is a primary-input index.
Every variable in an unfolded output formula lies below the circuit's declared input arity.
The unfolded formula below a wire has depth at most twice the wire's DAG depth. The factor two accounts for an edge negation followed by its gate.
The formula for a selected output has depth at most twice that output's circuit depth. No formula-size bound is asserted because DAG sharing is duplicated by unfolding.