Top Banner
CPSC 433 Artificial Intelligence And-Tree Search Modeling Example – Model Elimination CPSC 433 T01 & T02 Andrew Kuipers
37

CPSC 433 Artificial Intelligence And-Tree Search Modeling Example – Model Elimination CPSC 433 T01 & T02 Andrew Kuipers.

Dec 19, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: CPSC 433 Artificial Intelligence And-Tree Search Modeling Example – Model Elimination CPSC 433 T01 & T02 Andrew Kuipers.

CPSC 433 Artificial Intelligence

And-Tree Search ModelingExample – Model Elimination

CPSC 433

T01 & T02

Andrew Kuipers

Page 2: CPSC 433 Artificial Intelligence And-Tree Search Modeling Example – Model Elimination CPSC 433 T01 & T02 Andrew Kuipers.

CPSC 433 Artificial Intelligence

The Formal Model

C – the set of all clauses (our formal language)

Prob,me 2C

Solution Definition

Erw,me((pr, ?), (pr, yes)) if P,P’pr, where = mgu(P,P’)

Branching Definition

Erw,me((pr0,?),(pr0,?,pr1,…,prn))

where pr0 = Q {L1…Ln} and pri = Q {L1…Ln, Li}, 1 i n

and for some j s.t 1 j n : Erw,me((prj, ?), (prj, yes))

Page 3: CPSC 433 Artificial Intelligence And-Tree Search Modeling Example – Model Elimination CPSC 433 T01 & T02 Andrew Kuipers.

CPSC 433 Artificial Intelligence

A Propositional Example1) r p s2) s q3) p s4) s5) s p6) p r

{ },?

Page 4: CPSC 433 Artificial Intelligence And-Tree Search Modeling Example – Model Elimination CPSC 433 T01 & T02 Andrew Kuipers.

CPSC 433 Artificial Intelligence

A Propositional Example1) r p s2) s q3) p s4) s5) s p6) p r

{ },?

Page 5: CPSC 433 Artificial Intelligence And-Tree Search Modeling Example – Model Elimination CPSC 433 T01 & T02 Andrew Kuipers.

CPSC 433 Artificial Intelligence

A Propositional Example1) r p s2) s q3) p s4) s5) s p6) p r

{ },?

Page 6: CPSC 433 Artificial Intelligence And-Tree Search Modeling Example – Model Elimination CPSC 433 T01 & T02 Andrew Kuipers.

CPSC 433 Artificial Intelligence

A Propositional Example1) r p s2) s q3) p s4) s5) s p6) p r

{ },?

{p},? {s},?

3

Page 7: CPSC 433 Artificial Intelligence And-Tree Search Modeling Example – Model Elimination CPSC 433 T01 & T02 Andrew Kuipers.

CPSC 433 Artificial Intelligence

A Propositional Example1) r p s2) s q3) p s4) s5) s p6) p r

{ },?

{p},? {s},?

3

Page 8: CPSC 433 Artificial Intelligence And-Tree Search Modeling Example – Model Elimination CPSC 433 T01 & T02 Andrew Kuipers.

CPSC 433 Artificial Intelligence

A Propositional Example1) r p s2) s q3) p s4) s5) s p6) p r

{ },?

{p},? {s},?

3

Page 9: CPSC 433 Artificial Intelligence And-Tree Search Modeling Example – Model Elimination CPSC 433 T01 & T02 Andrew Kuipers.

CPSC 433 Artificial Intelligence

A Propositional Example1) r p s2) s q3) p s4) s5) s p6) p r

{ },?

{p},? {s},?

3

{p,p},? {p,r},?

6

Page 10: CPSC 433 Artificial Intelligence And-Tree Search Modeling Example – Model Elimination CPSC 433 T01 & T02 Andrew Kuipers.

CPSC 433 Artificial Intelligence

A Propositional Example1) r p s2) s q3) p s4) s5) s p6) p r

{ },?

{p},? {s},?

3

{p,p},? {p,r},?

6

Page 11: CPSC 433 Artificial Intelligence And-Tree Search Modeling Example – Model Elimination CPSC 433 T01 & T02 Andrew Kuipers.

CPSC 433 Artificial Intelligence

A Propositional Example1) r p s2) s q3) p s4) s5) s p6) p r

{ },?

{p},? {s},?

3

{p,p},y {p,r},?

6

Page 12: CPSC 433 Artificial Intelligence And-Tree Search Modeling Example – Model Elimination CPSC 433 T01 & T02 Andrew Kuipers.

CPSC 433 Artificial Intelligence

