Clausal normal form

From Wikipedia, the free encyclopedia

The clausal normal form (or clause normal form, conjunctive normal form, CNF) is used in logic programming and many theorem proving systems. The procedure to convert a formula into clausal form can destroy the structure of the formula, and naive translations often causes exponential blowup in the size of the resulting formula.

The procedure begins with any formula of classical first-order logic:

  1. Put the formula into negation normal form.
  2. Skolemize -- replace existential variables with Skolem constants or Skolem functions of universal variables, from the outside inward. Make the following replacements:
    • \forall x \, P(x) becomes \forall c \, P(c), where c is new
    • \forall x \exists y \, P(y) becomes , \forall x \, P(f_c(x)), where fc is new
  3. Remove the universal quantifiers.
  4. Put the formula into conjunctive normal form.
  5. Replace C1 \wedge ... \wedge Cn with {C1,...,Cn}. Each conjunct is of the form \neg A1 \vee ... \vee \neg Am \vee B1 \vee ... \vee Bn, which is equivalent to ( A1 \wedge ... \wedge Am ) \to ( B1 \vee ... \vee Bn ).
    • If m=0 and n=1, this is a Prolog fact.
    • If m>0 and n=1, this is a Prolog rule.
    • If m>0 and n=0, this is a Prolog query.
  6. Finally, replace each conjunct ( A1 \wedge ... \wedge Am ) \to ( B1 \vee ... \vee Bn ) with \{ A1 \wedge ... \wedge Am \to B1 , A1 \wedge ... \wedge Am \to B2 , ... , A1 \wedge ... \wedge Am \to Bn \}.

When n=1, the logic is called Horn clause logic and is equivalent in computational power to a Universal Turing machine.

Often it is sufficient to generate an equisatisfiable (not an equivalent) CNF for a formula. In this case, the worst-case exponential blow-up can be avoided by introducing definitions and using them to rename parts of the formula.

Languages