planning in fol systems sequences of actions to achieve goals

24
Planning in FOL Systems sequences of actions to achieve goals

Upload: bridget-thomas

Post on 18-Jan-2018

218 views

Category:

Documents


0 download

DESCRIPTION

D Goforth - COSC 4117, fall Classical Planning - STRIPS  STanford Research Institute Problem Solver  Closed world assumption facts not in KB are assumed false  Predicates in KB must refer to specific objects (no variables, no functions)  Goal – conjunction of positive literals  No ‘situation calculus’ – current state only

TRANSCRIPT

Page 1: Planning in FOL Systems sequences of actions to achieve goals

Planning in FOL Systems

sequences of actions to achieve goals

Page 2: Planning in FOL Systems sequences of actions to achieve goals

D Goforth - COSC 4117, fall 2006 2

Planning Example: Blocks world objects: blocks on a table actions: move blocks ‘on’ one object

to ‘on’ another object goals: configurations of blocks plan: sequence of actions to achieve

goals

TA B CD

Page 3: Planning in FOL Systems sequences of actions to achieve goals

D Goforth - COSC 4117, fall 2006 3

Classical Planning - STRIPS STanford Research Institute Problem

Solver Closed world assumption

facts not in KB are assumed false Predicates in KB must refer to specific

objects (no variables, no functions) Goal – conjunction of positive literals No ‘situation calculus’ – current state

only

Page 4: Planning in FOL Systems sequences of actions to achieve goals

D Goforth - COSC 4117, fall 2006 4

Classical Planning - STRIPS actions:

preconditions – predicates that must be in KB

effect – some predicates added to KB and some predicates removed (‘negated’)

plan – sequence of actions to get goal predicates into KB

Page 5: Planning in FOL Systems sequences of actions to achieve goals

Blocks world objects: A, B, C, D, T KB:On(A,T)^On(B,T)^On(C,T)^On(D,C)^Block(A)^Block(B)^Block(C)^Block(D)^Clear(A) ^Clear(B )^Clear(D) ^Clear(T)*

Goal: On(A,B)^On(B,C)

TA B CD

* Clear(x) means “there is space on x for a block”

Page 6: Planning in FOL Systems sequences of actions to achieve goals

Blocks world actions:Move(b,x,y) // move b from x to y

PRE:On(b,x)^Clear(b)^Clear(y)^Block(b)^Block(y)EFFECT:On(b,x)^Clear(y)^Clear(x)^On(b,y)

MoveToTable(b,x) // move b from x to tablePRE:On(b,x)^Clear(b) ^Block(b) ^Block(x)EFFECT:On(b,x)^Clear(x)^On(b,T)

// remove from KB; add to KB

TA B CD

Page 7: Planning in FOL Systems sequences of actions to achieve goals

D Goforth - COSC 4117, fall 2006 7

STRIPS requirements need ‘Clear’ because Clear cannot be

inferred from the ‘On’ predicates need two Move actions to manage the

‘clear table’ problemunsolved problem:can’t avoid ‘repeated literal’ problemMove(B,C,C)

Page 8: Planning in FOL Systems sequences of actions to achieve goals

D Goforth - COSC 4117, fall 2006 8

Planning – state space search current KB is current state applying an action is an edge revised KB is next state from current KB, search for path of

actions to state containing goal

Page 9: Planning in FOL Systems sequences of actions to achieve goals

Blocks worldKB:On(A,T)^On(B,T)^On(C,T)^On(D,C)^Block(A)^Block(B)^Block(C)^Block(D)^Clear(A)^Clear(B) ^Clear(D) ^Clear(T)TA B C

D

KB:On(A,D)^On(B,T)^On(C,T)^On(D,C)^Block(A)^Block(B)^Block(C)^Block(D)^Clear(A) ^Clear(B) ^Clear(T)T

A

B CD

Move(A,T,D)

Page 10: Planning in FOL Systems sequences of actions to achieve goals

D Goforth - COSC 4117, fall 2006 10

Forward search irrelevant action problem: actions that

are possible lead to large branching needs good heuristic to be efficient

(breaks FOL domain independence)

Page 11: Planning in FOL Systems sequences of actions to achieve goals

D Goforth - COSC 4117, fall 2006 11

Backward search actions with goal state as ‘effect’ are

‘regressed’ focus on ‘relevant’ actions avoid actions that undo goal state

predicates

goal state predicates

previous state predicates undo action

effects

add preconditions

Page 12: Planning in FOL Systems sequences of actions to achieve goals

Blocks world – preconditions matchGoal: On(A,B)^On(B,C)

T

AB C

D

On(A,T)^On(B,T)^On(C,T)^On(D,C)^Block(A)^Block(B)^Block(C)^Block(D)^Clear(A) ^Clear(B) ^Clear(T)

TA B CD

Move(A,x,B){T/x}

Preconditions for Move(A,T,B)

Page 13: Planning in FOL Systems sequences of actions to achieve goals

Blocks world – preconditions not matchGoal: On(A,B)^On(B,C)

TA

BD

On(A,T)^On(B,T)^On(C,T)^On(D,C)^Block(A)^Block(B)^Block(C)^Block(D)^Clear(A) ^Clear(B)^Clear(D)^Clear(T)

