You are on page 1of 21

Example of Resolution for Propositional Logic

Example of Resolution for Propositional Logic


Unification
• In propositional logic it is easy to determine that two literals can not
both be true at the same time. Simply look for L and ~L . In predicate
logic, this matching process is more complicated, since bindings of
variables must be considered.

• In order to determine contradictions we need a matching procedure


that compares two literals and discovers whether there exist a set of
substitutions that makes them identical. There is a recursive
procedure that does this matching . It is called Unification.
Unification
1. The basic idea of unification is very simple.
• To attempt to unify two literals, first we check if their initial predicate
symbols are the same. If so, we can proceed. Otherwise, there is no way they
can be unified, regardless of their arguments. For example, the two literals
– tryassassinate (Marcus, Caesar)
– hate (Marcus, Caesar)
cannot be unified
• If the predicate symbols match, then we must check the arguments, one pair
at a time. If the first matches, we can continue with the second, and so on.
Unification
We need procedure that does two things given a sentence S and a term T:
•Determine whether T matches some term T´ in S, and
•Return a substitution that can be applied to the remainder of S.
Example:
S: x,y In(x, y)  Climate(y, moderate)  Climate(x, moderate)
T: In(Italy, Europe)
The process we will call unification will determine that T matches the first term of S
and it will return the substitution Italy/x, Europe/y. When we apply that to the
remainder of S, we have:

Climate(Europe, moderate)  Climate(Italy, moderate)


Unification
For example we can have literals as:
Unification
Reasoning
Example of Resolution in Predicate Logic
(Marcus Hates Caesar)

Given: In FOPL(First Order Predicate Logic):


Example of Resolution in Predicate Logic
(Marcus Hates Caesar)

In Predicate Logic After Converting CNF


Example of Resolution in Predicate Logic
(Marcus Hates Caesar)

• You have to prove that Marcus hates Caesar.


• So, start with hate (Marcus, Caesar)
Resolution Proof
(Marcus Hates Caesar)
Example of Resolution in Predicate Logic
(Leonardo was a painter who lived in a moderate climate)

Painter(Leonardo)
Composer (Palistrina)
Country(Italy)
Lived-In(Leonardo, Italy)
In(Italy, Europe)
Climate(Europe, moderate)
Painter(Rubens)
Lived-In(Rubens, Europe)
x,y (In(x, y)  Climate(y, moderate)  Climate(x, moderate))

Construct an existence statement to be proved:

Prove: y (Painter(Leonardo)  Lived-In(Leonardo, y)  Climate(y, moderate))

Negate it: (y (Painter(Leonardo)  Lived-In(Leonardo, y)  Climate(y, moderate)))


Example of Resolution in Predicate Logic
(Leonardo was a painter who lived in a moderate climate)

Painter(Leonardo)
Composer(Palistrina)
Country(Italy)
Lived-In(Leonardo, Italy)
In(Italy,Europe)
Climate(Europe, moderate)
Painter(Rubens)
Lived-In(Rubens, Europe)

x,y (In(x, y)  Climate(y, moderate)  Climate(x, moderate))


 In(x, y)   Climate(y, moderate)  Climate(x, moderate)

(y (Painter(Leonardo)  Lived-In(Leonardo,y)  Climate(y, moderate)))


y ((Painter(Leonardo)  Lived-In(Leonardo,y)  Climate(y, moderate)))

Painter(Leonardo)   Lived-In(Leonardo,y)   Climate(y, moderate)


Example of Resolution in Predicate Logic
(Leonardo was a painter who lived in a moderate climate)
1. Painter(Leonardo) 2. Composer(Palistrina)
3. Country(Italy) 4. Lived-In(Leonardo, Italy)
5. In(Italy,Europe) 6. Climate(Europe, moderate)
7. Painter(Rubens) 8. Lived-In(Rubens, Europe)
9. Painter(Sargent)
10.  In(x, y)   Climate(y, moderate)  Climate(x, moderate)
Painter(Leonardo)   Lived-In(Leonardo,y)   Climate(y, moderate) Painter(Leonardo)

Lived-In(Leonardo, Italy)  Lived-In(Leonardo,y)   Climate(y, moderate)

Italy/y
 In(x, y)   Climate(y, moderate)Climate(x, moderate)  Climate(Italy, moderate)

Italy/x
In(Italy,Europe)  In(Italy, y)   Climate(y, moderate)

Europe/y
Climate(Europe, moderate)  Climate(Europe, moderate)
Does Isaac Know Marcus?
Given:
x [Roman(x)  know(x, Marcus)]  [hate(x, Caesar)  (y (z hate(y, z))  thinkcrazy(x, y))]

1. Roman(x)   know(x, Marcus)  hate(x, Caesar)   hate(y, z)  thinkcrazy(x, y)


2. Roman(Isaac)
3. hate(Isaac, Caesar)
4. hate(Paulus, Marcus)
5. thinkcrazy (Isaac, Paulus)

Prove:
know(Isaac, Marcus) * know(Isaac, Marcus)
Does Isaac Know Marcus?
• With 1 (Isaac/x) gives ** Roman(Isaac)  hate(Isaac, Caesar) 
 hate(y, z)  thinkcrazy (Isaac, y)
• With 2 gives hate(Isaac, Caesar)   hate(y, z)  thinkcrazy (Isaac, y)
• With 3 gives  hate(y, z)  thinkcrazy(Isaac, y)
• With 5 (Paulus/y) gives  hate(Paulus, z)
• With 4 (Marcus/z) gives nil
Example of Resolution in Predicate Logic
(John Likes Peanuts)
Example of Resolution in Predicate Logic
(John Likes Peanuts)

We add the negation of the sentence “John likes peanuts”, we have to


prove:
~ likes (John, peanuts)
Resolution Proof
(John Likes Peanuts)

You might also like