ROHINI COLLEGE OF ENGINEERING AND TECHNOLOGY
CONVERTING PREDICATE LOGIC TO CLAUSE FORM
Predicate calculus formulas can easily be represented using the programming languages widely
used in AI. The first order predicate calculus is a formal language for expressing the content of
propositions.
Like any formal language, it has a well-defined syntax.
A properly-formed predicate calculus expression is called a well formed formula or WFF
(pronounced wiff). Otherwise called as Clause Form
Example: Consider the statement
“We know that all Romans who know Marcus either hate Caesar or think that anyone who
hates anyone is crazy”.
Represented in the well-formatted formula(wff):
∀x: [Roman(x) ^ know(x, Marcus)] → [hate(x, Caesar) V (∀y : (Ǝz : hate(y, z)) →
thinkcrazy(x, y))]
To use this formula in a proof requires a complex matching process
Algorithm to convert any wff into conjunctive normal form, we lose no generally if we employ
a proof procedure that operates only on wff’s in this form.
● We need to reduce a set of wff’s to a set of clauses, where a clause is defined to be a wff in
conjunctive normal form but with no instances of the connector A
● Converting each wff into conjunctive normal form and then breaking apart each such expression
into clauses, one for each conjunct
● All conjuncts considered to be conjoined together as the proof procedure operates. 2.4.1
Algorithm: Convert to Clause Form
1. Eliminate →, using the fact that a → b is equivalent to ¬ a V b.
Performing this transformation on the wff given above yields
CS8691-ARTIFICIAL INTELLIGENCE
ROHINI COLLEGE OF ENGINEERING AND TECHNOLOGY
∀x: ¬ [Roman(x) ^ know(x, Marcus)] V [hate(x, Caesar) V (∀y : ¬(Ǝz : hate(y, z)) V thinkcrazy(x,
y))]
2. Reduce the scope of each ¬ to a single term, using the fact that
¬ (¬ p) = p, deMorgan’s laws [which say that ¬ (a ^ b) = ¬ a V ¬ b and ¬ (a V b) = ¬ a ^ ¬ b ],
and the standard correspondences between quantifiers
[¬ ∀x: P(x) = Ǝx: ¬ P(x) and ¬ Ǝx: P(x) = Vx: ¬P(x)].
Performing this transformation on the wff from step 1 yields
∀x: [¬ Roman(x) V ¬ know(x, Marcus)] V [hate(x, Caesar) V (∀y: Ǝz: ¬ hate(y, z) V thinkcrazy(x,
y))]
3. Standardize variables so that each quantifier binds a unique variable. Since variables are
just dummy names, this process cannot affect the truth value of the wff.
For example, the formula ∀x: P(x) V ∀x: Q(x) would be converted to ∀x: P(x) V ∀y: Q(y)
4. Move all quantifiers to the left of the formula without changing their relative order. This
is possible since there is no conflict among variable names. Performing this operation on the
formula of step 2,
we get
∀x: ∀y: ∀z: [¬ Roman(x) V ¬ know(x, Marcus)] V [hate(x, Caesar) V (¬ hate(y, z) V
thinkcrazy(x, y))]
At this point, the formula is in what is known as prenex normal form. It consists of a prefix of
quantifiers followed by a matrix, which is quantifier-free.
5.Eliminate existential quantifiers
A formula that contains an existentially quantified variable asserts that there is a value that
can be substituted for the variable that makes the formula true. We can eliminate the quantifier by
substituting for the variable a reference to a function that produces the desired value. Since we do
not necessarily know how to produce the value, we must create a new function name for every
such replacement. We make no assertions about these functions except that they must exist.
CS8691-ARTIFICIAL INTELLIGENCE
ROHINI COLLEGE OF ENGINEERING AND TECHNOLOGY
So, for example, the formula
Ǝy : President(y) can be transformed into the formula President(S1)
Where, S1 is a function with no arguments that somehow produces a value that satisfies
President. If existential quantifiers occur within the scope of universal quantifiers, then the value
that satisfies the predicate may depend on the values of the universally quantified variables.
For example, in the formula ∀x: Ǝy: father-of(y, x)
The value of y that satisfies father-of depends on the particular value of x. Thus we must generate
functions with the same number of arguments as the number of universal quantifiers in whose
scope the expression occurs. So this example would be transformed into ∀x: father-of(S2(x), x)
These generated functions are called Skolem functions. Sometimes ones with no arguments are
called Skolem constants
6. Drop the prefix At this point, all remaining variables are universally quantified, so the prefix
can just be dropped and any proof procedure we use can simply assume that any variable it sees is
universally quantified.
Now the formula produced in step 4 appears as
[¬ Roman(x) V ¬ know(x, Marcus)] V [hate(x, Caesar) V (¬ hate(y, z) V thinkcrazy(x, y))]
7. Convert the matrix into a conjunction of disjuncts
In the case or our example, since there are no and’s, it is only necessary to exploit the associative
property of or [ i.e., (a ˅ (b ˅ c) = (a ˅ b ) vc] ˅ c)]
and simply remove the parentheses, giving
¬ Roman(x) V ¬ know(x, Marcus) V hate(x, Caesar) V ¬ hate(y, z) V thinkcrazy(x, y)
However, it is also frequently necessary to exploit the distributive property
[i.e. , (a ^ b) V c = (a V c) ˄ (b ˅ c)]. Example The formula
CS8691-ARTIFICIAL INTELLIGENCE
ROHINI COLLEGE OF ENGINEERING AND TECHNOLOGY
(winter ^ wearingboots) V (summer ^ wearingsandals) Becomes, after one application of the rule
[winter V (summer ^ wearingsandals)] ^ [wearingboots V (summer ^ wearingsandals)]
And then, after a second application, required since there are still conjuncts joined by OR’s,
(winter V summer) ^
(winter V wearingsandals) ^
(wearingboots V summer) ^
(wearingboots V wearingsandals)
8. Create a separate clause corresponding to each conjunct
In order for a wff to be true, all the clauses that are generated from it must be true.
9. Standardize apart the variables in the set of clauses generated in step 8.
By this we mean rename the variables so that no two clauses make reference to the same variable.
In making this transformation, we rely on the fact that
(∀x: P(x) ^ Q(x)) = ∀x: P(x) ^ ∀x: Q(x) Thus since each clause is a separate conjunct and since
all the variables are universally quantified, there need be no relationship between the variables of
two clauses, even if they were generated from the same wff.
Performing this final step of standardization is important because during the resolution procedure
it is sometimes necessary to instantiate a universally quantified variable (i.e., substitute for it a
particular value).
But, in general, we want to keep clauses in their most general form as long as possible. So when a
variable is instantiated, we want to know the minimum number of substitutions that must be made
to preserve the truth value of the system.
CS8691-ARTIFICIAL INTELLIGENCE