Disjunctive Normal Form Theorem
   HOME

TheInfoList



OR:

In
boolean logic In mathematics and mathematical logic, Boolean algebra is a branch of algebra. It differs from elementary algebra in two ways. First, the values of the variable (mathematics), variables are the truth values ''true'' and ''false'', usually denot ...
, a disjunctive normal form (DNF) is a canonical normal form of a logical formula consisting of a disjunction of conjunctions; it can also be described as an OR of ANDs, a sum of products, or in philosophical logic a ''cluster concept''. As a normal form, it is useful in
automated theorem proving Automated theorem proving (also known as ATP or automated deduction) is a subfield of automated reasoning and mathematical logic dealing with proving mathematical theorems by computer programs. Automated reasoning over mathematical proof was a majo ...
.


Definition

A logical formula is considered to be in DNF if it is a
disjunction In logic, disjunction (also known as logical disjunction, logical or, logical addition, or inclusive disjunction) is a logical connective typically notated as \lor and read aloud as "or". For instance, the English language sentence "it is ...
of one or more conjunctions of one or more literals. A DNF formula is in full disjunctive normal form if each of its variables appears exactly once in every conjunction and each conjunction appears at most once (up to the order of variables). As in conjunctive normal form (CNF), the only propositional operators in DNF are and (\wedge), or (\vee), and not (\neg). The ''not'' operator can only be used as part of a literal, which means that it can only precede a propositional variable. The following is a
context-free grammar In formal language theory, a context-free grammar (CFG) is a formal grammar whose production rules can be applied to a nonterminal symbol regardless of its context. In particular, in a context-free grammar, each production rule is of the fo ...
for DNF: : ''DNF'' \, \to \, ''Conjunct'' \, \mid \, ''Conjunct'' \, \lor \, ''DNF'' : ''Conjunct'' \, \to \, ''Literal'' \, \mid\, ''Literal'' \, \land \, ''Conjunct'' : ''Literal'' \, \to \, ''Variable'' \, \mid \, \, \neg \, ''Variable'' Where ''Variable'' is any variable. For example, all of the following formulas are in DNF: *(A \land \neg B \land \neg C) \lor (\neg D \land E \land F \land D \land F) *(A \land B) \lor (C) *(A \land B) *(A) The formula A \lor B is in DNF, but not in full DNF; an equivalent full-DNF version is (A \land B) \lor (A \land \lnot B) \lor (\lnot A \land B). The following formulas are not in DNF: *\neg(A \lor B), since an OR is nested within a NOT *\neg(A \land B) \lor C, since an AND is nested within a NOT *A \lor (B \land (C \lor D)), since an OR is nested within an AND


Conversion to DNF

In
classical logic Classical logic (or standard logic) or Frege–Russell logic is the intensively studied and most widely used class of deductive logic. Classical logic has had much influence on analytic philosophy. Characteristics Each logical system in this c ...
each propositional formula can be converted to DNF ...


... by syntactic means

The conversion involves using
logical equivalence In logic and mathematics, statements p and q are said to be logically equivalent if they have the same truth value in every model. The logical equivalence of p and q is sometimes expressed as p \equiv q, p :: q, \textsfpq, or p \iff q, depending ...
s, such as double negation elimination,
De Morgan's laws In propositional calculus, propositional logic and Boolean algebra, De Morgan's laws, also known as De Morgan's theorem, are a pair of transformation rules that are both Validity (logic), valid rule of inference, rules of inference. They are nam ...
, and the
distributive law In mathematics, the distributive property of binary operations is a generalization of the distributive law, which asserts that the equality x \cdot (y + z) = x \cdot y + x \cdot z is always true in elementary algebra. For example, in elementary ...
. Formulas built from the primitive connectives \ can be converted to DNF by the following canonical term rewriting system: :\begin (\lnot \lnot x) & \rightsquigarrow & x \\ (\lnot (x \lor y)) & \rightsquigarrow & ((\lnot x) \land (\lnot y)) \\ (\lnot (x \land y)) & \rightsquigarrow & ((\lnot x) \lor (\lnot y)) \\ (x \land (y \lor z)) & \rightsquigarrow & ((x \land y) \lor (x \land z)) \\ ((x \lor y) \land z) & \rightsquigarrow & ((x \land z) \lor (y \land z)) \\ \end


