Skip to content

1.4 Normal Forms

Conjunctive normal form, disjunctive normal form, and systematic conversion of propositional formulas.

Normal forms are standard shapes for propositional formulas, and they are useful because they make formulas easier to compare, transform, and process by algorithms.

Literals and Clauses

A literal is either a propositional variable or the negation of a propositional variable.

Thus the following are literals:

p,¬p,q,¬q p, \quad ¬p, \quad q, \quad ¬q

The formula:

¬(pq) ¬(p \land q)

is not a literal, because the negation is applied to a compound formula rather than directly to a variable.

A clause is a disjunction of literals. For example:

p¬qr p \lor ¬q \lor r

is a clause.

A term is a conjunction of literals. For example:

p¬qr p \land ¬q \land r

is a term.

These words are used to describe the two most common normal forms.

Definition 1.26 (Conjunctive Normal Form)

A formula is in conjunctive normal form, or CNF, if it is a conjunction of clauses.

Equivalently, a CNF formula has the form:

C1C2Cn C_1 \land C_2 \land \cdots \land C_n

where each CiC_i is a disjunction of literals.

For example:

(p¬q)(qr)(¬p¬r) (p \lor ¬q) \land (q \lor r) \land (¬p \lor ¬r)

is in conjunctive normal form.

A single clause is also regarded as a CNF formula, since it is a conjunction with one conjunct.

Definition 1.27 (Disjunctive Normal Form)

A formula is in disjunctive normal form, or DNF, if it is a disjunction of terms.

Equivalently, a DNF formula has the form:

T1T2Tn T_1 \lor T_2 \lor \cdots \lor T_n

where each TiT_i is a conjunction of literals.

For example:

(p¬q)(qr)(¬p¬r) (p \land ¬q) \lor (q \land r) \lor (¬p \land ¬r)

is in disjunctive normal form.

A single term is also regarded as a DNF formula, since it is a disjunction with one disjunct.

Example 1.28

The formula:

(pq)(¬pr) (p \lor q) \land (¬p \lor r)

is in CNF, because it is a conjunction of two clauses.

The formula:

(pq)(¬pr) (p \land q) \lor (¬p \land r)

is in DNF, because it is a disjunction of two terms.

The formula:

p(qr) p \land (q \lor r)

is in CNF, since it may be read as:

(p)(qr) (p) \land (q \lor r)

The same formula is not in DNF as written, because one conjunct contains a disjunction.

Negation Normal Form

Before converting a formula to CNF or DNF, it is useful to first put it into a simpler intermediate form.

A formula is in negation normal form if negation occurs only directly in front of propositional variables.

For example:

¬p(q¬r) ¬p \lor (q \land ¬r)

is in negation normal form.

The formula:

¬(pq) ¬(p \land q)

is not in negation normal form, because the negation is applied to a compound formula.

Lemma 1.29 (Conversion to Negation Normal Form)

Every propositional formula is logically equivalent to a formula in negation normal form.

Proof

The proof is by structural induction on formulas.

If the formula is a variable, then it is already in negation normal form.

If the formula has the form ¬A¬A, then we consider the structure of AA. If AA is a variable, then ¬A¬A is already in negation normal form. If AA is itself a negation, then double negation removes two negation signs:

¬¬BB ¬¬B \equiv B

If AA is a conjunction or disjunction, then De Morgan laws move the negation inward:

¬(BC)¬B¬C ¬(B \land C) \equiv ¬B \lor ¬C

and:

¬(BC)¬B¬C ¬(B \lor C) \equiv ¬B \land ¬C

If AA contains implication or biconditional, those connectives are first eliminated using:

BC¬BC B \to C \equiv ¬B \lor C

and:

BC(BC)(CB) B \leftrightarrow C \equiv (B \to C) \land (C \to B)

By repeatedly applying these equivalences, every negation is pushed inward until it applies only to variables.

Conversion Rules

The usual conversion to CNF or DNF proceeds in stages.

First, eliminate biconditionals:

AB(AB)(BA) A \leftrightarrow B \equiv (A \to B) \land (B \to A)

Second, eliminate implications:

AB¬AB A \to B \equiv ¬A \lor B

Third, push negations inward using:

¬¬AA ¬¬A \equiv A ¬(AB)¬A¬B ¬(A \land B) \equiv ¬A \lor ¬B ¬(AB)¬A¬B ¬(A \lor B) \equiv ¬A \land ¬B

After these steps, the formula is in negation normal form.

To obtain CNF, distribute disjunction over conjunction:

A(BC)(AB)(AC) A \lor (B \land C) \equiv (A \lor B) \land (A \lor C)

To obtain DNF, distribute conjunction over disjunction:

