Disjunctive normal form#Disjunctive Normal Form Theorem

{{Short description|Standard form of a boolean function}}

In boolean logic, 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 {{mdash}} in philosophical logic {{mdash}} a cluster concept.{{sfn|Post|1921}} As a normal form, it is useful in automated theorem proving.

Definition

A logical formula is considered to be in DNF if it is a disjunction of one or more conjunctions of one or more literals.{{sfn|Davey|Priestley|1990|page=153}}{{sfn|Gries|Schneider|1993|page=67}}{{sfn|Whitesitt|2012|pages=33-37}} 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 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 ANDHowever, this one is in negation normal form.

Conversion to DNF

In classical logic each propositional formula can be converted to DNF{{sfn|Davey|Priestley|1990|page=152-153}} ...

File:Karnaugh map KV 4mal4 18.svg of the disjunctive normal form {{color|#800000|(¬A∧¬B∧¬D)}} ∨ {{color|#000080|(¬ABC)}} ∨ {{color|#008000|(ABD)}} ∨ {{color|#800080|(A∧¬B∧¬C)}}]]

File:Karnaugh map KV 4mal4 19.svg

= ... by syntactic means =

The conversion involves using logical equivalences, such as double negation elimination, De Morgan's laws, and the distributive law. Formulas built from the primitive connectives \{\land,\lor,\lnot\}Formulas with other connectives can be brought into negation normal form first. can be converted to DNF by the following canonical term rewriting system:{{sfn|Dershowitz|Jouannaud|1990|page=270|loc=Sect.5.1}}

:\begin{array}{rcl}

(\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{array}

= ... by semantic means =

The full DNF of a formula can be read off its truth table.{{harvnb|Smullyan|1968|p=14}}: "Make a truth-table for the formula. Each line of the table which comes out "T" will yield one of the basic conjunctions of the disjunctive normal form."{{sfn|Sobolev|2020}} For example, consider the formula

:\phi = ((\lnot (p \land q)) \leftrightarrow (\lnot r \uparrow (p \oplus q))).\phi = ((NOT (p AND q)) IFF ((NOT r) NAND (p XOR q)))

The corresponding truth table is

:

class="wikitable" style="text-align:center;"

! p

! q

! r

! style="background:black"|

! (

! \lnot

! (p \land q)

! )

! \leftrightarrow

! (

! \lnot r

! \uparrow

! (p \oplus q)

! )

TTTstyle="background:black"|FTstyle="background:papayawhip" | FFTF
TTFstyle="background:black"|FTstyle="background:papayawhip" | FTTF
style="background:lightgreen"|Tstyle="background:lightgreen"|Fstyle="background:lightgreen"|Tstyle="background:black"|TFstyle="background:papayawhip" | TFTT
TFFstyle="background:black"|TFstyle="background:papayawhip" | FTFT
style="background:lightgreen"|Fstyle="background:lightgreen"|Tstyle="background:lightgreen"|Tstyle="background:black"|TFstyle="background:papayawhip" | TFTT
FTFstyle="background:black"|TFstyle="background:papayawhip" | FTFT
style="background:lightgreen"|Fstyle="background:lightgreen"|Fstyle="background:lightgreen"|Tstyle="background:black"|TFstyle="background:papayawhip" | TFTF
style="background:lightgreen"|Fstyle="background:lightgreen"|Fstyle="background:lightgreen"|Fstyle="background:black"|TFstyle="background:papayawhip" | TTTF

  • 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.{{refn|name="noreps"|It is assumed that repetitions and variationslike (a \land b) \lor (b \land a) \lor (a \land b \land b) based on the commutativity and associativity of \lor and \land do not occur.}} 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 can be converted to disjunctive normal form.{{Cite book |last=Halbeisen |first=Lorenz |title=Gödel´s theorems and zermelo´s axioms: a firm foundation of mathematics |last2=Kraph |first2=Regula |date=2020 |publisher=Birkhäuser |isbn=978-3-030-52279-7 |location=Cham |pages=27}}{{Cite book |last=Cenzer |first=Douglas |title=Set theory and foundations of mathematics: an introduction to mathematical logic |last2=Larson |first2=Jean |last3=Porter |first3=Christopher |last4=Zapletal |first4=Jindřich |date=2020 |publisher=World Scientific |isbn=978-981-12-0192-9 |location=New Jersey |pages=19–21}}{{Cite book |last=Halvorson |first=Hans |title=How logic works: a user's guide |date=2020 |publisher=Princeton University Press |isbn=978-0-691-18222-3 |location=Princeton Oxford |pages=195}} 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{L} 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.{{Cite book |last=Howson |first=Colin |title=Logic with trees: an introduction to symbolic logic |date=1997 |publisher=Routledge |isbn=978-0-415-13342-5 |location=London; New York |pages=41}}
The proof follows from the procedure given above for generating DNFs from truth tables. 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 ordering of A, B, C, \ldots in the conjunctions is quite arbitrary; any other could be chosen instead). Now form the disjunction of all these conjunctions which correspond to T rows of X's truth table. This disjunction is a sentence in \mathcal{L}[A, B, C, \ldots; \land, \lor, \neg],That is, the language with the propositional variables A, B, C, \ldots and the connectives \{\land, \lor, \neg\}. 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{L}[A, B, C, \ldots; \land, \lor, \neg].
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 \{\land, \lor, \neg\} 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 = \{ p_1, \lnot p_1, p_2, \lnot p_2, \ldots, p_n, \lnot p_n\}.

L has (2^{2n} -1) non-empty subsets.\left|\mathcal{P}(L)\right| = 2^{2n}

This is the maximum number of conjunctions a DNF can have.

A full DNF can have up to 2^{n} 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^{(2 \times 2)} -1 = 15 conjunctions:

:

\begin{array}{lcl}

(\lnot p) \lor (p) \lor (\lnot q) \lor (q) \lor \\

(\lnot p \land p) \lor

\underline{(\lnot p \land \lnot q)} \lor

\underline{(\lnot p \land q)} \lor

\underline{( p \land \lnot q)} \lor

\underline{( p \land q)} \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{array}

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 on conjunctive normal form formulas is NP-complete. 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 simply by checking that at least one conjunction does not contain conflicting literals.

Variants

An important variation used in the study of computational complexity is k-DNF. A formula is in k-DNF if it is in DNF and each conjunction contains at most k literals.{{sfn|Arora|Barak|2009}}

See also

Notes

{{reflist}}

References

{{sfn whitelist |CITEREFSobolev2020}}

  • {{cite book|last1=Arora | first1=Sanjeev |author1-link=Sanjeev Arora|last2=Barak|first2= Boaz |author2-link=Boaz Barak| title=Computational Complexity: A Modern Approach | publisher=Cambridge University Press|date=20 April 2009|pages=579|isbn=9780521424264|doi=10.1017/CBO9780511804090}}
  • {{cite book|last1=Davey | first1=B.A.|last2=Priestley |first2= H.A. | title=Introduction to Lattices and Order |title-link= Introduction to Lattices and Order | publisher=Cambridge University Press | series=Cambridge Mathematical Textbooks | year=1990 }}
  • {{cite book | isbn=0-444-88074-7 | editor-first=Jan |editor-last= Van Leeuwen | editor-link=Jan van Leeuwen | title=Formal Models and Semantics | publisher=Elsevier | series=Handbook of Theoretical Computer Science | volume=B | year=1990 | first1=Nachum |last1=Dershowitz |author1-link=Nachum Dershowitz |first2= Jean-Pierre |last2=Jouannaud |author2-link= Jean-Pierre Jouannaud | contribution=Rewrite Systems | pages=243–320 }}
  • {{cite book|first1=David |last1=Gries|first2=Fred B. |last2=Schneider|title=A Logical Approach to Discrete Math|url=https://books.google.com/books?id=ZWTDQ6H6gsUC&q=%22disjunctive+normal+form%22&pg=PA67|date=22 October 1993|publisher=Springer Science & Business Media|isbn=978-0-387-94115-8}}
  • {{cite book|last1= Hilbert|first1=David|author1-link=David Hilbert|last2= Ackermann|first2=Wilhelm |author2-link=Wilhelm Ackermann|title=Principles of Mathematical Logic|url=https://books.google.com/books?id=45ZGMjV9vfcC&q=%22disjunctive+normal+form%22|year=1999|publisher=American Mathematical Soc.|isbn=978-0-8218-2024-7}}
  • {{cite book|last=Howson|first=Colin|author-link=Colin Howson|title=Logic with trees: an introduction to symbolic logic|url=https://books.google.com/books?id=Y4WGAgAAQBAJ&q=%22disjunctive+normal+form%22|date=11 October 2005|orig-date=1997|publisher=Routledge|isbn=978-1-134-78550-6}}
  • {{Cite journal|last=Post|first=Emil|author-link=Emil Post|title=Introduction to a General Theory of Elementary Propositions|date=July 1921|volume=43|issue=3|pages= 163–185| journal=American Journal of Mathematics|doi=10.2307/2370324|jstor=2370324}}
  • {{Cite book|last=Smullyan|first=Raymond M.|author-link=Raymond Smullyan |title=First-Order Logic|year=1968|edition=1st edition, Second Printing 1971 |publisher=Springer-Verlag|pages=160|location=New York Heidelberg Berlin|doi=10.1007/978-3-642-86718-7|isbn= 978-3-642-86718-7|series= Ergebnisse der Mathematik und ihrer Grenzgebiete|volume=43}}
  • {{SpringerEOM|title=Disjunctive normal form|author-last1=Sobolev|author-first1=S.K.|oldid=54535|date=2020}}
  • {{cite book|first=J. Eldon |last=Whitesitt|title=Boolean Algebra and Its Applications|url=https://books.google.com/books?id=20Un1T78GlMC&q=%22disjunctive+normal+form%22|date=24 May 2012|orig-year=1961|publisher=Courier Corporation|isbn=978-0-486-15816-7}}

{{Normal forms in logic}}

Category:Normal forms (logic)

Category:Knowledge compilation