... by semantic means

The full DNF of a formula can be read off its
truth table A truth table is a mathematical table used in logic—specifically in connection with Boolean algebra, Boolean functions, and propositional calculus—which sets out the functional values of logical expressions on each of their functional arg ...
. For example, consider the formula :\phi = ((\lnot (p \land q)) \leftrightarrow (\lnot r \uparrow (p \oplus q))). The corresponding
truth table A truth table is a mathematical table used in logic—specifically in connection with Boolean algebra, Boolean functions, and propositional calculus—which sets out the functional values of logical expressions on each of their functional arg ...
is : * The full DNF equivalent of \phi is : ( p \land \lnot q \land r) \lor (\lnot p \land q \land r) \lor (\lnot p \land \lnot q \land r) \lor (\lnot p \land \lnot q \land \lnot r) * The full DNF equivalent of \lnot \phi is : ( p \land q \land r) \lor ( p \land q \land \lnot r) \lor ( p \land \lnot q \land \lnot r) \lor (\lnot p \land q \land \lnot r)


Remark

A propositional formula can be represented by one and only one full DNF. In contrast, several ''plain'' DNFs may be possible. For example, by applying the rule ((a \land b) \lor (\lnot a \land b)) \rightsquigarrow b three times, the full DNF of the above \phi can be simplified to (\lnot p \land \lnot q) \lor (\lnot p \land r) \lor (\lnot q \land r). However, there are also equivalent DNF formulas that cannot be transformed one into another by this rule, see the pictures for an example.


Disjunctive Normal Form Theorem

It is a theorem that all consistent formulas in
propositional logic The propositional calculus is a branch of logic. It is also called propositional logic, statement logic, sentential calculus, sentential logic, or sometimes zeroth-order logic. Sometimes, it is called ''first-order'' propositional logic to contra ...
can be converted to disjunctive normal form. This is called the Disjunctive Normal Form Theorem. The formal statement is as follows:
Disjunctive Normal Form Theorem: Suppose X is a sentence in a propositional language \mathcal with n sentence letters, which we shall denote by A_1,...,A_n. If X is not a contradiction, then it is truth-functionally equivalent to a disjunction of conjunctions of the form \pm A_1 \land ... \land \pm A_n, where +A_i=A_i, and -A_i= \neg A_i.
The proof follows from the procedure given above for generating DNFs from
truth table A truth table is a mathematical table used in logic—specifically in connection with Boolean algebra, Boolean functions, and propositional calculus—which sets out the functional values of logical expressions on each of their functional arg ...
s. Formally, the proof is as follows:
Suppose X is a sentence in a propositional language whose sentence letters are A, B, C, \ldots. For each row of X's truth table, write out a corresponding conjunction \pm A \land \pm B \land \pm C \land \ldots, where \pm A is defined to be A if A takes the value T at that row, and is \neg A if A takes the value F at that row; similarly for \pm B, \pm C, etc. (the
alphabetical order Alphabetical order is a system whereby character strings are placed in order based on the position of the characters in the conventional ordering of an alphabet. It is one of the methods of collation. In mathematics, a lexicographical order is ...
ing of A, B, C, \ldots in the conjunctions is quite arbitrary; any other could be chosen instead). Now form the
disjunction In logic, disjunction (also known as logical disjunction, logical or, logical addition, or inclusive disjunction) is a logical connective typically notated as \lor and read aloud as "or". For instance, the English language sentence "it is ...
of all these conjunctions which correspond to T rows of X's truth table. This disjunction is a sentence in \mathcal , B, C, \ldots; \land, \lor, \neg/math>, which by the reasoning above is truth-functionally equivalent to X. This construction obviously presupposes that X takes the value T on at least one row of its truth table; if X doesn’t, i.e., if X is a contradiction, then X is equivalent to A \land \neg A, which is, of course, also a sentence in \mathcal , B, C, \ldots; \land, \lor, \neg/math>.
This theorem is a convenient way to derive many useful metalogical results in propositional logic, such as, trivially, the result that the set of connectives \ is functionally complete.


