\usepackagepifont You can't use 'macro parameter character #' in math mode You can't use 'macro parameter character #' in math mode

CNF Translations

As mentioned earlier, each formula can be translated into a logically equivalent formula in the conjunctive normal form. We next show three methods to do this. The first two only use the variables occurring in the original formula and are, in the worst case, of exponential size in the size of the original formula. The third method introduces auxiliary variables and is of linear size.

Method 1: Applying local rewriting rules

One can transform an arbitrary formula into an equivalent CNF formula by applying a sequence of local transformations:

  1. Eliminate other binary connectives but conjunction and disjunction by applying the following rules:

    • αβ (α¬β)(¬αβ)

    • αβ (¬αβ)

    • αβ (¬α¬β)(αβ)

  2. Move negations next to variables

    • ¬(¬α)α

    • ¬(αβ)(¬α)(¬β)

    • ¬(αβ)(¬α)(¬β)

  3. Move conjunctions outside of disjunctions:

    • α(β1...βk)(αβ1)...(αβk)

Note that simplification could, and should, be performed whenever possible by applying, for instance, the following rules:

  • x¬x

  • β

  • ββ

Example

Translating the formula (ab)c to CNF by the procedure above gives us

  1. first (ab¬c)(¬(ab)c),

  2. then (ab¬c)((¬a¬b)c), and

  3. and finally

    • ((ab¬c)(¬a¬b))    ((ab¬c)c),

    • (a¬a¬b)(b¬a¬b)(¬c¬a¬b)(ac)(bc)(¬cc), and

    • (¬c¬a¬b)(ac)(bc)

In the worst case, the above translation results in exponentially larger CNF formulas. For instance, for the formula

(x1y1)(x2y2)...(xnyn)

the equivalent CNF formula

z1{x1,y1},...,zn{xn,yn}(z1z2...zn)

has 2n clauses. As a concrete example with n=3, the CNF of (x1y1)(x2y2)(x3y3) is

(x1x2x3)(x1x2y3)(x1y2x3)(x1y2y3)(y1x2x3)(y1x2y3)(y1y2x3)(y1y2y3)

Method 2: Deriving CNF from truth tables

For small formulas, CNF can be directly read from the truth table for the formula. This is based on the observation that

  • ​ a clause (l1..lk) is equivalent to ¬(¬l1...¬lk) and

  • ​ thus, in CNF, “excludes” the rows in the truth table in which l1,...,lk are all false.

Example

The truth table for the formula (ab)c is shown below.

abc(ab)(ab)cFFFFFFFTFTFTFFFFTTFTTFFFFTFTFTTTFTTTTTTF

Now the clause (abc), which is equivalent to ¬(¬a¬b¬c), forbids the all-false truth assignment in the first row. Excluding each row in which (ab)c is F by adding a clause, we get the CNF formula

(abc)(a¬bc)(¬abc)(¬a¬b¬c).

This is equivalent to the formula (¬c¬a¬b)(ac)(bc) obtained in the example of the previous method above.

Method 3: The Tseitin-translation

This methods uses auxiliary, “fresh” variables that do not occur in the original formula to encode the semantics of the sub-formulas. The resulting CNF formula is of linear size in the size of the original formula.

Take a formula ϕ. For each non-variable sub-formula γ, introduce a fresh auxiliary variable vγ. For each variable x, let vx=x. We then encode the semantics of each sub-formula γ by the following rules:

γEncoding clauses¬α(¬vγ¬vα)(vγvα)αβ(¬vγvα)(¬vγvβ)(vγ¬vα¬vβ)αβ(vγ¬vα)(vγ¬vβ)(¬vγvαvβ)αβ(¬vγ¬vα¬vβ)(¬vγvαvβ)(vγ¬vαvβ)(vγvα¬vβ)αβ(vγvα)(vγ¬vβ)(¬vγ¬vαvβ)αβ(¬vγ¬vαvβ)(¬vγvα¬vβ)(vγ¬vα¬vβ)(vγvαvβ)

For intuition, consider the case γ=αβ. The clauses correspond to the implications:

(vγvα)(vγvβ)(¬vγ(¬vα¬vβ))

or, equivalently,

(¬vα¬vγ)(¬vβ¬vγ)(vαvβvγ)

From these it is easier to see that the clauses do encode the semantics of the sub-formulas correctly.

Finally, to force that the whole formula ϕ should evaluate to true, we add the unary clause (vϕ) to the CNF formula.

Example

Consider again the formula

(ab)c

For notational convenience, let p=v(ab)c and q=v(ab). The CNF translation is:

(¬qa)(¬qb)(q¬a¬b)(¬p¬q¬c)(¬pqc)(p¬qc)(pq¬c)(p)

The satisfying truth assignments of ϕ and its Tseitin-translated formula are in one-to-one correspondence.

Example

Again, consider the formula ϕ and its Tseitin translation ϕ:

ϕ=(ab)cϕ=(¬qa)(¬qb)(q¬a¬b)(¬p¬q¬c)(¬pqc)(p¬qc)(pq¬c)(p)
  1. The assignment τ={aT,bF,cT} satisfies ϕ.

    Its extension τ={aT,bF,cT,pT,qF} satisfies ϕ.

  2. The assignment τ={aT,bF,cF} does not satisfy ϕ.

    There is no extension of {aT,bF,cF} that satisfies ϕ.