chaining in first order logic

20
1 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

Upload: mabyn

Post on 14-Jan-2016

41 views

Category:

Documents


0 download

DESCRIPTION

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. Forward Chaining. Forward Chaining in PL extends to FOL A similar restriction applies to the KB Implications Atomic sentences - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Chaining in First Order Logic

1

Chaining in First Order Logic

CS 171/271(Chapter 9, continued)

Some text and images in these slides were drawn fromRussel & Norvig’s published material

Page 2: Chaining in First Order Logic

2

Forward Chaining Forward Chaining in PL extends to FOL A similar restriction applies to the KB

Implications Atomic sentences

KB can contain quantifiers Apply EI for existentially quantified sentences Allow variables for universally quantified

sentences (omit quantifier in such sentences)

Page 3: Chaining in First Order Logic

3

Knowledge Base Example 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

Page 4: Chaining in First Order Logic

4

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,M1) and Missile(M1)

… all of its missiles were sold to it by Colonel WestMissile(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)

Page 5: Chaining in First Order Logic

5

Forward Chaining Algorithm

Page 6: Chaining in First Order Logic

6

Forward Chaining Example

Page 7: Chaining in First Order Logic

7

Forward Chaining Example

Missile(x) Weapon(x)

Missile(x) Owns(Nono,x) Sells(West,x,Nono)

Enemy(x,America) Hostile(x)

Page 8: Chaining in First Order Logic

8

Forward Chaining Example

American(x) Weapon(y) Sells(x,y,z) Hostile(z) Criminal(x)

Page 9: Chaining in First Order Logic

9

About Forward Chaining Matching rules against known facts Incremental forward chaining Irrelevant facts

Page 10: Chaining in First Order Logic

10

Backward Chaining Begin with goal (query) Recursively build a set of

substitutions that satisfy the premises necessary to conclude goal

Page 11: Chaining in First Order Logic

11

Backward Chaining Algorithm

SUBST(COMPOSE(θ1, θ2), p) = SUBST(θ2, SUBST(θ1, p))

Page 12: Chaining in First Order Logic

12

Backward Chaining Example

Page 13: Chaining in First Order Logic

13

Backward Chaining Example

Page 14: Chaining in First Order Logic

14

Backward Chaining Example

Page 15: Chaining in First Order Logic

15

Backward Chaining Example

Page 16: Chaining in First Order Logic

16

Backward Chaining Example

Page 17: Chaining in First Order Logic

17

Backward Chaining Example

Page 18: Chaining in First Order Logic

18

Backward Chaining Example

Page 19: Chaining in First Order Logic

19

Backward Chaining Example

Page 20: Chaining in First Order Logic

20

About Backward Chaining Uses composition of substitutions A DFS algorithm

Linear time Repeated states and incompleteness