pub fn normalized(expression: &Expression, dnf: bool) -> boolExpand description
Check whether a given expression is in a normal form.
CNF (Conjunctive Normal Form): (A OR B) AND (C OR D)
- Conjunction (AND) of disjunctions (OR)
- An OR cannot have an AND as a descendant
DNF (Disjunctive Normal Form): (A AND B) OR (C AND D)
- Disjunction (OR) of conjunctions (AND)
- An AND cannot have an OR as a descendant
§Arguments
expression- The expression to checkdnf- Whether to check for DNF (true) or CNF (false)
§Returns
True if the expression is in the requested normal form.