JU Ch8
JU Ch8
JU Ch8
(Comp551)
1
JIMMA UNIVERSITY
JIMMA INSTITUTE OF TECHNOLOGY
DEPARTMENT OF COMPUTING
CHAPTER EIGHT
INFERENCE IN FIRST-ORDER LOGIC
Topics we will cover
2
For example, if the KB contains the symbols Kenenisa, Derartu and Haile,
then the sentence,
Yields:
Fast(Kenenisa) Strong (Kenenisa) EthiopianRunner (Kenenisa)
Fast(Derartu) Strong (Derartu) EthiopianRunner (Derartu)
Fast(Haile) Strong (Haile) EthiopianRunner (Haile).
Converting FOL to Propositional Logic (2)
4
θ = {x/Kenenisa,y/Kenenisa} works
p q θ
Likes(Andy,x) Likes(Andy,Injera) {x/Injera}
For Example:
“The law says that it is a crime for all 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.”
Show that Colonel West is a criminal.
Prove that Nono, an enemy/hostile of America.
FOL:
Example knowledge base
12
Missile(y) Weapon(y)
Backward chaining example (5)
21
Missile(M1)
Backward chaining example (6)
22
Q2. State what steps will be involved in applying the forward chaining
algorithm to this KB?
Q3. State what steps will be involved in applying the backward chaining
algorithm to this KB to infer the goal Winner(Kenenisa)?
Logic Programming: Prolog (1)
26
Prolog:
criminal(X) :- american(X),weapon(Y),sells(X,Y,Z),hostile(Z).
Logic Programming: Prolog (2)
27
Objects:
Like variables in FOL, represented by identifiers starting
with lower-case letter, e.g. american, west
Variables:
Identifiers starting with upper-case letters, e.g. X,Y,Z…
Prolog will try to instantiate the variable to an object.
Anonymous variables: we don’t care what the value is
Represented by underscore symbol( _ )
For Example.
The simplest way of describing the world is by stating facts
and rules, like this one:
Logic Programming: Prolog Program Examples (3)
28
Knowledge Base:
likes(tsega,Food) :- ethiopian(Food).
ethiopian(injera).
ethiopian(firfir).
FOL Inference:
Reduce FOL to Propositional Logic, then apply resolution.
Use Unification & Generalised Modus Ponens, then apply
backward/forward chaining.
Logic Programming
Prolog (& others) are FOL inference engines.