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:
- Put the formula into negation normal form.
- Skolemize -- replace existential variables with Skolem constants or Skolem functions of universal variables, from the outside inward. Make the following replacements:
- becomes , where c is new
- becomes , where fc is new
- Remove the universal quantifiers.
- Put the formula into conjunctive normal form.
- Replace with {C1,...,Cn}. Each conjunct is of the form , which is equivalent to .
- 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.
- Finally, replace each conjunct with .
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.