# Negation normal form

In mathematical logic, a formula is in negation normal form if the negation operator (${\displaystyle \lnot }$, not) is only applied to variables and the only other allowed Boolean operators are conjunction (${\displaystyle \land }$, and) and disjunction (${\displaystyle \lor }$, or).

Negation normal form is not a canonical form: for example, ${\displaystyle a\land (b\lor \lnot c)}$ and ${\displaystyle (a\land b)\lor (a\land \lnot c)}$ are equivalent, and are both in negation normal form.

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 (Handbook of Automated Reasoning 1, p. 204):

${\displaystyle A\Rightarrow B\to \lnot A\lor B}$
${\displaystyle \lnot (A\lor B)\to \lnot A\land \lnot B}$
${\displaystyle \lnot (A\land B)\to \lnot A\lor \lnot B}$
${\displaystyle \lnot \lnot A\to A}$
${\displaystyle \lnot \exists xA\to \forall x\lnot A}$
${\displaystyle \lnot \forall xA\to \exists x\lnot A}$

[In these rules, the ${\displaystyle \Rightarrow }$ symbol indicates logical implication in the formula being rewritten, and ${\displaystyle \to }$ is the rewriting operation.]

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 ${\displaystyle \land }$ and ${\displaystyle \lor }$ is unchanged, and the number of occurrences of ${\displaystyle \lnot }$ may double.

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 CNF, validity problem is solvable in polynomial time, and for formulas in DNF, the satisfiability problem is solvable in polynomial time.

## Examples and counterexamples

The following formulae are all in negation normal form:

${\displaystyle (A\vee B)\wedge C}$
${\displaystyle (A\wedge (\lnot B\vee C)\wedge \lnot C)\vee D}$
${\displaystyle A\vee \lnot B}$
${\displaystyle A\wedge \lnot B}$

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

The following formulae are not in negation normal form:

${\displaystyle A\Rightarrow B}$
${\displaystyle \lnot (A\vee B)}$
${\displaystyle \lnot (A\wedge B)}$
${\displaystyle \lnot (A\vee \lnot C)}$

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

${\displaystyle \lnot A\vee B}$
${\displaystyle \lnot A\wedge \lnot B}$
${\displaystyle \lnot A\vee \lnot B}$
${\displaystyle \lnot A\wedge C}$

## References

• Alan J.A. Robinson and Andrei Voronkov, Handbook of Automated Reasoning 1:203ff (2001) ISBN 0444829490.