TA B

C

D

Move(B,x,C){T/x}

C

On(B,T)^Block(B)^Block(C)^Clear(C) ^Clear(B)A B DC

TMoveToTable(y,C)

{D/y}

Page 14: Planning in FOL Systems sequences of actions to achieve goals

D Goforth - COSC 4117, fall 2006 14

State space search algorithms heuristics:

admissible (don’t overestimate path cost) generic heuristics not domain dependent

relaxed problem – reduce preconditions, remove negative effects

independent subgoals – achieve goal predicates one at a time: assume one goal does not help or prevent another

Page 15: Planning in FOL Systems sequences of actions to achieve goals

Blocks world - heuristicsMove(b,x,y)

PRE:On(b,x)^Clear(b)^Clear(y)^Block(b)^Block(y)EFFECT:On(b,x)^Clear(y)^Clear(x)^On(b,y)

MoveToTable(b,x)PRE:On(b,x)^Clear(b)^Block(b)EFFECT:On(b,x)^Clear(x)^On(b,T)

For example goal On(A,B) On(B,C):Heuristic “independent subgoals” On(A,B) and On(B,C)simplifies because On(A,B) interferes with On(B,C)Heuristic “relaxed problem” remove preconditions,

negatives

TA B CD

Page 16: Planning in FOL Systems sequences of actions to achieve goals

D Goforth - COSC 4117, fall 2006 16

Partial Order Planning since GPS (General Problem Solver),

understood getting the major steps in place first

improves planning e.g. car trip including a ferry crossing

plans built in mixed order, not just forward or backward

Page 17: Planning in FOL Systems sequences of actions to achieve goals

D Goforth - COSC 4117, fall 2006 17

Partial Order Planning in many plans, order of some steps

does not matter if parts of goal are independent, does not

matter which goal is achieved first

TA B C DGoal: On(A,B)^On(C,D)

Page 18: Planning in FOL Systems sequences of actions to achieve goals

D Goforth - COSC 4117, fall 2006 18

Partial Order Planning planning takes place in ‘plan space’

of partial plans a partial plan contains:

1. actions, A, B, C, ...,Start, Finish2. ordering constraint between some

actions: A must be done before B: A B 3. causal links: A produces a precondition

for B:4. set of unachieved preconditions (empty

in final plan)

Page 19: Planning in FOL Systems sequences of actions to achieve goals

D Goforth - COSC 4117, fall 2006 19

The empty plan (root of plan search space tree)

Action: StartPRE: noneEFFECT: start state of space

Action: FinishPRE: goal predicatesEFFECT: none

T

AB C

D

AB

D

On(A,B)On(B,T)On(D,C)On(C,T)

On(A,B)On(B,C)On(C,D)

C

open{On(B,C),On(C,D)}

Start Finish

NOTE: some predicates not shown – Clear in KB

Page 20: Planning in FOL Systems sequences of actions to achieve goals

A partial planAction: StartPRE: noneEFFECT: On(A,B),On(B,T),On(D,C),On(C,T)

Action: FinishPRE: On(A,B),On(B,C),On(C,D) EFFECT: none

T

AB C

D

AB

DC

open{On(C,D)}

Action: M(B,T,C)PRE: Clear(B),Clear(C)EFFECT: On(B,C)

Start M

causal On(B,C)

Page 21: Planning in FOL Systems sequences of actions to achieve goals

A partial planAction: StartPRE: noneEFFECT: On(A,B),On(B,T),On(D,C),On(C,T)

Action: FinishPRE: On(A,B),On(B,C),On(C,D) EFFECT: none

T

AB C

D

AB

DC

open{On(A,B),On(C,D)}

Action: M(B,T,C)PRE: Clear(B),Clear(C)EFFECT: On(B,C)

Action: MT(A,B)PRE: Clear(A)EFFECT: On(A,T),Clear(B)

Page 22: Planning in FOL Systems sequences of actions to achieve goals

The complete partially ordered plan Action: Start

Action: FinishPRE: goal

AB C

D

AB

D

On(A,B)On(B,T)On(D,C)On(C,T)

On(A,B)On(B,C)On(C,D)

C

Action: MT(A,B) Action: MT(D,C)

Action: M(C,T,D)

Action: M(B,T,C)

Action: M(A,T,B)

open{}

Page 23: Planning in FOL Systems sequences of actions to achieve goals

The total order plans Action: Start

Action: FinishPRE: goal

Action: MT(A,B)

Action: MT(D,C)

Action: M(C,T,D)

Action: M(B,T,C)

Action: M(A,T,B)

Action: Start

Action: FinishPRE: goal

Action: MT(D,C)

Action: MT(A,B)

Action: M(C,T,D)

Action: M(B,T,C)

Action: M(A,T,B)

Page 24: Planning in FOL Systems sequences of actions to achieve goals

D Goforth - COSC 4117, fall 2006 24

Heuristics for partial order plans size of open precondition set

number of unachieved goal predicates overestimates remaining actions if

some actions achieve multiple goals underestimates remaining actions if

some actions will undo preconditions(e.g. taking A off B)