CPSC 433 Artificial Intelligence And-Tree Search Modeling Example – Model Elimination CPSC 433 T01...

37
CPSC 433 Artificial Intelligence And-Tree Search Modeling Example – Model Elimination CPSC 433 T01 & T02 Andrew Kuipers
  • date post

    19-Dec-2015
  • Category

    Documents

  • view

    230
  • download

    5

Transcript of CPSC 433 Artificial Intelligence And-Tree Search Modeling Example – Model Elimination CPSC 433 T01...

CPSC 433 Artificial Intelligence

And-Tree Search ModelingExample – 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))

CPSC 433 Artificial Intelligence

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

{ },?

CPSC 433 Artificial Intelligence

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

{ },?

CPSC 433 Artificial Intelligence

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

{ },?

CPSC 433 Artificial Intelligence

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

{ },?

{p},? {s},?

3

CPSC 433 Artificial Intelligence

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

{ },?

{p},? {s},?

3

CPSC 433 Artificial Intelligence

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

{ },?

{p},? {s},?

3

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

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

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

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

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

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

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

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

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

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

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

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

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

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!

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)

{ }, ?

= { }

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

{ }, ?

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

{ }, ?

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

{ }, ?

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

{ }, ?

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

{ }, ?

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

{ }, ?

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

{ }, ?

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!

{ }, ?

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

{ }, ?

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!

{ }, ?

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!

{ }, ?

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

{ }, ?

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 }

{ }, ?

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!