Search vs planning Situation calculus STRIPS operators 1

  • Slides: 17
Download presentation
 • Search vs. planning • Situation calculus • STRIPS operators 1

• Search vs. planning • Situation calculus • STRIPS operators 1

Search in problem solving a b • Problem solution: c A path through the

Search in problem solving a b • Problem solution: c A path through the state space tree abc • State space search: Search is a traversal of the tree until the goals is reached. • State transitions is performed by operators 2

Difficulty. Search using standard in problem search solving algorithms Standard search algorithms seems to

Difficulty. Search using standard in problem search solving algorithms Standard search algorithms seems to fail since the goal test is inadequate. What is “finish”? 3

Planning Search problem in situation solving calculus Consider the same task get milk, bananas,

Planning Search problem in situation solving calculus Consider the same task get milk, bananas, and a cordless drill A planning problem is represented in situation calculus by logical sentences that describe three main parts of a problem. • Initial state: At(home, S 0) Have(Milk, S 0) Have(Banana, S 0) Have(Drill, S 0) • Goal state: s At(home, s) Have(Milk, s) Have(Bananas, s) Have(Drill, s) • Operators: a, s Have(Milk, Result (a, s)) [ (a=Buy(Milk)) At(Supermarket, s) (Have(Milk, s) a Drop(Milk) )] • Plan: p = [Go(Supermarket), Buy(Milk), Buy(Bananas), Go(HWS), …] 4

Problem Search in solving problem vs. planning solving • Representation of states PS: Direct

Problem Search in solving problem vs. planning solving • Representation of states PS: Direct assignment of a symbol to each state PL: Logic sentences • Representation of goals PS: A goal state symbol PL: Sentences that describe objective • Representation of actions PS: Operators that transform one state symbol into another PL: Addition/deletion of logic sentences describing world state • Representation of plans PS: Path through state space PL: Ordered or partially-ordered sequence of actions. 5

Advantages Search inofproblem Planning solving Systems • Uniform language for describing states, goals, actions,

Advantages Search inofproblem Planning solving Systems • Uniform language for describing states, goals, actions, and their effects. • Ability to add actions to a plan whenever they are needed, not just in an incremental sequence from some initial state. • Ability to capture the fact that most parts of the world are independent of most other parts. • It performs better for complex worlds over standard search algorithm since searching space becomes huge when there are many initial states and operators in standard search algorithms. 6

The Situation Calculus Wff - well formed formula l l A goal can be

The Situation Calculus Wff - well formed formula l l A goal can be described by a wff: x On(x, B) if we want to have a block on B Planning: finding a set of actions to achieve a goal wff. Situation Calculus (Mc. Carthy, Hayes, 1969, Green 1969) – A Predicate Calculus formalization of states, actions, and their effects. – So state in figure can be described by: On(B, A) On(A, C) On(A, Fl) Clear(B) l we reify the state and include them as arguments The atoms denotes relations over states. On(B, A, S 0) On(A, C, S 0) On(C, Fl, S 0) Clear(B, S 0) l We can also have. x, y, s On(x, y, s) (y = Fl) Clear(y, s) s Clear(Fl, s) 7

Representing actions l l Reify the actions: denote an action by a symbol –

Representing actions l l Reify the actions: denote an action by a symbol – actions are functions move(B, A, Fl): move block B from block A to Fl move (x, y, z) - action schema do: A function constant, do denotes a function that maps actions and states into states action l state Express the effects of actions. – Example: (on, move) (expresses the effect of move on On) – positive effect axiom: 8

Effect axioms for (clear, move) move(x, y, z) matching? precondition are satisfied with B/x,

Effect axioms for (clear, move) move(x, y, z) matching? precondition are satisfied with B/x, A/y, S 0/s, F 1/z what was true in S 0 remains true 9

STRIPS: describing goals and state STRIPS: STanford Research Institute Planning System Basic approach in

STRIPS: describing goals and state STRIPS: STanford Research Institute Planning System Basic approach in GPS (general Problem Solver): • Find a “difference” (Something in G that is not provable in S 0) • Find a relevant operator f for reducing the difference • Achieve precondition of f; apply f; from resultant state, achieve G.

STRIPS planning • STRIPS uses logical formulas to represent the states S 0, G,

STRIPS planning • STRIPS uses logical formulas to represent the states S 0, G, P, etc: • Description of operator f:

A STRIPS planning example l l l l On(B, A) On(A, C) On(C, F

A STRIPS planning example l l l l On(B, A) On(A, C) On(C, F 1) Clear(B) Clear(Fl) The formula describes a set of world states Planning search for a formula satisfying a goal description • • • On(A, C) On(C, Fl) On(B, Fl) Clear(A) Clear(B)

STRIPS Description of Operators l l l A STRIPS operator has 3 parts: –

STRIPS Description of Operators l l l A STRIPS operator has 3 parts: – A set, PC - preconditions – A set D - the delete list – A set A - the add list Usually described by Schema: Move(x, y, z) – PC: On(x, y) and On(Clear(x) and Clear(z) – D: Clear(z) , On(x, y) – A: On(x, z), Clear(y), Clear(F 1) A state S 1 is created applying operator O by adding A and deleting D from S 1.

Example: The move operator

Example: The move operator

Example 1: The move operator S 0 ->P x/B, y/A, z/Fl P: Clear(x) Clear(z)

Example 1: The move operator S 0 ->P x/B, y/A, z/Fl P: Clear(x) Clear(z) f(P)->G x/B, y/A, z/Fl On(x, y) G f: move(x, y, z) add: On(x, z), Clear(y) del: On(x, y), Clear(z) On(x, z) f(P) : Clear(x) Clear(y)

Example 1: The move operator A B C + Clear(F 2) S 0 ->P

Example 1: The move operator A B C + Clear(F 2) S 0 ->P x/B, y/A, z/Fl P: Clear(x) Clear(z) f(P)->G x/B, y/A, z/Fl On(x, y) G f: move(x, y, z) add: On(x, z), Clear(y) del: On(x, y), Clear(z) On(x, z) f(P) : Clear(x) Clear(y)

Tree representation S 0: On(B, A) G 0: On(A, C) On(C, Fl) On(C, F

Tree representation S 0: On(B, A) G 0: On(A, C) On(C, Fl) On(C, F 1) S 0 ->G 0 On(B, Fl) Clear(B) Clear(A) Clear(Fl) Clear(B) S 0 ->G 1 pre: On(B, A) Clear(B) Clear(Fl) G 1 ->S 1 Move(B, A Fl) S 1 ->G 0