Maximum number of conjunctions

Any propositional formula is built from n variables, where n \ge 1. There are 2n possible literals: L = \. L has (2^ -1) non-empty subsets.\left, \mathcal(L)\ = 2^ This is the maximum number of conjunctions a DNF can have. A full DNF can have up to 2^ conjunctions, one for each row of the truth table. Example 1 Consider a formula with two variables p and q. The longest possible DNF has 2^ -1 = 15 conjunctions: : \begin (\lnot p) \lor (p) \lor (\lnot q) \lor (q) \lor \\ (\lnot p \land p) \lor \underline \lor \underline \lor \underline \lor \underline \lor (\lnot q \land q) \lor \\ (\lnot p \land p \land \lnot q) \lor (\lnot p \land p \land q) \lor (\lnot p \land \lnot q \land q) \lor ( p \land \lnot q \land q) \lor \\ (\lnot p \land p \land \lnot q \land q) \end The longest possible full DNF has 4 conjunctions: they are underlined. This formula is a tautology. It can be simplified to (\neg p \lor p) or to (\neg q \lor q), which are also tautologies, as well as valid DNFs. Example 2 Each DNF of the e.g. formula (X_1 \lor Y_1) \land (X_2 \lor Y_2) \land \dots \land (X_n \lor Y_n) has 2^n conjunctions.


Computational complexity

The
Boolean satisfiability problem In logic and computer science, the Boolean satisfiability problem (sometimes called propositional satisfiability problem and abbreviated SATISFIABILITY, SAT or B-SAT) asks whether there exists an Interpretation (logic), interpretation that Satisf ...
on conjunctive normal form formulas is
NP-complete In computational complexity theory, NP-complete problems are the hardest of the problems to which ''solutions'' can be verified ''quickly''. Somewhat more precisely, a problem is NP-complete when: # It is a decision problem, meaning that for any ...
. By the duality principle, so is the falsifiability problem on DNF formulas. Therefore, it is co-NP-hard to decide if a DNF formula is a tautology. Conversely, a DNF formula is satisfiable if, and only if, one of its conjunctions is satisfiable. This can be decided in
polynomial time In theoretical computer science, the time complexity is the computational complexity that describes the amount of computer time it takes to run an algorithm. Time complexity is commonly estimated by counting the number of elementary operations p ...
simply by checking that at least one conjunction does not contain conflicting literals.


Variants

An important variation used in the study of
computational complexity In computer science, the computational complexity or simply complexity of an algorithm is the amount of resources required to run it. Particular focus is given to computation time (generally measured by the number of needed elementary operations ...
is ''k-DNF''. A formula is in ''k-DNF'' if it is in DNF and each conjunction contains at most k literals.


See also

* Algebraic normal form – an XOR of AND clauses * Blake canonical form – DNF including all prime implicants ** Quine–McCluskey algorithm – algorithm for calculating prime implicants * Conjunction/disjunction duality *
Propositional logic The propositional calculus is a branch of logic. It is also called propositional logic, statement logic, sentential calculus, sentential logic, or sometimes zeroth-order logic. Sometimes, it is called ''first-order'' propositional logic to contra ...
*
Truth table A truth table is a mathematical table used in logic—specifically in connection with Boolean algebra, Boolean functions, and propositional calculus—which sets out the functional values of logical expressions on each of their functional arg ...


Notes


References

* * * * * * * * * * {{Normal forms in logic Normal forms (logic) Knowledge compilation