Professional Documents
Culture Documents
Inference in FOL: Ch-4-II
Inference in FOL: Ch-4-II
Ch-4-II
• It allows as to conclude that there is some element k for which P(k) is true when $x
P(x) is true
• For example, from $x Kill(x, Victim), we can infer Kill(Murderer, Victim), as long as
Murderer does not appear elsewhere in the knowledge base.
• From $x P(x) infer P(k).
Example: $x eats(Sol, x) infer eats(Sol, Cheese)
• Note that the variable x is replaced by a brand new constant (like Cheese)
that does not occur in this or any other sentence in the Knowledge Base.
• AsHighAs(Everest, Everest)
• AsHighAs(Kilimanjaro, Everest)
• AsHighAs(Kilimajaro, Everest) and AsHighAs(BenNevis,
Everest)
Example:
Bob is a buffalo. Pat is a pig. Buffaloes outrun pigs
Conclude: Bob outruns Pat
1. Buffalo(Bob)
2. Pig(Pat)
3. x,y Buffalo(x) ^ Pig(y) → Faster(x,y)
4. Buffalo(Bob) ^ Pig(Pat) And Introduction (1, 2)
5. Buffalo(Bob) ^ Pig(Pat) → Faster(Bob, Pat)
Universal Elimination (3, {x/Bob,y/Pat})
6. Faster(Bob,Pat) Modus Ponens (4, 5)
Unify is a linear time algorithm that returns the most general unifier, i.e., a shortest
length substitution list that makes the two literals match.
•A variable can never be replaced by a term containing that variable. For
example, x/f(x) is illegal.
•Unification and inference rules allows us to make inferences on a set of
logical assertions. To do this, the logical database must be expressed in an
appropriate form.
10/16/2021 Inference in FOL 15
Example of KB
• The law says that it is a crime for an American to sell weapons to hostile
nations. The country Nono, an enemy of America, has some missiles, and all
of its missiles were sold to it by Colonel West, who is American.
• Prove that Colonel West is a criminal (rules of KB)
• American(x): x is an American
• Weapon(x): x is a weapon
• Hostile(x): x is a hostile nation
• Criminal(x): x is a criminal
• Missile(x): x is a missile
• Owns(x, y): x owns y
• Sells(x, y, z): x sells y to z
• Enemy(x, y): x is an enemy of y
• Constants: America, Nono, West
• Given: Rich(ken)
Rich(x) v unhappy(x)
using θ = {x/ken}
we can conclude that:
unhappy(ken)
10/16/2021 Inference in FOL 36
Generalized Resolution
Query: ~Criminal(West)
10/16/2021 Inference in FOL 41
Resolution Graph Proof
Empty { }
10/16/2021 Inference in FOL 42
Resolution Refutation Proof
Practice exercise
• 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?
• FOL representation:
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)