0% found this document useful (0 votes)
11 views

7_1-The-Resolution-Refutation-Method _Examples

lecture

Uploaded by

Nermeen Kamel
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

7_1-The-Resolution-Refutation-Method _Examples

lecture

Uploaded by

Nermeen Kamel
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 31

The Resolution Refutation Method

Examples
The Resolution

• Resolution is a theorem proving technique that proceeds by


building refutation proofs, i.e., proofs by contradictions. It was
invented by a Mathematician John Alan Robinson in the year 1965.
• Resolution is used, if there are various statements are given, and
we need to prove a conclusion of those statements. Unification is
a key concept in proofs by resolutions. Resolution is a single
inference rule which can efficiently operate on the conjunctive
normal form or clausal form.
• Clause: Disjunction of literals (an atomic sentence) is called a
clause. It is also known as a unit clause.
• Conjunctive Normal Form: A sentence represented as a
conjunction of clauses is said to be conjunctive normal form or
CNF.
The Resolution Inference Rule

• The resolution rule for first-order logic is simply a lifted


version of the propositional rule.
• Resolution can resolve two clauses if they contain
complementary literals, which are assumed to be
standardized apart so that they share no variables.

• Where li and mj are complementary literals.

• This rule is also called the binary resolution rule because


it only resolves exactly two literals.
The Resolution Inference Rule

• Example:
• We can resolve two clauses which are given below:

[Animal (g(x) V Loves (f(x), x)] and [ ¬ Loves(a, b) V ¬


Kills(a, b)]

• Where two complimentary literals are: Loves (f(x), x) and ¬


Loves (a, b)
• These literals can be unified with unifier θ= [a/f(x), and b/x] , and
it will generate a resolvent clause:

[Animal (g(x) V ¬ Kills(f(x), x)].


The Resolution Steps

• Conversion of facts into first-order logic.


• Convert FOL statements into CNF
• Negate the statement which needs to prove (proof
by contradiction)
• Draw resolution graph (unification).
Example

• Example:
John likes all kind of food.
Apple and vegetable are food
Anything anyone eats and not killed is food.
Anil eats peanuts and still alive
Harry eats everything that Anil eats.
Prove by resolution that:
John likes peanuts.
Example

• Step-1: Conversion of Facts into FOL


– In the first step we will convert all the given
statements into its first order logic.
Example:

• Step-2: Conversion of FOL into CNF


• In First order logic resolution, it is required to convert the FOL into
CNF as CNF form makes easier for resolution proofs.
Eliminate all implication (→) and rewrite
∀x ¬ food(x) V likes(John, x)
food(Apple) Λ food(vegetables)
∀x ∀y ¬ [eats(x, y) Λ ¬ killed(x)] V food(y)
eats (Anil, Peanuts) Λ alive(Anil)
∀x ¬ eats(Anil, x) V eats(Harry, x)
∀x¬ [¬ killed(x) ] V alive(x)
∀x ¬ alive(x) V ¬ killed(x)
likes(John, Peanuts).
Example:

• Move negation (¬)inwards and rewrite


∀x ¬ food(x) V likes(John, x)
food(Apple) Λ food(vegetables)
∀x ∀y ¬ eats(x, y) V killed(x) V food(y)
eats (Anil, Peanuts) Λ alive(Anil)
∀x ¬ eats(Anil, x) V eats(Harry, x)
∀x ¬killed(x) ] V alive(x)
∀x ¬ alive(x) V ¬ killed(x)
likes(John, Peanuts).
Example:

• Rename variables or standardize variables


∀x ¬ food(x) V likes(John, x)
food(Apple) Λ food(vegetables)
∀y ∀z ¬ eats(y, z) V killed(y) V food(z)
eats (Anil, Peanuts) Λ alive(Anil)
∀w¬ eats(Anil, w) V eats(Harry, w)
∀g ¬killed(g) ] V alive(g)
∀k ¬ alive(k) V ¬ killed(k)
likes(John, Peanuts).
Example:

• Eliminate existential instantiation quantifier by


elimination.
• In this step, we will eliminate existential quantifier
∃, and this process is known as Skolemization.
• But in this example problem since there is no
existential quantifier so all the statements will
remain same in this step.
Example:

• Drop Universal quantifiers.


• In this step we will drop all universal quantifier since all the statements
are not implicitly quantified so we don't need it.
¬ food(x) V likes(John, x)
food(Apple)
food(vegetables)
¬ eats(y, z) V killed(y) V food(z)
eats (Anil, Peanuts)
alive(Anil)
¬ eats(Anil, w) V eats(Harry, w)
killed(g) V alive(g)
¬ alive(k) V ¬ killed(k)
likes(John, Peanuts).
Example:

• Distribute conjunction ∧ over disjunction ¬.


