Planning: Part 1 Representation and State-space Search COMP151 March 30, 2007.

Slides:



Advertisements
Similar presentations
REVIEW : Planning To make your thinking more concrete, use a real problem to ground your discussion. –Develop a plan for a person who is getting out of.
Advertisements

Language for planning problems
CSE391 – 2005 NLP 1 Planning The Planning problem Planning with State-space search.
Planning
Planning Module THREE: Planning, Production Systems,Expert Systems, Uncertainty Dr M M Awais.
Planning Module THREE: Planning, Production Systems,Expert Systems, Uncertainty Dr M M Awais.
CLASSICAL PLANNING What is planning ?  Planning is an AI approach to control  It is deliberation about actions  Key ideas  We have a model of the.
Plan Generation & Causal-Link Planning 1 José Luis Ambite.
Planning Planning is fundamental to “intelligent” behaviour. E.g.
Planning Russell and Norvig: Chapter 11 Slides adapted from: robotics.stanford.edu/~latombe/cs121/2003/ home.htm.
Planning CSE 473 Chapters 10.3 and 11. © D. Weld, D. Fox 2 Planning Given a logical description of the initial situation, a logical description of the.
Artificial Intelligence II S. Russell and P. Norvig Artificial Intelligence: A Modern Approach Chapter 11: Planning.
CLASSICAL PLANNING AND GRAPHPLAN Classes 17 and 18 All slides created by Dr. Adam P. Anthony.
Ch. 10 – Planning Supplemental slides for CSE 327 Prof. Jeff Heflin.
1 Classical STRIPS Planning Alan Fern * * Based in part on slides by Daniel Weld.
Artificial Intelligence 2005/06
Planning Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 11.
Planning: Part 2 Partial Order Planning COMP151 April 2, 2007.
Artificial Intelligence Chapter 11: Planning
Planning Russell and Norvig: Chapter 11. Planning Agent environment agent ? sensors actuators A1A2A3.
Artificial Intelligence 2005/06 Planning: STRIPS.
Planning Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 11.
Automated Planning and HTNs Planning – A brief intro Planning – A brief intro Classical Planning – The STRIPS Language Classical Planning – The STRIPS.
1 Planning Chapters 11 and 12 Thanks: Professor Dan Weld, University of Washington.
Classical Planning via State-space search COMP3431 Malcolm Ryan.
AI Principles, Lecture on Planning Planning Jeremy Wyatt.
PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2.
An Introduction to Artificial Intelligence CE Chapter 11 – Planning Ramin Halavati In which we see how an agent can take.
Classical Planning Chapter 10.
Feng Zhiyong Tianjin University Fall planning.
1 07. The planning problem 2  Inputs: 1. A description of the world state 2. The goal state description 3. A set of actions  Output: A sequence of actions.
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
CISC453 Winter 2010 Classical Planning AIMA3e Ch 10.
Artificial Intelligence 1: Planning
April 3, 2006AI: Chapter 11: Planning1 Artificial Intelligence Chapter 11: Planning Michael Scherger Department of Computer Science Kent State University.
1 CSC 8520 Spring Paula MatuszekBased on
Planning Chapter Planning The Planning problem Planning with State-space search Partial-order planning Planning graphs Planning with propositional.
Planning (Chapter 10)
First-Order Logic and Plans Reading: C. 11 (Plans)
CPS 270: Artificial Intelligence Planning Instructor: Vincent Conitzer.
CPS 570: Artificial Intelligence Planning Instructor: Vincent Conitzer.
Planning (Chapter 10)
1 Chapter 16 Planning Methods. 2 Chapter 16 Contents (1) l STRIPS l STRIPS Implementation l Partial Order Planning l The Principle of Least Commitment.
Automated Planning Dr. Héctor Muñoz-Avila. What is Planning? Classical Definition Domain Independent: symbolic descriptions of the problems and the domain.
AI Lecture 17 Planning Noémie Elhadad (substituting for Prof. McKeown)
1/16 Planning Chapter 11- Part1 Author: Vali Derhami.
Classical Planning Chapter 10 Mausam / Andrey Kolobov (Based on slides of Dan Weld, Marie desJardins)
Planning I: Total Order Planners Sections
April 3, 2006AI: Chapter 11: Planning1 Artificial Intelligence Chapter 11: Planning.
Planning in FOL Systems sequences of actions to achieve goals.
Introduction to Artificial Intelligence April 11, 2012 Planning 1 Introduction to Artificial Intelligence CSCE476/876, Spring 2012:
Consider the task get milk, bananas, and a cordless drill.
Ch. 11 – Planning Supplemental slides for CSE 327 Prof. Jeff Heflin.
Introduction to Artificial Intelligence – Unit 6 Planning Course The Hebrew University of Jerusalem School of Engineering and Computer Science Academic.
CLASSICAL PLANNING. Outline  The challenges in planning with standard search algorithm  Representing Plans – the PDDL language  Planning as state -
Anifuddin Azis PLANNING. Artificial Intelligence A Modern Approach The subtitle of this book is "A Modern Approach." The intended meaning of this rather.
An Introduction to Artificial Intelligence CE 40417
Introduction Contents Sungwook Yoon, Postdoctoral Research Associate
Planning (AIMA Ch. 10) Planning problem defined Simple planning agent
Planning (Chapter 10)
EA C461 – Artificial Intelligence Planning
Consider the task get milk, bananas, and a cordless drill
AI Planning.
Planning José Luis Ambite.
Logic for Artificial Intelligence
Artificial Intelligence: Planning
Planning Problems On(C, A)‏ On(A, Table)‏ On(B, Table)‏ Clear(C)‏
AI Planning Introduction to Artificial Intelligence
Supplemental slides for CSE 327 Prof. Jeff Heflin
Russell and Norvig: Chapter 11 CS121 – Winter 2003
Presentation transcript:

Planning: Part 1 Representation and State-space Search COMP151 March 30, 2007

Example Planning Problem Table A C E D J F LG K I H B Goal: Stack of blocks: FCGHJB (bottom to top) Possible Actions: move any single block which has nothing on top of it.

Example Planning Problem Goal: Stack of blocks: FCGHJB (bottom to top) Possible Actions: move any single block which has nothing on top of it. Considerations: Can this be decomposed into subproblems? Can we identify irrelevant/useless actions? Can we select better actions? Analysis: 12 blocks, 13 destinations (including table) 156 potential moves n 156 nodes in a search tree (n = # moves)

Planning: Chapter The planning problem 11.2 Planning with state-space search 11.3 Partial-order planning 11.4 Planning graphs 11.5 Planning with propositional logic 11.6 Analysis of planning approaches

Planning? Planning is the task of determining a sequence of actions that will achieve a goal. Domain independent heuristics and strategies must be based on a domain independent representation –General planning algorithms require a way to represent states, actions and goals –STRIPS, ADL, PDDL are languages based on propositional or first-order logic Classical planning environment: fully observable, deterministic, finite, static and discrete.

Difficulty of real world problems Assume a problem-solving agent using some search method … –Which actions are relevant? Exhaustive search vs. backward search –What is a good heuristic functions? Good estimate of the cost of the state? Problem-dependent vs, -independent –How to decompose the problem? Most real-world problems are nearly decomposable. Decomposability means that working on one subgoal does not undo other subgoals

Problem Representation State –What is true about the (hypothesized) world? Goal –What must be true in the final state of the world? Actions –What can be done to change the world? –Preconditions and effects We’ll represent all these as logic predicates

Representing States and Goals States and goals are represented as a conjunction of positive, ground, function-free literals Propositional literals: Poor  Unknown FO-literals (grounded and function-free): At(Plane1, Melbourne)  At(Plane2, Sydney) States: –Closed world assumption: anything not explicitly true is false Goals: –A partially specified state –A goal is satisfied if state contains all literals in goal.

Representing Actions An action schema represents a parameterized actions –Action name and parameter list –Precondition conj. of function-free literals –Effect conj of function-free literals add-list: predicates that will be true delete-list: predicates that will be false Example: –Action(Fly(p,from, to), PRECOND: At(p,from)  Plane(p)  Airport(from)  Airport(to) EFFECT: ¬AT(p,from)  At(p,to))

Applicability of Actions An action is applicable in any state that satisfies the precondition. For FO action schema applicability involves a substitution  for the variables in the PRECOND. At(P1,JFK)  At(P2,SFO)  Plane(P1)  Plane(P2)  Airport(JFK)  Airport(SFO) Satisfies : At(p,from)  Plane(p)  Airport(from)  Airport(to) With  ={p/P1,from/JFK,to/SFO} Thus the action is applicable.

Effect of Actions Executing action a in state s results in state s’, where s’ is same as s except –Any positive literal P in the effect of a is added to s’ –Any negative literal ¬P is removed from s’ s: At(P1,JFK)  At(P2,SFO)  Plane(P1)  Plane(P2)  Airport(JFK)  Airport(SFO) EFFECT: ¬AT(p,from)  At(p,to): s’: At(P1,SFO)  At(P2,SFO)  Plane(P1)  Plane(P2)  Airport(JFK)  Airport(SFO) STRIPS assumption: every literal NOT in the effect remains unchanged avoids representational frame problem

Planning Languages STRIPS: Stanford Research Institute Problem Solver –important limit: function-free literals allows for propositional representation function symbols lead to infinitely many states and actions ADL: Action Description Language –A number of extension to STRIP (next slide) Action(Fly(p:Plane, from: Airport, to: Airport), PRECOND: At(p,from)  (from  to) EFFECT: ¬At(p,from)  At(p,to)) PDDL: Planning Domain Definition Language: –standardization effort –Includes sublanguages for STRIPS and ADL.

STRIPSADL Only positive literals in statesPositive and negative literals in states Closed world assumptionOpen world assumption Effect P ^ ¬Q means add P and delete Q Effect P ^ ¬Q means add P, ¬Q and delete ¬P, Q Only ground literals in goalsQuantified variables in goals Goals are conjunctionsGoals contain conjunction and disjunction Effects are conjunctionsConditional effects are allowed (when P: E) Equality predicate (x = y) built in Variables can have types

air cargo transport: STRIPS Init(At(C1, SFO)  At(C2,JFK)  At(P1,SFO)  At(P2,JFK)  Cargo(C1)  Cargo(C2)  Plane(P1)  Plane(P2)  Airport(JFK)  Airport(SFO)) Goal(At(C1,JFK)  At(C2,SFO)) Action(Load(c,p,a) PRECOND: At(c,a)  At(p,a)  Cargo(c)  Plane(p)  Airport(a) EFFECT: ¬At(c,a)  In(c,p)) Action(Unload(c,p,a) PRECOND: In(c,p)  At(p,a)  Cargo(c)  Plane(p)  Airport(a) EFFECT: At(c,a)  ¬In(c,p)) Action(Fly(p,from,to) PRECOND: At(p,from)  Plane(p)  Airport(from)  Airport(to) EFFECT: ¬ At(p,from)  At(p,to)) [Load(C1,P1,SFO), Fly(P1,SFO,JFK), Load(C2,P2,JFK), Fly(P2,JFK,SFO), Unload(C1, P1, SFO), Unload(C2, P2, SFO)]

air cargo transport: ADL Init(At(C1, SFO)  At(C2,JFK)  At(P1,SFO)  At(P2,JFK)  Cargo(C1)  Cargo(C2)  Plane(P1)  Plane(P2)  Airport(JFK)  Airport(SFO)) Goal(At(C1,JFK)  At(C2,SFO)) Action(Load(c: Cargo, p: Plane, a: Airport) PRECOND: At(c,a)  At(p,a) EFFECT: ¬At(c,a)  In(c,p)) Action(Unload(c : Cargo, p: Plane, a: Airport) PRECOND: In(c,p)  At(p,a) EFFECT: At(c,a)  ¬In(c,p)) Action(Fly(p: Plane, from: Airport, to: Airport) PRECOND: At(p,from)  (from ≠ to) EFFECT: ¬ At(p,from)  At(p,to)) [Load(C1,P1,SFO), Fly(P1,SFO,JFK), Load(C2,P2,JFK), Fly(P2,JFK,SFO), Unload(C1, P1, SFO), Unload(C2, P2, SFO)]

spare tire problem: ADL Init(At(Flat, Axle)  At(Spare,trunk)) Goal(At(Spare,Axle)) Action(Remove(Spare,Trunk) PRECOND: At(Spare,Trunk) EFFECT: ¬At(Spare,Trunk)  At(Spare,Ground)) Action(Remove(Flat,Axle) PRECOND: At(Flat,Axle) EFFECT: ¬At(Flat,Axle)  At(Flat,Ground)) Action(PutOn(Spare,Axle) PRECOND: At(Spare,Groundp)  ¬At(Flat,Axle) EFFECT: At(Spare,Axle)  ¬At(Spare,Ground)) Action(LeaveOvernight PRECOND: EFFECT: ¬ At(Spare,Ground)  ¬ At(Spare,Axle)  ¬ At(Spare,trunk)  ¬ At(Flat,Ground)  ¬ At(Flat,Axle) ) Do we need to add negative facts in initial state?

blocks world: ADL Init(On(A, Table)  On(B,Table)  On(C,Table)  Block(A)  Block(B)  Block(C)  Clear(A)  Clear(B)  Clear(C)) Goal(On(A,B)  On(B,C)) Action(Move(b,x,y) PRECOND: On(b,x)  Clear(b)  Clear(y)  Block(b)  (b  x)  (b  y)  (x  y) EFFECT: On(b,y)  Clear(x)  ¬ On(b,x)  ¬ Clear(y)) Action(MoveToTable(b,x) PRECOND: On(b,x)  Clear(b)  Block(b)  (b  x) EFFECT: On(b,Table)  Clear(x)  ¬ On(b,x))

Planning with state-space search Both forward and backward search possible Progression planners –forward state-space search –consider the effect of all possible actions in a given state Regression planners –backward state-space search –Determine what must have been true in the previous state in order to achieve the current state

Progression and regression initial state goal

Progression algorithm Formulation as state-space search problem: –Initial state and goal test: obvious –Successor function: generate from applicable actions –Step cost = each action costs 1 Any complete graph search algorithm is a complete planning algorithm. –E.g. A* Inherently inefficient: –(1) irrelevant actions lead to very broad search tree –(2) good heuristic required for efficient search

Regression algorithm How to determine predecessors? –What are the states from which applying a given action leads to the goal? Goal state = At(C1, B)  At(C2, B)  …  At(C20, B) Relevant action for first conjunct: Unload(C1,p,B) Works only if pre-conditions are satisfied. Previous state= In(C1, p)  At(p, B)  At(C2, B)  …  At(C20, B) Subgoal At(C1,B) should not be present in this state. Actions must not undo desired literals (consistent) Main advantage: only relevant actions are considered. –Often much lower branching factor than forward search.

Regression algorithm General process for predecessor construction –Give a goal description G –Let A be an action that is relevant and consistent –The predecessors are as follows: Any positive effects of A that appear in G are deleted. Each precondition literal of A is added, unless it already appears. Any standard search algorithm can be added to perform the search. Termination when predecessor satisfied by initial state. –In FO case, satisfaction might require a substitution.

Heuristics for state-space search Neither progression or regression are very efficient without a good heuristic. –How many actions are needed to achieve the goal? –Exact solution is NP hard, find a good estimate Two approaches to find admissible heuristic: –The optimal solution to the relaxed problem. Remove all preconditions from actions –The subgoal independence assumption: The cost of solving a conjunction of subgoals is approximated by the sum of the costs of solving the subproblems independently.

Exercises Define state, goal and actions using STRIPS or ADL Sorting a deck of cards by suit and value Changing your socks Cleaning the kitchen: –Cleaning stove or refrigerator will get floor dirty –To clean oven: first apply oven cleaner, then remove cleaner –Floor must be swept before it is washed –Garbage must be taken out before floor can be swept –Cleaning refrigerator generates garbage and messes up counters –Washing counters or floor gets sink dirty