A Propositional Example1) r p s2) s q3) p s4) s5) s p6) p r

{ },?

{p},? {s},?

3

{p,p},y {p,r},?

6

Page 13: CPSC 433 Artificial Intelligence And-Tree Search Modeling Example – Model Elimination CPSC 433 T01 & T02 Andrew Kuipers.

CPSC 433 Artificial Intelligence

A Propositional Example1) r p s2) s q3) p s4) s5) s p6) p r

{ },?

{p},? {s},?

3

{p,p},y {p,r},?

6

{s,s},?

4

Page 14: CPSC 433 Artificial Intelligence And-Tree Search Modeling Example – Model Elimination CPSC 433 T01 & T02 Andrew Kuipers.

CPSC 433 Artificial Intelligence

A Propositional Example1) r p s2) s q3) p s4) s5) s p6) p r

{ },?

{p},? {s},?

3

{p,p},y {p,r},?

6

{s,s},y

4

Page 15: CPSC 433 Artificial Intelligence And-Tree Search Modeling Example – Model Elimination CPSC 433 T01 & T02 Andrew Kuipers.

CPSC 433 Artificial Intelligence

A Propositional Example1) r p s2) s q3) p s4) s5) s p6) p r

{ },?

{p},? {s},?

3

{p,p},y {p,r},?

6

{s,s},y

4

Page 16: CPSC 433 Artificial Intelligence And-Tree Search Modeling Example – Model Elimination CPSC 433 T01 & T02 Andrew Kuipers.

CPSC 433 Artificial Intelligence

A Propositional Example1) r p s2) s q3) p s4) s5) s p6) p r

{ },?

{p},? {s},?

3

{p,p},y {p,r},?

6

{s,s},y

4

{p,r,r},? {p,r,p},? {p,r,s},?

1

Page 17: CPSC 433 Artificial Intelligence And-Tree Search Modeling Example – Model Elimination CPSC 433 T01 & T02 Andrew Kuipers.

CPSC 433 Artificial Intelligence

A Propositional Example1) r p s2) s q3) p s4) s5) s p6) p r

{ },?

{p},? {s},?

3

{p,p},y {p,r},?

6

{s,s},y

4

{p,r,r},y {p,r,p},? {p,r,s},?

1

Page 18: CPSC 433 Artificial Intelligence And-Tree Search Modeling Example – Model Elimination CPSC 433 T01 & T02 Andrew Kuipers.

CPSC 433 Artificial Intelligence

A Propositional Example1) r p s2) s q3) p s4) s5) s p6) p r

{ },?

{p},? {s},?

3

{p,p},y {p,r},?

6

{s,s},y

4

{p,r,r},y {p,r,p},y {p,r,s},?

1

Page 19: CPSC 433 Artificial Intelligence And-Tree Search Modeling Example – Model Elimination CPSC 433 T01 & T02 Andrew Kuipers.

CPSC 433 Artificial Intelligence

A Propositional Example1) r p s2) s q3) p s4) s5) s p6) p r

{ },?

{p},? {s},?

{p,p},y {p,r},? {s,s},y

{p,r,r},y {p,r,p},y {p,r,s},?

3

6 4

1

Page 20: CPSC 433 Artificial Intelligence And-Tree Search Modeling Example – Model Elimination CPSC 433 T01 & T02 Andrew Kuipers.

CPSC 433 Artificial Intelligence

A Propositional Example1) r p s2) s q3) p s4) s5) s p6) p r

{ },?

{p},? {s},?

{p,p},y {p,r},? {s,s},y

{p,r,r},y {p,r,p},y {p,r,s},?

{p,r,s,s},?

3

6 4

1

4

Page 21: CPSC 433 Artificial Intelligence And-Tree Search Modeling Example – Model Elimination CPSC 433 T01 & T02 Andrew Kuipers.

CPSC 433 Artificial Intelligence

A Propositional Example1) r p s2) s q3) p s4) s5) s p6) p r

{ },?

{p},? {s},?

{p,p},y {p,r},? {s,s},y

{p,r,r},y {p,r,p},y {p,r,s},?

{p,r,s,s},y

3

6 4

1

4

Page 22: CPSC 433 Artificial Intelligence And-Tree Search Modeling Example – Model Elimination CPSC 433 T01 & T02 Andrew Kuipers.

CPSC 433 Artificial Intelligence

A Propositional Example1) r p s2) s q3) p s4) s5) s p6) p r

{ },?

{p},? {s},?

{p,p},y {p,r},? {s,s},y

{p,r,r},y {p,r,p},y {p,r,s},?