• This step will not make any change in this problem.
Example:

• Step-3: Negate the statement to be proved


– In this statement, we will apply negation to the
conclusion statements, which will be written as
¬likes(John, Peanuts)
Example:

• Step-4: Draw Resolution graph:


• Now in this step, we will solve the problem by
resolution tree using substitution. For the above
problem, it will be given as follows:
Explanation of Resolution graph

• In the first step of resolution graph, ¬likes(John, Peanuts) , and


likes(John, x) get resolved(canceled) by substitution of {Peanuts/x},
and we are left with ¬ food(Peanuts)
• In the second step of the resolution graph, ¬ food(Peanuts) , and
food(z) get resolved (canceled) by substitution of { Peanuts/z}, and
we are left with ¬ eats(y, Peanuts) V killed(y) .
• In the third step of the resolution graph, ¬ eats(y, Peanuts) and eats
(Anil, Peanuts) get resolved by substitution {Anil/y}, and we are left
with Killed(Anil) .
• In the fourth step of the resolution graph, Killed(Anil) and ¬ killed(k)
get resolve by substitution {Anil/k}, and we are left with ¬ alive(Anil) .
• In the last step of the resolution graph ¬ alive(Anil) and alive(Anil) get
resolved.
Summary : Resolution Theorem Proving
(FOL)

• Convert everything to CNF


• Resolve, with unification
– Save bindings as you go!
• If resolution is successful, proof succeeds
• If there was a variable in the item to prove, return
variable’s value from unification bindings

17
Converting to CNF

18
Converting sentences to CNF
1. Eliminate all connectives
(P Q) ⇒ ((P → Q) ^ (Q → P))
2. Eliminate all → connectives
(P → Q) ⇒ (¬P ∨ Q)
3. Reduce the scope of each negation symbol to a single predicate
¬¬P ⇒ P
¬(P ∨ Q) ⇒ ¬P ∧ ¬Q
¬(P ∧ Q) ⇒ ¬P ∨ ¬Q
¬(∀x)P ⇒ (∃x)¬P
¬(∃x)P ⇒ (∀x)¬P
4. Standardize variables: rename all variables so that each quantifier
has its own unique variable name

19
Converting sentences to clausal form: Skolem
constants and functions
5. Eliminate existential quantification by introducing Skolem
constants/functions
(∃x)P(x) ⇒ P(c)
c is a Skolem constant (a brand-new constant symbol that is not used
in any other sentence)
(∀x)(∃y)P(x,y) becomes (∀x)P(x, F(x))
since ∃ is within the scope of a universally quantified variable, use a
Skolem function F to construct a new value that depends on the
universally quantified variable
f must be a brand-new function name not occurring in any other sentence
in the KB.
E.g., (∀x)(∃y)loves(x,y) becomes (∀x)loves(x,F(x))
In this case, F(x) specifies the person that x loves
E.g., ∀x1 ∀x2 ∀x3 ∃y P(… y …) becomes
∀x1 ∀x2 ∀x3 P(… FF(x1,x2,x3) …) (FF is a new name)

20
Converting sentences to clausal form
6. Remove universal quantifiers by (1) moving them all to the
left end; (2) making the scope of each the entire sentence;
and (3) dropping the “prefix” part
Ex: (∀x)P(x) ⇒ P(x)
7. Put into conjunctive normal form (conjunction of
disjunctions) using distributive and associative laws
(P ∧ Q) ∨ R ⇒ (P ∨ R) ∧ (Q ∨ R)
(P ∨ Q) ∨ R ⇒ (P ∨ Q ∨ R)
8. Split conjuncts into separate clauses
9. Standardize variables so each clause contains only variable
names that do not occur in any other clause

21
An example
(∀x)(P(x) → ((∀y)(P(y) → P(F(x,y))) ∧ ¬(∀y)(Q(x,y) → P(y))))
2. Eliminate →
(∀x)(¬P(x) ∨ ((∀y)(¬P(y) ∨ P(F(x,y))) ∧ ¬(∀y)(¬Q(x,y) ∨ P(y))))
3. Reduce scope of negation
(∀x)(¬P(x) ∨ ((∀y)(¬P(y) ∨ P(F(x,y))) ∧(∃y)(Q(x,y) ∧ ¬P(y))))
4. Standardize variables
(∀x)(¬P(x) ∨ ((∀y)(¬P(y) ∨ P(F(x,y))) ∧(∃z)(Q(x,z) ∧ ¬P(z))))
5. Eliminate existential quantification
(∀x)(¬P(x) ∨((∀y)(¬P(y) ∨ P(F(x,y))) ∧(Q(x,G(x)) ∧ ¬P(G(x)))))
6. Drop universal quantification symbols
(¬P(x) ∨ ((¬P(y) ∨ P(F(x,y))) ∧(Q(x,G(x)) ∧ ¬P(G(x)))))

