Negation normal form: Difference between revisions

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search
imported>Marc Schroeder
m →Definition: better layout of context-free grammar
 
imported>Oneequalsequalsone
use standard notation
 
Line 43: Line 43:
&(A \lor \lnot B) \\
&(A \lor \lnot B) \\
&(A \land \lnot B) \\
&(A \land \lnot B) \\
&\{[(A \land (\lnot B \lor C)) \land \lnot C] \lor D \}
&((A \land (\lnot B \lor C)) \land \lnot C)
\end{align}</math>
\end{align}</math>
The first example is also in [[conjunctive normal form]], the next two are in both [[conjunctive normal form]] and [[disjunctive normal form]], but the last example is in neither.
The first example is also in [[conjunctive normal form]], the next two are in both [[conjunctive normal form]] and [[disjunctive normal form]], but the last example is in neither.

Latest revision as of 23:03, 9 November 2025

Template:Short description In mathematical logic, a formula is in negation normal form (NNF) if the negation operator (¬, <templatestyles src="smallcaps/styles.css"/>not) is only applied to variables and the only other allowed Boolean operators are conjunction (∧, <templatestyles src="smallcaps/styles.css"/>and) and disjunction (∨, <templatestyles src="smallcaps/styles.css"/>or).

Negation normal form is not a canonical form: for example, a∧(b∨¬c) and (a∧b)∨(a∧¬c) are equivalent, and are both in negation normal form.

Definition

The following is a context-free grammar for NNF:

NNF → Literal
Script error: No such module "String".∣( NNF ∧ NNF Script error: No such module "String".)
Script error: No such module "String".∣( NNF ∨ NNF Script error: No such module "String".)
Literal → Variable
Script error: No such module "String".∣¬ Variable

where Variable is any variable.

Examples and counterexamples

         ∨
       /   \
      ∧     D
    /   \
   ∧     ¬
 /   \   |
A     ∨  C
     /  \
    ¬    C
    |
    B         

The following formulae are all in negation normal form:

((A∨B)∧C)(A∨¬B)(A∧¬B)((A∧(¬B∨C))∧¬C)

The first example is also in conjunctive normal form, the next two are in both conjunctive normal form and disjunctive normal form, but the last example is in neither.

The following formulae are not in negation normal form:

(A→B)¬(A∨B)¬(A∧B)¬(A∨¬C)

They are however respectively equivalent to the following formulae in negation normal form:

(¬A∨B)(¬A∧¬B)(¬A∨¬B)(¬A∧C)

Conversion to NNF

In classical logic and many modal logics, every formula can be brought into this form by replacing implications (→) and equivalences (↔) by their definitions, using De Morgan's laws to push negation inwards, and eliminating double negations. This process can be represented using the following rewrite rules:Script error: No such module "Footnotes".Script error: No such module "Check for unknown parameters".

A→B⇝¬A∨BA↔B⇝(¬A∨B)∧(A∨¬B)¬(A∨B)⇝¬A∧¬B¬(A∧B)⇝¬A∨¬B¬¬A⇝A¬∃xA⇝∀x¬A¬∀xA⇝∃x¬A

Transformation into negation normal form can increase the size of a formula only linearly: the number of occurrences of atomic formulas remains the same, the total number of occurrences of ∧ and ∨ is unchanged, and the number of occurrences of ¬ in the normal form is bounded by the length of the original formula.

A formula in negation normal form can be put into the stronger conjunctive normal form or disjunctive normal form by applying distributivity. Repeated application of distributivity may exponentially increase the size of a formula. In the classical propositional logic, transformation to negation normal form does not impact computational properties: the satisfiability problem continues to be NP-complete, and the validity problem continues to be co-NP-complete. For formulas in conjunctive normal form, the validity problem is solvable in polynomial time, and for formulas in disjunctive normal form, the satisfiability problem is solvable in polynomial time.

See also

Notes

<templatestyles src="Reflist/styles.css" />

Script error: No such module "Check for unknown parameters".

References

  • Script error: No such module "citation/CS1".

External links

Template:Normal forms in logic