{p,r,s,s},y

3

6 4

1

4

search complete!

Page 23: CPSC 433 Artificial Intelligence And-Tree Search Modeling Example – Model Elimination CPSC 433 T01 & T02 Andrew Kuipers.

CPSC 433 Artificial Intelligence

A First-Order Example1) P(x) Q(y) R(x)2) P(a)3) P(z) Q(z)4) Q(a)5) Q(b)6) R(b)

{ }, ?

= { }

Page 24: CPSC 433 Artificial Intelligence And-Tree Search Modeling Example – Model Elimination CPSC 433 T01 & T02 Andrew Kuipers.

CPSC 433 Artificial Intelligence

A First-Order Example1) P(x) Q(y) R(x)2) P(a)3) P(z) Q(z)4) Q(a)5) Q(b)6) R(b)

= { }

{P(z)},? {Q(z)},?

3

{ }, ?

Page 25: CPSC 433 Artificial Intelligence And-Tree Search Modeling Example – Model Elimination CPSC 433 T01 & T02 Andrew Kuipers.

CPSC 433 Artificial Intelligence

A First-Order Example1) P(x) Q(y) R(x)2) P(a)3) P(z) Q(z)4) Q(a)5) Q(b)6) R(b)

= { }

{P(z)},? {Q(z)},?

3

{P(z),P(x)},? {P(z),Q(y)},? {P(z),R(x)},?

1

{ }, ?

Page 26: CPSC 433 Artificial Intelligence And-Tree Search Modeling Example – Model Elimination CPSC 433 T01 & T02 Andrew Kuipers.

CPSC 433 Artificial Intelligence

A First-Order Example1) P(x) Q(y) R(x)2) P(a)3) P(z) Q(z)4) Q(a)5) Q(b)6) R(b)

= { z x }

{P(z)},? {Q(z)},?

3

{P(z),P(x)},y {P(z),Q(y)},? {P(z),R(x)},?

1

{ }, ?

Page 27: CPSC 433 Artificial Intelligence And-Tree Search Modeling Example – Model Elimination CPSC 433 T01 & T02 Andrew Kuipers.

CPSC 433 Artificial Intelligence

A First-Order Example1) P(x) Q(y) R(x)2) P(a)3) P(z) Q(z)4) Q(a)5) Q(b)6) R(b)

= { z x }

{P(z)},? {Q(z)},?

3

{P(z),P(x)},y {P(z),Q(y)},? {P(z),R(x)},?

1

{P(z),Q(y),Q(b)},?

5

{ }, ?

Page 28: CPSC 433 Artificial Intelligence And-Tree Search Modeling Example – Model Elimination CPSC 433 T01 & T02 Andrew Kuipers.

CPSC 433 Artificial Intelligence

A First-Order Example1) P(x) Q(y) R(x)2) P(a)3) P(z) Q(z)4) Q(a)5) Q(b)6) R(b)

= { z x, y b }

{P(z)},? {Q(z)},?

3

{P(z),P(x)},y {P(z),Q(y)},? {P(z),R(x)},?

1

{P(z),Q(y),Q(b)},y

5

{ }, ?

Page 29: CPSC 433 Artificial Intelligence And-Tree Search Modeling Example – Model Elimination CPSC 433 T01 & T02 Andrew Kuipers.

CPSC 433 Artificial Intelligence

A First-Order Example1) P(x) Q(y) R(x)2) P(a)3) P(z) Q(z)4) Q(a)5) Q(b)6) R(b)

= { z x, y b }

{P(z)},? {Q(z)},?

3

{P(z),P(x)},y {P(z),Q(y)},? {P(z),R(x)},?

1

{P(z),Q(y),Q(b)},y

5

{P(z),R(x),R(b)},?

6

{ }, ?

Page 30: CPSC 433 Artificial Intelligence And-Tree Search Modeling Example – Model Elimination CPSC 433 T01 & T02 Andrew Kuipers.

CPSC 433 Artificial Intelligence

A First-Order Example1) P(x) Q(y) R(x)2) P(a)3) P(z) Q(z)4) Q(a)5) Q(b)6) R(b)

= { z x, y b, x b }

{P(z)},? {Q(z)},?

3

{P(z),P(x)},y {P(z),Q(y)},? {P(z),R(x)},?

1

{P(z),Q(y),Q(b)},y

5

{P(z),R(x),R(b)},y

6

{ }, ?

Page 31: CPSC 433 Artificial Intelligence And-Tree Search Modeling Example – Model Elimination CPSC 433 T01 & T02 Andrew Kuipers.