22
An Example
7. Convert to conjunction of disjunctions
(¬P(x) ∨ ¬P(y) ∨ P(F(x,y))) ∧ (¬P(x) ∨ Q(x,G(x))) ∧
(¬P(x) ∨ ¬P(G(x)))
8. Create separate clauses
¬P(x) ∨ ¬P(y) ∨ P(F(x,y))
¬P(x) ∨ Q(x,G(x))
¬P(x) ∨ ¬P(G(x))
9. Standardize variables
¬P(x) ∨ ¬P(y) ∨ P(F(x,y))
¬P(z) ∨ Q(z,G(z))
¬P(w) ∨ ¬P(G(w))

Note: Now that quantifiers are gone, we do need the upper/lower-case


distinction

23
1. all X (read (X) --> literate (X))
2. all X (dolphin (X) --> ~literate (X))
3. exists X (dolphin (X) ^ intelligent (X))
(a translation of ``Some dolphins are intelligent'')

``Are there some who are intelligent but cannot read?''


4. exists X (intelligent(X) ^ ~read (X))

Set of clauses (1-3):


1. ~read(X) v literate(X)
2. ~dolphin(Y) v ~literate(Y)
3a. dolphin (a)
3b. intelligent (a)

Negation of 4:
~(exists Z (intelligent(Z) ^ ~read (Z)))
In Clausal form:
~intelligent(Z) v read(Z)
Resolution proof: in lecture. 24
More complicated example
Did Curiosity kill the cat
• Jack owns a dog. Every dog owner is an animal lover. No
animal lover kills an animal. Either Jack or Curiosity killed the
cat, who is named Tuna. Did Curiosity kill the cat?
• These can be represented as follows:
A. (∃x) (Dog(x) ∧ Owns(Jack,x))
B. (∀x) (((∃y) (Dog(y) ∧ Owns(x, y))) → AnimalLover(x))
C. (∀x) (AnimalLover(x) → ((∀y) Animal(y) → ¬Kills(x,y)))
D. Kills(Jack,Tuna) ∨ Kills(Curiosity,Tuna)
E. Cat(Tuna)
F. (∀x) (Cat(x) → Animal(x) )
G. Kills(Curiosity, Tuna) GOAL

25
• Convert to clause form
A1. (Dog(D)) D is a skolem constant
A2. (Owns(Jack,D))
B. (¬Dog(y), ¬Owns(x, y), AnimalLover(x))
C. (¬AnimalLover(a), ¬Animal(b), ¬Kills(a,b))
D. (Kills(Jack,Tuna), Kills(Curiosity,Tuna))
E. Cat(Tuna)
F. (¬Cat(z), Animal(z))
• Add the negation of query:
¬G: (¬Kills(Curiosity, Tuna))

26
• The resolution refutation proof
R1: ¬G, D, {} (Kills(Jack, Tuna))
R2: R1, C, {a/Jack, b/Tuna} (~AnimalLover(Jack),
~Animal(Tuna))
R3: R2, B, {x/Jack} (~Dog(y), ~Owns(Jack, y),
~Animal(Tuna))
R4: R3, A1, {y/D} (~Owns(Jack, D),
~Animal(Tuna))
R5: R4, A2, {} (~Animal(Tuna))
R6: R5, F, {z/Tuna} (~Cat(Tuna))
R7: R6, E, {} FALSE

27
• The proof tree

¬G D
{}
R1: K(J,T) C
{a/J,b/T}
R2: ¬AL(J) ∨ ¬A(T) B
{x/J}
R3: ¬D(y) ∨ ¬O(J,y) ∨ ¬A(T) A1
{y/D}
R4: ¬O(J,D), ¬A(T) A2
{}
R5: ¬A(T) F

{z/T}
R6: ¬C(T) A
{}
R7: FALSE 28
Decidability and Completeness

• Resolution is a refutation complete inference procedure for


First-Order Logic
– If a set of sentences contains a contradiction, then a
finite sequence of resolutions will prove this.
– If not, resolution may loop forever (“semi-decidable”)
• Here are notes by Charles Elkan that go into this more
deeply

29
Decidability and Completeness

• Refutation Completeness: If KB |= A then KB |- A


– If it’s entailed, then there’s a proof
• Semi-decidable:
– If there’s a proof, we’ll halt with it.
– If not, maybe halt, maybe not
• Logical entailment in FOL is semi-decidable: if the desired
conclusion follows from the premises, then eventually
resolution refutation will find a contradiction

30
Decidability and Completeness

• Propositional logic
– logical entailment is decidable
– There exists a complete inference procedure
• First-Order logic
– logical entailment is semi-decidable
– Resolution procedure is refutation complete

You might also like