De Morgan formulas #
A De Morgan formula is a formula over the De Morgan signature, Formula Boolean.signature n,
evaluated under Boolean.interpretation. Negations may appear anywhere. Pushing them to the
leaves by De Morgan's laws does not change the leaf size, so lower bounds on the leaf size of these
formulas are at least as strong as for formulas whose negations sit at the leaves
Jukna, Chapter 6.
Main definitions #
Cslib.Circuits.Formula.const,Cslib.Circuits.Formula.not,Cslib.Circuits.Formula.and,Cslib.Circuits.Formula.or: De Morgan formulas built from constants and smaller formulas.Cslib.Circuits.Formula.xor: the exclusive or(F ∧ ¬G) ∨ (¬F ∧ G).Cslib.Circuits.Formula.orList,Cslib.Circuits.Formula.andList: the disjunction and the conjunction of a list of formulas as balanced trees of binary gates (Formula.balanced).Cslib.Circuits.Formula.literal: the literal of bitithat is true atz.Cslib.Circuits.Boolean.formulaDepth: the least depth of a De Morgan formula for a function, with negations and constants free.
Main results #
Cslib.Circuits.Formula.size_orList_add_one,Cslib.Circuits.Formula.depthWith_orList_le,Cslib.Circuits.Formula.size_andList_add_one,Cslib.Circuits.Formula.depthWith_andList_le: a balanced tree ofk ≥ 1formulas addsk - 1nodes and⌈log₂ k⌉levels.Cslib.Circuits.Formula.exists_computes: every Boolean function has a De Morgan formula.Cslib.Circuits.Boolean.exists_computes_depthWith_eq_formulaDepth: some formula attains the formula depth.Cslib.Circuits.Boolean.arity_le_two: the De Morgan basis has fan-in at most two.
References #
The constant De Morgan formula.
Instances For
The negation of a De Morgan formula.
Instances For
The conjunction of two De Morgan formulas.
Instances For
The disjunction of two De Morgan formulas.
Instances For
The exclusive or of two De Morgan formulas, (F ∧ ¬G) ∨ (¬F ∧ G).
Instances For
Evaluating const c returns c.
Evaluating F.not negates the value of F.
Evaluating F.and G takes the conjunction of the values of F and G.
Evaluating F.or G takes the disjunction of the values of F and G.
Evaluating F.xor G takes the exclusive or of the values of F and G.
Negation preserves the leaf size of a formula.
A constant formula has no leaves in Y.
Negation preserves the number of leaves in Y.
The number of leaves in Y of a conjunction is the sum of those of its conjuncts.
The number of leaves in Y of a disjunction is the sum of those of its disjuncts.
A negation adds one operation node.
A negation is one deeper than its argument.
The weighted depth of F.not adds cost .not to the weighted depth of F.
The weighted depth of F.and G adds cost .and to the maximum weighted depth of F and
G.
The weighted depth of F.or G adds cost .or to the maximum weighted depth of F and G.
A conjunction is the binary node of .and.
A disjunction is the binary node of .or.
The disjunction of a list of De Morgan formulas, as a balanced tree (Formula.balanced); the
constant false for no formulas.
Instances For
The conjunction of a list of De Morgan formulas, as a balanced tree (Formula.balanced); the
constant true for no formulas.
Instances For
Evaluating orList l tests whether any formula in l evaluates to true.
Evaluating andList l tests whether every formula in l evaluates to true.
The disjunction of one formula is that formula.
The conjunction of one formula is that formula.
A balanced disjunction is deeper than its disjuncts by ⌈log₂⌉ of their number times the
cost of a disjunction; the disjunction of no formulas is a constant.
A balanced conjunction is deeper than its conjuncts by ⌈log₂⌉ of their number times the
cost of a conjunction; the conjunction of no formulas is a constant.
With negations and constants free, a balanced disjunction is deeper than its disjuncts by
⌈log₂⌉ of their number.
With negations and constants free, a balanced conjunction is deeper than its conjuncts by
⌈log₂⌉ of their number.
The literal of bit i that is true at z.
Instances For
A literal has binary-gate depth zero.
Every Boolean function has a De Morgan formula: its disjunctive normal form.
The least depth of a De Morgan formula computing f, with negations and constants free: the
least depth with costs binaryCost (Formula.minDepthWith), which is finite because every
function has a formula (Formula.exists_computes).
Instances For
The formula depth is the least depth with costs binaryCost.
The formula depth is at most the depth of every formula computing the function.
Some formula attains the formula depth.