Deterministic decomposable circuits #
A deterministic decomposable circuit (d-D) is a Boolean circuit with constants, inputs, and
AND, OR and NOT gates in which every AND is decomposable, its arguments reading disjoint sets of
inputs, and every OR is deterministic, at most one of its arguments being true on any input
Monet and Olteanu, Definition 3. NOT gates may occur anywhere, not only at the
inputs as in a d-DNNF. Both conditions are pairwise over the arguments of a gate. Decomposability is
a syntactic condition on the inputs that can reach each argument
(Cslib.Circuits.Program.IsDecomposableAt); determinism is a semantic condition on the values.
Here the circuits are those of the De Morgan basis (Cslib.Circuits.Boolean.signature), with binary
AND and OR and also Boolean constants, and size counts gates (Cslib.Circuits.Circuit.size). An
unbounded fan-in AND or OR with k arguments is a binary tree of k - 1 gates of the same kind,
which is decomposable or deterministic when the original gate is, so a d-D with unbounded fan-in and
s wires gives a binary one with at most s AND and OR gates, besides its NOT gates and constants.
Positions, not predecessors. Definition 3 compares the distinct predecessor gates of an AND or
OR. Here the conditions compare argument positions, and two positions of a gate can read the same
earlier line. Such a gate can fail the conditions even with one distinct predecessor: x ∨ x is not
deterministic at x = true, and x ∧ x is not decomposable, both arguments reading {x}. So the
definitions agree with Definition 3 for circuits whose ANDs and ORs have distinct predecessors,
which removing repeated arguments achieves (x ∧ x and x ∨ x are x). The positional form is the
one the arithmetic simulation of #8623 uses, where an AND becomes a product of its arguments.
The conditions are stated gate by gate on the lines of the program (Cslib.Circuits.Program.lines),
so they are decidable, and they split along the last gate
(Cslib.Circuits.Program.isDecomposableAt_gate_iff,
Cslib.Circuits.Program.isDeterministic_gate_iff).
Embedding d-DNNFs (NNF.toCircuit). Sorting the nodes of an NNF (Fin n) N by rank compiles
it into a De Morgan circuit Circuit Boolean.signature n 1 with at most C.size gates (zero gates
for positive literals and one gate for each other node), preserving evaluation
(NNF.eval_toCircuit), decomposability (NNF.isDecomposableAt_toCircuit) and determinism
(NNF.isDeterministic_toCircuit). In particular, every d-DNNF is a d-D
(NNF.isDeterministicDecomposable_toCircuit). The converse fails:
Circuit.IsDeterministicDecomposable allows internal NOT gates (so negating any d-D costs one
gate), whereas NNF pushes negations to leaves, a gap witnessed per-graph for balanced-cut cubic
3-edge-coloured expanders in CslibFrontier/Computability/Circuit/NNF/Negation/Separation.lean
(CubicEdgeColoring.ddnnf_negation_separation, conditional exponential family step
NNF.exponential_separation_of_expanders, open unconditionally under #4668).
Main definitions #
Cslib.Circuits.Program.IsDeterministic: every OR of a De Morgan program is deterministic.Cslib.Circuits.Circuit.IsDeterministicDecomposable: a d-D, a De Morgan circuit whose ANDs are decomposable (Cslib.Circuits.Program.IsDecomposableAt) and whose ORs are deterministic.Cslib.Circuits.NNF.toCircuit: compilation of an NNF DAG into a De Morgan circuit.
Main results #
Cslib.Circuits.Program.isDeterministic_gate_iff: determinism of a program with one more gate.Cslib.Circuits.NNF.eval_toCircuit,Cslib.Circuits.NNF.size_toCircuit_le: evaluation and size of the compiled NNF circuit.Cslib.Circuits.NNF.isDeterministicDecomposable_toCircuit: every d-DNNF compiles to a d-D.
References #
Every OR of a De Morgan program is deterministic: no input makes two distinct arguments of it true Monet and Olteanu, Definition 3.
Instances For
The empty program is deterministic.
A program with one more gate is deterministic when the earlier gates are and, if the new gate is an OR, no input makes two distinct arguments of it true.
A deterministic decomposable circuit (d-D): a De Morgan circuit whose ANDs are decomposable and whose ORs are deterministic, with NOT gates anywhere Monet and Olteanu, Definition 3.
Every AND is decomposable: its arguments are reached by disjoint sets of inputs.
- deterministic : c.program.IsDeterministic
Every OR is deterministic.
Instances For
Compiling NNF circuits into De Morgan circuits #
Compiling a decomposable NNF produces a De Morgan program decomposable at AND gates.
Compiling a deterministic NNF produces a deterministic De Morgan program.
Every d-DNNF compiles to a deterministic decomposable circuit (d-D) of at most the same
size. The converse fails because Circuit.IsDeterministicDecomposable permits internal NOT gates,
whereas NNF restricts negations to leaves
(see CslibFrontier/Computability/Circuit/NNF/Negation/Separation.lean).