Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Disjunctive normal form

From Wikipedia, the free encyclopedia
(Redirected fromDisjunctive Normal Form Theorem)
Standard form of a boolean function

Inboolean logic, adisjunctive normal form (DNF) is anormal form of a logical formula consisting of a disjunction of conjunctions; it can also be described as anOR of ANDs, asum of products, or — inphilosophical logic — acluster concept.[1] The disjunctive normal form and its counterpart, theconjunctive normal form, are the most common standardized ways of representingboolean expressions. They are widely used in various applications such ascircuit design orautomated theorem proving.

Definition

[edit]

A logical formula is considered to be in DNF if it is adisjunction of one or moreconjunctions of one or moreliterals.[2][3][4] A DNF formula is infull 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 inconjunctive normal form (CNF), the only propositional operators in DNF areand ({\displaystyle \wedge }),or ({\displaystyle \vee }), andnot (¬{\displaystyle \neg }). Thenot operator can only be used as part of a literal, which means that it can only precede apropositional variable.

The following is acontext-free grammar for DNF:

DNF{\displaystyle \,\to \,} (Disjunct){\displaystyle \,\mid \,} (Disjunct){\displaystyle \,\lor \,}DNF
Disjunct{\displaystyle \,\to \,}Literal{\displaystyle \,\mid \,}Literal{\displaystyle \,\land \,}Disjunct
Literal{\displaystyle \,\to \,}Variable{\displaystyle \,\mid \,}¬{\displaystyle \,\neg \,}Variable

WhereVariable is any variable.

For example, all of the following formulas are in DNF:

The formulaAB{\displaystyle A\lor B} is in DNF, but not in full DNF; an equivalent full-DNF version is(AB)(A¬B)(¬AB){\displaystyle (A\land B)\lor (A\land \lnot B)\lor (\lnot A\land B)}.

The following formulas arenot in DNF:

Conversion to DNF

[edit]

Inclassical logic each propositional formula can be converted to DNF[6] ...

Karnaugh map of the disjunctive normal formA∧¬B∧¬D)ABC)(ABD)(A∧¬B∧¬C)
Karnaugh map of the disjunctive normal formAC∧¬D)(BCD)(A∧¬CD)B∧¬C∧¬D). Despite the different grouping, the same fields contain a "1" as in the previous map.

... by syntactic means

[edit]

The conversion involves usinglogical equivalences, such asdouble negation elimination,De Morgan's laws, and thedistributive law. Formulas built from theprimitiveconnectives{,,¬}{\displaystyle \{\land ,\lor ,\lnot \}}[7] can be converted to DNF by the followingcanonical term rewriting system:[8]

