CS325 Artificial Intelligence Chs. 10, 11 Planning Cengiz Gnay, - - PowerPoint PPT Presentation

cs325 artificial intelligence chs 10 11 planning
SMART_READER_LITE
LIVE PREVIEW

CS325 Artificial Intelligence Chs. 10, 11 Planning Cengiz Gnay, - - PowerPoint PPT Presentation

CS325 Artificial Intelligence Chs. 10, 11 Planning Cengiz Gnay, Emory Univ. Spring 2013 Gnay () Chs. 10, 11 Planning Spring 2013 1 / 24 Planning Gnay () Chs. 10, 11 Planning Spring 2013 2 / 24 Planning Planning is


slide-1
SLIDE 1

CS325 Artificial Intelligence

  • Chs. 10, 11 – Planning

Cengiz Günay, Emory Univ. Spring 2013

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 1 / 24

slide-2
SLIDE 2

Planning

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 2 / 24

slide-3
SLIDE 3

Planning

Planning is coming up with a solution for an agent: it’s at the heart of AI

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 2 / 24

slide-4
SLIDE 4

Entry/Exit Surveys

Exit survey: Knowledge Representation and Inference

What knowledge representation do you think our brains have? What knowledge base topic/domain would you wish you had?

Entry survey: Planning (0.25 points of final grade)

What previous class topic would count as a planning algorithm? Where do you think you used an automated planning system?

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 3 / 24

slide-5
SLIDE 5

Graph Search Is a Form of Planning

Giurgiu Urziceni Hirsova Eforie Neamt Oradea Zerind Arad Timisoara Lugoj Mehadia Drobeta Craiova Sibiu Fagaras Pitesti Vaslui Iasi Rimnicu Vilcea Bucharest 71 75 118 111 70 75 120 151 140 99 80 97 101 211 138 146 85 90 98 142 92 87 86

Search algorithm like A∗ is a planning method

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 4 / 24

slide-6
SLIDE 6

Graph Search Is a Form of Planning

Giurgiu Urziceni Hirsova Eforie Neamt Oradea Zerind Arad Timisoara Lugoj Mehadia Drobeta Craiova Sibiu Fagaras Pitesti Vaslui Iasi Rimnicu Vilcea Bucharest 71 75 118 111 70 75 120 151 140 99 80 97 101 211 138 146 85 90 98 142 92 87 86

Search algorithm like A∗ is a planning method Only works for observable and deterministic environment What if you cannot plan all the way?

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 4 / 24

slide-7
SLIDE 7

Blind Walking

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 5 / 24

slide-8
SLIDE 8

Blind Walking

Need to alternate plan & execution

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 5 / 24

slide-9
SLIDE 9

How Does the Brain Do It?

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 6 / 24

slide-10
SLIDE 10

How Does the Brain Do It?

Frontal lobes are biggest in humans, dedicated to planning, reasoning and other high-order skills

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 6 / 24

slide-11
SLIDE 11

So When Do You Need Planning?

Stochastic environment Multi-agent situation Partial observable Unknown Hierarchical

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 7 / 24

slide-12
SLIDE 12

So When Do You Need Planning?

Stochastic environment Multi-agent situation Partial observable Unknown Hierarchical In these cases, may need to plan in belief states

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 7 / 24

slide-13
SLIDE 13

Sensorless World

R L S S S S R L R L R L S S S S L L L L R R R R

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 8 / 24

slide-14
SLIDE 14

Sensorless World

L

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 8 / 24

slide-15
SLIDE 15

Sensorless World

L Start: clean place Go: left wall, clean

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 8 / 24

slide-16
SLIDE 16

Partially Observable Environment

Deterministic, but sense only local dirt & location

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 9 / 24

slide-17
SLIDE 17

Partially Observable Environment

Deterministic, but sense only local dirt & location Belief states get smaller with actions

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 9 / 24

slide-18
SLIDE 18

Stochastic (Random) Environment

Still local sensing Robot has slippery wheels, may not move

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 10 / 24

slide-19
SLIDE 19

Stochastic (Random) Environment

Still local sensing Robot has slippery wheels, may not move Belief states get larger with actions

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 10 / 24