A(BC)(AB)(AC) A \land (B \lor C) \equiv (A \land B) \lor (A \land C)

Example 1.30 (Conversion to CNF)

Convert the formula:

¬(pq)r ¬(p \to q) \lor r

to CNF.

First eliminate the implication:

pq¬pq p \to q \equiv ¬p \lor q

Thus:

¬(pq)r¬(¬pq)r ¬(p \to q) \lor r \equiv ¬(¬p \lor q) \lor r

Now push the negation inward:

¬(¬pq)p¬q ¬(¬p \lor q) \equiv p \land ¬q

Hence:

¬(pq)r(p¬q)r ¬(p \to q) \lor r \equiv (p \land ¬q) \lor r

Now distribute \lor over \land:

(p¬q)r(pr)(¬qr) (p \land ¬q) \lor r \equiv (p \lor r) \land (¬q \lor r)

Therefore a CNF form is:

(pr)(¬qr) (p \lor r) \land (¬q \lor r)

Example 1.31 (Conversion to DNF)

Convert the same formula:

¬(pq)r ¬(p \to q) \lor r

to DNF.

As above:

¬(pq)r(p¬q)r ¬(p \to q) \lor r \equiv (p \land ¬q) \lor r

This is already in DNF, since it is a disjunction of terms:

(p¬q)r (p \land ¬q) \lor r

The literal rr is regarded as a term with one literal.

Lemma 1.32 (Existence of CNF and DNF)

Every propositional formula is logically equivalent to a formula in conjunctive normal form and to a formula in disjunctive normal form.

Proof

First convert the formula to negation normal form. This removes implications and biconditionals and ensures that every negation applies only to a variable.

For CNF, repeatedly distribute disjunction over conjunction:

A(BC)(AB)(AC) A \lor (B \land C) \equiv (A \lor B) \land (A \lor C)

Each application moves conjunctions outward until the outermost structure is a conjunction of clauses.

For DNF, repeatedly distribute conjunction over disjunction:

A(BC)(AB)(AC) A \land (B \lor C) \equiv (A \land B) \lor (A \land C)

Each application moves disjunctions outward until the outermost structure is a disjunction of terms.

Since formulas are finite, the process terminates after finitely many steps.

Normal Forms from Truth Tables

Normal forms can also be obtained directly from a truth table.

To construct a DNF formula, take each row in which the formula is true. For each such row, write a term that describes exactly that row. Then take the disjunction of all such terms.

For example, suppose a formula in variables pp and qq is true exactly in the following rows:

p=T,q=T p=\mathrm{T}, \quad q=\mathrm{T}

and:

p=F,q=T p=\mathrm{F}, \quad q=\mathrm{T}

The corresponding DNF is:

(pq)(¬pq) (p \land q) \lor (¬p \land q)

This formula is true exactly in those rows.

To construct a CNF formula, take each row in which the formula is false. For each such row, write a clause that excludes exactly that row. Then take the conjunction of all such clauses.

If the false rows are:

p=T,q=F p=\mathrm{T}, \quad q=\mathrm{F}

and:

p=F,q=F p=\mathrm{F}, \quad q=\mathrm{F}

then the corresponding clauses are:

¬pq ¬p \lor q

and:

pq p \lor q

Thus the CNF is:

(¬pq)(pq) (¬p \lor q) \land (p \lor q)

Lemma 1.33 (Truth Table Normal Forms)

Every truth table determines a DNF formula and a CNF formula with the same truth values as the table.

Proof

For DNF, each true row is represented by a term that is true exactly on that row. The disjunction of all such terms is true exactly when at least one true row is matched, and therefore it has the same truth table as the original formula.

For CNF, each false row is represented by a clause that is false exactly on that row. The conjunction of all such clauses is true exactly when none of the false rows is matched, and therefore it has the same truth table as the original formula.

Size of Normal Forms

Although every formula has an equivalent CNF and DNF, the converted formula may be much larger than the original one.

For example, repeated distribution can duplicate subformulas. A short formula may therefore produce a normal form whose size grows exponentially in the number of variables.

This matters in computation, because normal forms are useful for algorithms, but converting formulas naively can be inefficient for large inputs.

Connection with Computation

CNF is especially important in satisfiability solving, because many SAT solvers take formulas in conjunctive normal form as input.

A CNF formula represents a list of constraints:

C1C2Cn C_1 \land C_2 \land \cdots \land C_n

To satisfy the formula, every clause CiC_i must be true.

DNF has a different interpretation. A DNF formula represents a list of sufficient cases:

T1T2Tn T_1 \lor T_2 \lor \cdots \lor T_n

To satisfy the formula, it is enough for one term TiT_i to be true.