CPSC 433 Artificial Intelligence

A First-Order Example1) P(x) Q(y) R(x)2) P(a)3) P(z) Q(z)4) Q(a)5) Q(b)6) R(b)

= { z b, y b, x b }

{P(z)},? {Q(z)},?

3

{P(z),P(x)},y {P(z),Q(y)},? {P(z),R(x)},?

1

{P(z),Q(y),Q(b)},y

5

{P(z),R(x),R(b)},y

6

substitute!

{ }, ?

Page 32: CPSC 433 Artificial Intelligence And-Tree Search Modeling Example – Model Elimination CPSC 433 T01 & T02 Andrew Kuipers.

CPSC 433 Artificial Intelligence

A First-Order Example1) P(x) Q(y) R(x)2) P(a)3) P(z) Q(z)4) Q(a)5) Q(b)6) R(b)

= { z b, y b, x b }

{P(z)},? {Q(z)},?

3

{P(z),P(x)},y {P(z),Q(y)},? {P(z),R(x)},?

1

{P(z),Q(y),Q(b)},y

5

{P(z),R(x),R(b)},y

6

{Q(z),Q(a)},?

4

{ }, ?

Page 33: CPSC 433 Artificial Intelligence And-Tree Search Modeling Example – Model Elimination CPSC 433 T01 & T02 Andrew Kuipers.

CPSC 433 Artificial Intelligence

A First-Order Example1) P(x) Q(y) R(x)2) P(a)3) P(z) Q(z)4) Q(a)5) Q(b)6) R(b)

= { z b, y b, x b }

{P(z)},? {Q(z)},?

3

{P(z),P(x)},y {P(z),Q(y)},? {P(z),R(x)},?

1

{P(z),Q(y),Q(b)},y

5

{P(z),R(x),R(b)},y

6

{Q(z),Q(a)},?

4

can’t add z a!

{ }, ?

Page 34: CPSC 433 Artificial Intelligence And-Tree Search Modeling Example – Model Elimination CPSC 433 T01 & T02 Andrew Kuipers.

CPSC 433 Artificial Intelligence

A First-Order Example1) P(x) Q(y) R(x)2) P(a)3) P(z) Q(z)4) Q(a)5) Q(b)6) R(b)

= { z b, y b, x b }

{P(z)},? {Q(z)},?

3

{P(z),P(x)},y {P(z),Q(y)},? {P(z),R(x)},?

1

{P(z),Q(y),Q(b)},y

5

{P(z),R(x),R(b)},y

6

backtrack!

{ }, ?

Page 35: CPSC 433 Artificial Intelligence And-Tree Search Modeling Example – Model Elimination CPSC 433 T01 & T02 Andrew Kuipers.

CPSC 433 Artificial Intelligence

A First-Order Example1) P(x) Q(y) R(x)2) P(a)3) P(z) Q(z)4) Q(a)5) Q(b)6) R(b)

= { z b, y b, x b }

{P(z)},? {Q(z)},?

3

{P(z),P(x)},y {P(z),Q(y)},? {P(z),R(x)},?

1

{P(z),Q(y),Q(b)},y

5

{P(z),R(x),R(b)},y

6

{Q(z),Q(b)},?

5

{ }, ?

Page 36: CPSC 433 Artificial Intelligence And-Tree Search Modeling Example – Model Elimination CPSC 433 T01 & T02 Andrew Kuipers.

CPSC 433 Artificial Intelligence

A First-Order Example1) P(x) Q(y) R(x)2) P(a)3) P(z) Q(z)4) Q(a)5) Q(b)6) R(b)

{P(z)},? {Q(z)},?

{P(z),P(x)},y {P(z),Q(y)},? {P(z),R(x)},?

{P(z),Q(y),Q(b)},y {P(z),R(x),R(b)},y

{Q(z),Q(b)},y

3

51

65= { z b,

y b, x b }

{ }, ?

Page 37: CPSC 433 Artificial Intelligence And-Tree Search Modeling Example – Model Elimination CPSC 433 T01 & T02 Andrew Kuipers.

CPSC 433 Artificial Intelligence

A First-Order Example1) P(x) Q(y) R(x)2) P(a)3) P(z) Q(z)4) Q(a)5) Q(b)6) R(b)

{P(z)},? {Q(z)},?

{P(z),P(x)},y {P(z),Q(y)},? {P(z),R(x)},?

{P(z),Q(y),Q(b)},y {P(z),R(x),R(b)},y

{Q(z),Q(b)},y

3

51

65= { z b,

y b, x b }

{ }, ?

search complete!