slide-20
SLIDE 20

Stochastic (Random) Environment

Can reach clean world? Still local sensing Robot has slippery wheels, may not move Belief states get larger with actions

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 10 / 24

slide-21
SLIDE 21

Stochastic (Random) Environment

Can reach clean world? No finite solution! Still local sensing Robot has slippery wheels, may not move Belief states get larger with actions

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 10 / 24

slide-22
SLIDE 22

Infinite Sequences?

Finite sequences don’t work:

[R, S, R, S]

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 11 / 24

slide-23
SLIDE 23

Infinite Sequences?

Finite sequences don’t work:

[R, S, R, S]

Make a finite plan with branches

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 11 / 24

slide-24
SLIDE 24

Infinite Sequences?

Finite sequences don’t work:

[R, S, R, S]

Make a finite plan with branches Gives an infinite sequence!

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 11 / 24

slide-25
SLIDE 25

Infinite Sequences?

Finite sequences don’t work:

[R, S, R, S]

Make a finite plan with branches Gives an infinite sequence! Can write it like: [S, While A : R, S]

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 11 / 24

slide-26
SLIDE 26

Searching For a Plan

Like searching for paths, find a plan that reaches the goal.

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 12 / 24

slide-27
SLIDE 27

Searching For a Plan

Unbounded solution: Some leaf goal Every leaf goal No Bounded solution: No branch No loops No Like searching for paths, find a plan that reaches the goal.

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 12 / 24

slide-28
SLIDE 28

Searching For a Plan

Unbounded solution: Some leaf goal Every leaf goal No Bounded solution: No branch No loops No Like searching for paths, find a plan that reaches the goal.

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 12 / 24

slide-29
SLIDE 29

Mathematical Notation

[A, S, F] Result(Result(A, A → S), S → F) ∈ Goals Deterministic: s′ = Result(a, s) where s is state and a is action.

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 13 / 24

slide-30
SLIDE 30

Mathematical Notation

[A, S, F] Result(Result(A, A → S), S → F) ∈ Goals Deterministic: s′ = Result(a, s) where s is state and a is action. Non-deterministic: Predict-update beliefs (b) cycle: b′ = Update(Predict(b, a), o) where o is observation.

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 13 / 24

slide-31
SLIDE 31

Predict-Update Cycle

Babies randomly dirtying floors

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 14 / 24

slide-32
SLIDE 32

Predict-Update Cycle

Babies randomly dirtying floors Problems: Large solution, simpler to list world state as variables

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 14 / 24

slide-33
SLIDE 33

Classical Planning

State space: k boolean variables; size:

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 15 / 24

slide-34
SLIDE 34

Classical Planning

State space: k boolean variables; size: 2k

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 15 / 24

slide-35
SLIDE 35

Classical Planning

State space: k boolean variables; size: 2k World state: Complete assignment Belief state: Complete/partial/arbitrary formula Called an action schema

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 15 / 24

slide-36
SLIDE 36

Action Schemas

1 Action 2 Precondition 3 Effect Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 16 / 24

slide-37
SLIDE 37

Action Schemas

1 Action 2 Precondition 3 Effect

Example: Action(Fly(p, from, to), Pre: At(p, from) ∧ Plane(p) ∧ Airport(from) ∧ Airport(to) Eff: ¬At(p, from) ∧ At(p, to))

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 16 / 24

slide-38
SLIDE 38

Action Schemas

1 Action 2 Precondition 3 Effect

Example: Action(Fly(p, from, to), Pre: At(p, from) ∧ Plane(p) ∧ Airport(from) ∧ Airport(to) Eff: ¬At(p, from) ∧ At(p, to)) Is it FOL?

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 16 / 24

slide-39
SLIDE 39

Air Cargo Example

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 17 / 24

slide-40
SLIDE 40

Progression/Forward Search

Like regular search.

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 18 / 24

slide-41
SLIDE 41

Regression/Backward Search

Start with goal, have many unknowns.

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 19 / 24

slide-42
SLIDE 42

When to Choose Forward vs. Backward?

Remember when to choose breadth-first vs. depth first. Fewer options when starting from the goal. Can think of other examples?

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 20 / 24

