Unit 4 Logical Reasoning
Unit 4 Logical Reasoning
Substitution:
• Substitution is a fundamental operation performed on
terms and formulas. It occurs in all inference systems in
first-order logic. The substitution is complex in the
presence of quantifiers in FOL.
This rule can be used if we want to show that every element has a
similar property.
28
Forward Chaining Example
Missile(x) Owns(Nono,x)
Sells(West,x,Nono)
29
Forward Chaining Example
30
Backward Chaining
• Backward-chaining is also known as a backward
deduction or backward reasoning method
when using an inference engine.
• A backward chaining algorithm is a form of
reasoning, which starts with the goal and works
backward, chaining through rules to find known
facts that support the goal.
31
Properties of Backward Chaining
• It is known as a top-down approach.
• Backward-chaining is based on modus ponens inference
rule.
• In backward chaining, the goal is broken into sub-goal or
sub-goals to prove the facts true.
• It is called a goal-driven approach, as a list of goals
decides which rules are selected and used.
• Backward -chaining algorithm is used in game theory,
automated theorem proving tools, inference engines,
proof assistants, and various AI applications.
• The backward-chaining method mostly used a depth-first
search strategy for proof.
32
Backward Chaining Algorithm
Backward Chaining Example
34
Backward Chaining Example
35
Backward Chaining Example
36
Backward Chaining Example
37
Backward Chaining Example
38
Backward Chaining Example
39
About Backward Chaining
• Uses composition of substitutions
• A DFS algorithm
– Linear time
– Repeated states and incompleteness
40
Resolution
Missile(M1) ¬Missile(M1)∨¬Owns(Nono,M1)∨¬Hostile(Nono)
Owns(Nono,M1) ¬Owns(Nono,M1)∨¬Hostile(Nono)
Enemy(Nono,America) ¬Enemy(Nono,America)
A Resolution proof that West is a Criminal.
At each step, the literals that unify are in bold A Resolution proof that West is a Criminal
Example 2
Everyone who loves all animals is loved by
someone. Anyone who kills an animal is
loved by no one. Jack loves all animals. Either
Jack or Curiosity killed the cat, who is named
Tuna. Did Curiosity kill the cat?
First, we express the original sentences, some
background knowledge, and the negated goal G in first-
order logic
1) ∀x [∀y Animal(y) ⇒ Loves(x,y)] ⇒ [∃y Loves(y,x)]
2) ∀x [∃z Animal(z)∧Kills(x,z)] ⇒ [∀y ¬Loves(y,x)]
3) ∀x Animal(x) ⇒ Loves(Jack,x)
4) Kills(Jack,Tuna)∨Kills(Curiosity,Tuna)
5) Cat(Tuna)
6) ∀x Cat(x) ⇒ Animal(x)
7) ¬G. ¬Kills(Curiosity,Tuna)
Now we apply the conversion procedure to
convert each sentence to CNF:
1) Animal(F(x))∨Loves(G(x),x)
2) ¬Loves(x,F(x))∨Loves(G(x),x)
3) ¬Loves(y,x)∨ ¬Animal(z)∨ ¬Kills(x,z)
4) ¬Animal(x)∨Loves(Jack,x)
5) Kills(Jack,Tuna)∨Kills(Curiosity,Tuna)
6) Cat(Tuna)
7) ¬Cat(x)∨Animal(x)
8) ¬Kills(Curiosity,Tuna)
In English, the proof could be
paraphrased as follows:
Suppose Curiosity did not kill Tuna. We know
that either Jack or Curiosity did; thus Jack must
have. Now, Tuna is a cat and cats are animals, so
Tuna is an animal. Because anyone who kills an
animal is loved by no one, we know that no one
loves Jack. On the other hand, Jack loves all
animals, so someone loves him; so we have a
contradiction. Therefore, Curiosity killed the cat.
Resolution Tree