Chaining in First Order Logic CS 171271 Chapter




















- Slides: 20
Chaining in First Order Logic CS 171/271 (Chapter 9, continued) Some text and images in these slides were drawn from Russel & Norvig’s published material 1
Forward Chaining n n Forward Chaining in PL extends to FOL A similar restriction applies to the KB n n n Implications Atomic sentences KB can contain quantifiers n n Apply EI for existentially quantified sentences Allow variables for universally quantified sentences (omit quantifier in such sentences) 2
Knowledge Base Example n n 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 3
Knowledge Base Example. . . it is a crime for an American to sell weapons to hostile nations: American(x) Weapon(y) Sells(x, y, z) Hostile(z) Criminal(x) Nono … has some missiles, i. e. , x Owns(Nono, x) Missile(x): Owns(Nono, M 1) and Missile(M 1) … all of its missiles were sold to it by Colonel West Missile(x) Owns(Nono, x) Sells(West, x, Nono) Missiles are weapons: Missile(x) Weapon(x) An enemy of America counts as "hostile“: Enemy(x, America) Hostile(x) West, who is American … American(West) The country Nono, an enemy of America … Enemy(Nono, America) 4
Forward Chaining Algorithm 5
Forward Chaining Example 6
Forward Chaining Example Missile(x) Weapon(x) Enemy(x, America) Hostile(x) Missile(x) Owns(Nono, x) Sells(West, x, Nono) 7
Forward Chaining Example American(x) Weapon(y) Sells(x, y, z) Hostile(z) Criminal(x) 8
About Forward Chaining n n n Matching rules against known facts Incremental forward chaining Irrelevant facts 9
Backward Chaining n n Begin with goal (query) Recursively build a set of substitutions that satisfy the premises necessary to conclude goal 10
Backward Chaining Algorithm SUBST(COMPOSE(θ 1, θ 2), p) = SUBST(θ 2, SUBST(θ 1, p)) 11
Backward Chaining Example 12
Backward Chaining Example 13
Backward Chaining Example 14
Backward Chaining Example 15
Backward Chaining Example 16
Backward Chaining Example 17
Backward Chaining Example 18
Backward Chaining Example 19
About Backward Chaining n n Uses composition of substitutions A DFS algorithm n n Linear time Repeated states and incompleteness 20