slide-43
SLIDE 43

Searching the “Plan Space”

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 21 / 24

slide-44
SLIDE 44

Searching the “Plan Space”

How would one use genetic algorithms?

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 21 / 24

slide-45
SLIDE 45

Current Trend: Forward Search with Heuristics

Tiles example:

Action(Slide(t, a, b), Pre: On(t, a) ∧ Tile(t) ∧ Blank(b) ∧ Adj(a, b) Eff: On(t, b) ∧ Blank(a) ∧ ¬On(t, a) ∧ ¬Blank(b))

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 22 / 24

slide-46
SLIDE 46

Current Trend: Forward Search with Heuristics

Tiles example:

Action(Slide(t, a, b), Pre: On(t, a) ∧ Tile(t) ∧ Blank(b) ∧ Adj(a, b) Eff: On(t, b) ∧ Blank(a) ∧ ¬On(t, a) ∧ ¬Blank(b)) How to use heuristics? Remember Romania routes.

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 22 / 24

slide-47
SLIDE 47

Current Trend: Forward Search with Heuristics

Tiles example:

Action(Slide(t, a, b), Pre: On(t, a) ∧ Tile(t) ∧ Blank(b) ∧ Adj(a, b) Eff: On(t, b) ∧ Blank(a) ∧ ¬On(t, a) ∧ ¬Blank(b)) How to use heuristics? Remember Romania routes. Choose approximate solutions and use during search Delete terms from schema

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 22 / 24

slide-48
SLIDE 48

Current Trend: Forward Search with Heuristics

Tiles example:

Action(Slide(t, a, b), Pre: On(t, a) ∧ Tile(t) ∧ Blank(b) ∧ Adj(a, b) Eff: On(t, b) ∧ Blank(a) ∧ ¬On(t, a) ∧ ¬Blank(b)) How to use heuristics? Remember Romania routes. Choose approximate solutions and use during search Delete terms from schema Can also do this programmatically

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 22 / 24

slide-49
SLIDE 49

One Last Bit: Situation Calculus

Uses First Order Logic (FOL) for planning: Actions: are objects; e.g., Fly(p, x, y) Situations: objects; e.g., s′ = Result(s, a) Fluents: change at each situation: e.g., At(p, x, s) Possible actions: objects; Poss(a, s) Written as in: Pre(s) ⇒ Poss(a, s)

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 23 / 24

slide-50
SLIDE 50

One Last Bit: Situation Calculus

Uses First Order Logic (FOL) for planning: Actions: are objects; e.g., Fly(p, x, y) Situations: objects; e.g., s′ = Result(s, a) Fluents: change at each situation: e.g., At(p, x, s) Possible actions: objects; Poss(a, s) Written as in: Pre(s) ⇒ Poss(a, s)

Plane example:

Plane(p, s) ∧ Airport(x, s) ∧ Airport(y, s) ∧ At(p, x, s) ⇒ Poss(Fly(p, x, y), s)

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 23 / 24

slide-51
SLIDE 51

Situation Calculus: Effects

Effects: Successor state axioms: ∀a, s Poss(a, s) ⇒ (fluent ⇔ caused it ∧ didn′t undo it)

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 24 / 24

slide-52
SLIDE 52

Situation Calculus: Effects

Effects: Successor state axioms: ∀a, s Poss(a, s) ⇒ (fluent ⇔ caused it ∧ didn′t undo it)

Cargo example:

Poss(a, s) ⇒ In(c, p, Result(s, a)) ⇔ (a = Load(c, p, x) ∨ (In(c, p, s) ∧ a = Unload(c, p, x)))

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 24 / 24

slide-53
SLIDE 53

Situation Calculus: Effects

Effects: Successor state axioms: ∀a, s Poss(a, s) ⇒ (fluent ⇔ caused it ∧ didn′t undo it)

Cargo example:

Poss(a, s) ⇒ In(c, p, Result(s, a)) ⇔ (a = Load(c, p, x) ∨ (In(c, p, s) ∧ a = Unload(c, p, x))) Can use power of FOL Can use existing theorem provers Problem: slow

Günay ()

  • Chs. 10, 11 – Planning

Spring 2013 24 / 24