(¬¬x)x(¬(xy))((¬x)(¬y))(¬(xy))((¬x)(¬y))(x(yz))((xy)(xz))((xy)z)((xz)(yz)){\displaystyle {\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

[edit]

The full DNF of a formula can be read off itstruth table.[9][10] For example, consider the formula

ϕ=((¬(pq))(¬r(pq))){\displaystyle \phi =((\lnot (p\land q))\leftrightarrow (\lnot r\uparrow (p\oplus q)))}.[11]

The correspondingtruth table is

p{\displaystyle p}q{\displaystyle q}r{\displaystyle r}({\displaystyle (}¬{\displaystyle \lnot }(pq){\displaystyle (p\land q)}){\displaystyle )}{\displaystyle \leftrightarrow }({\displaystyle (}¬r{\displaystyle \lnot r}{\displaystyle \uparrow }(pq){\displaystyle (p\oplus q)}){\displaystyle )}
TTTFTFFTF
TTFFTFTTF
TFTTFTFTT
TFFTFFTFT
FTTTFTFTT
FTFTFFTFT
FFTTFTFTF
FFFTFTTTF
(p¬qr)(¬pqr)(¬p¬qr)(¬p¬q¬r){\displaystyle (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)}
(pqr)(pq¬r)(p¬q¬r)(¬pq¬r){\displaystyle (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

[edit]

A propositional formula can be represented by one and only one full DNF.[13] In contrast, severalplain DNFs may be possible. For example, by applying the rule((ab)(¬ab))b{\displaystyle ((a\land b)\lor (\lnot a\land b))\rightsquigarrow b} three times, the full DNF of the aboveϕ{\displaystyle \phi } can be simplified to(¬p¬q)(¬pr)(¬qr){\displaystyle (\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

[edit]

It is a theorem that all consistent formulas inpropositional logic can be converted to disjunctive normal form.[14][15][16][17] This is called theDisjunctive Normal Form Theorem.[14][15][16][17] The formal statement is as follows:

Disjunctive Normal Form Theorem: SupposeX{\displaystyle X} is a sentence in a propositional languageL{\displaystyle {\mathcal {L}}} withn{\displaystyle n} sentence letters, which we shall denote byA1,...,An{\displaystyle A_{1},...,A_{n}}. IfX{\displaystyle X} is not a contradiction, then it is truth-functionally equivalent to a disjunction of conjunctions of the form±A1...±An{\displaystyle \pm A_{1}\land ...\land \pm A_{n}}, where+Ai=Ai{\displaystyle +A_{i}=A_{i}}, andAi=¬Ai{\displaystyle -A_{i}=\neg A_{i}}.[15]

The proof follows from the procedure given above for generating DNFs fromtruth tables. Formally, the proof is as follows:

SupposeX{\displaystyle X} is a sentence in a propositional language whose sentence letters areA,B,C,{\displaystyle A,B,C,\ldots }. For each row ofX{\displaystyle X}'s truth table, write out a correspondingconjunction±A±B±C{\displaystyle \pm A\land \pm B\land \pm C\land \ldots }, where±A{\displaystyle \pm A} is defined to beA{\displaystyle A} ifA{\displaystyle A} takes the valueT{\displaystyle T} at that row, and is¬A{\displaystyle \neg A} ifA{\displaystyle A} takes the valueF{\displaystyle F} at that row; similarly for±B{\displaystyle \pm B},±C{\displaystyle \pm C}, etc. (thealphabetical ordering ofA,B,C,{\displaystyle A,B,C,\ldots } in the conjunctions is quite arbitrary; any other could be chosen instead). Now form thedisjunction of all these conjunctions which correspond toT{\displaystyle T} rows ofX{\displaystyle X}'s truth table. This disjunction is a sentence inL[A,B,C,;,,¬]{\displaystyle {\mathcal {L}}[A,B,C,\ldots ;\land ,\lor ,\neg ]},[18] which by the reasoning above is truth-functionally equivalent toX{\displaystyle X}. This construction obviously presupposes thatX{\displaystyle X} takes the valueT{\displaystyle T} on at least one row of its truth table; ifX{\displaystyle X} doesn’t, i.e., ifX{\displaystyle X} is acontradiction, thenX{\displaystyle X} is equivalent toA¬A{\displaystyle A\land \neg A}, which is, of course, also a sentence inL[A,B,C,;,,¬]{\displaystyle {\mathcal {L}}[A,B,C,\ldots ;\land ,\lor ,\neg ]}.[15]

This theorem is a convenient way to derive many usefulmetalogical results in propositional logic, such as,trivially, the result that the set of connectives{,,¬}{\displaystyle \{\land ,\lor ,\neg \}} isfunctionally complete.[15]

Maximum number of conjunctions

[edit]

Any propositional formula is built fromn{\displaystyle n} variables, wheren1{\displaystyle n\geq 1}.

There are2n{\displaystyle 2n} possible literals:L={p1,¬p1,p2,¬p2,,pn,¬pn}{\displaystyle L=\{p_{1},\lnot p_{1},p_{2},\lnot p_{2},\ldots ,p_{n},\lnot p_{n}\}}.

L{\displaystyle L} has(22n1){\displaystyle (2^{2n}-1)} non-empty subsets.[19]

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

A full DNF can have up to2n{\displaystyle 2^{n}} conjunctions, one for each row of the truth table.

Example 1

Consider a formula with two variablesp{\displaystyle p} andq{\displaystyle q}.

The longest possible DNF has2(2×2)1=15{\displaystyle 2^{(2\times 2)}-1=15} conjunctions:[13]

(¬p)(p)(¬q)(q)(¬pp)(¬p¬q)_(¬pq)_(p¬q)_(pq)_(¬qq)(¬pp¬q)(¬ppq)(¬p¬qq)(p¬qq)(¬pp¬qq){\displaystyle {\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 atautology. It can be simplified to(¬pp){\displaystyle (\neg p\lor p)} or to(¬qq){\displaystyle (\neg q\lor q)}, which are also tautologies, as well as valid DNFs.

Example 2

Each DNF of the e.g. formula(X1Y1)(X2Y2)(XnYn){\displaystyle (X_{1}\lor Y_{1})\land (X_{2}\lor Y_{2})\land \dots \land (X_{n}\lor Y_{n})} has2n{\displaystyle 2^{n}} conjunctions.

Computational complexity

[edit]

TheBoolean satisfiability problem onconjunctive normal form formulas isNP-complete. By theduality principle, so is the falsifiability problem on DNF formulas. Therefore, it isco-NP-hard to decide if a DNF formula is atautology.

Conversely, a DNF formula is satisfiable if, and only if, one of its conjunctions is satisfiable. This can be decided inpolynomial time simply by checking that at least one conjunction does not contain conflicting literals.

Variants

[edit]

An important variation used in the study ofcomputational complexity isk-DNF. A formula is ink-DNF if it is in DNF and each conjunction contains at most k literals.[20]

See also

[edit]

Notes

[edit]
  1. ^Post 1921.
  2. ^Davey & Priestley 1990, p. 153.
  3. ^Gries & Schneider 1993, p. 67.
  4. ^Whitesitt 2012, pp. 33–37.
  5. ^However, this one is innegation normal form.
  6. ^Davey & Priestley 1990, p. 152-153.
  7. ^Formulas with other connectives can be brought intonegation normal form first.
  8. ^Dershowitz & Jouannaud 1990, p. 270, Sect.5.1.
  9. ^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."
  10. ^Sobolev 2020.
  11. ^ϕ{\displaystyle \phi } = ((NOT (pAND q))IFF ((NOT r)NAND (pXOR q)))
  12. ^like(ab)(ba)(abb){\displaystyle (a\land b)\lor (b\land a)\lor (a\land b\land b)}
  13. ^abcIt is assumed that repetitions and variations[12] based on thecommutativity andassociativity of{\displaystyle \lor } and{\displaystyle \land } do not occur.
  14. ^abHalbeisen, Lorenz; Kraph, Regula (2020).Gödel´s theorems and zermelo´s axioms: a firm foundation of mathematics. Cham: Birkhäuser. p. 27.ISBN 978-3-030-52279-7.
  15. ^abcdeHowson, Colin (1997).Logic with trees: an introduction to symbolic logic. London; New York: Routledge. p. 41.ISBN 978-0-415-13342-5.
  16. ^abCenzer, Douglas; Larson, Jean; Porter, Christopher; Zapletal, Jindřich (2020).Set theory and foundations of mathematics: an introduction to mathematical logic. New Jersey: World Scientific. pp. 19–21.ISBN 978-981-12-0192-9.
  17. ^abHalvorson, Hans (2020).How logic works: a user's guide. Princeton Oxford: Princeton University Press. p. 195.ISBN 978-0-691-18222-3.
  18. ^That is, the language with the propositional variablesA,B,C,{\displaystyle A,B,C,\ldots } and the connectives{,,¬}{\displaystyle \{\land ,\lor ,\neg \}}.
  19. ^|P(L)|=22n{\displaystyle \left|{\mathcal {P}}(L)\right|=2^{2n}}
  20. ^Arora & Barak 2009.

References

[edit]
Normal forms in logic
Propositional logic
Predicate logic
Other
Retrieved from "https://en.wikipedia.org/w/index.php?title=Disjunctive_normal_form&oldid=1318378980#Disjunctive_Normal_Form_Theorem"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp