Lec13 Fol
Lec13 Fol
SUBST({v/g},P)
• Example:
p1' is King(John) p1 is King(x)
p2' is Greedy(y) p2 is Greedy(x)
θ is {x/John,y/John}
q is Evil(x)
SUBST(θ,q) is Evil(John)
Unification
UNIFY(α,β) = θ means that SUBST(θ, α) = SUBST(θ, β)
p q θ
Knows(John,x) Knows(John,Jane) {x/Jane}
Knows(John,x) Knows(y,Mary) {x/Mary, y/John}
Knows(John,x) Knows(y,Mother(y)) {y/John, x/Mother(John)}
Knows(John,x) Knows(x,Mary) {x1/John, x2/Mary}
Knows(John,x) Knows(y,z) {y/John, x/z}
• Forward chaining
– Like search: keep proving new things and adding them to
the KB until we can prove q
• Backward chaining
– Find p1, …, pn such that knowing them would prove q
– Recursively try to prove p1, …, pn
Example knowledge base
• 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.
• For example,
Rich(x) Unhappy(x)
Rich(Ken)
Unhappy(Ken)
with θ = {x/Ken}