Planning CSE 473 AIMA, 10.3 and 11.

Slides:



Advertisements
Similar presentations
UNIT-3 PLANNING AI Planning Prepared by N. Sathish Kumar AP
Advertisements

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.
Language for planning problems
1 Planning Chapter CMSC 471 Adapted from slides by Tim Finin and Marie desJardins. Some material adopted from notes by Andreas Geyer-Schulz,
Planning Module THREE: Planning, Production Systems,Expert Systems, Uncertainty Dr M M Awais.
Causal-link Planning II José Luis Ambite. 2 CS 541 Causal Link Planning II Planning as Search State SpacePlan Space AlgorithmProgression, Regression POP.
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.
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
1 Graphplan José Luis Ambite * [* based in part on slides by Jim Blythe and Dan Weld]
Situation Calculus for Action Descriptions We talked about STRIPS representations for actions. Another common representation is called the Situation Calculus.
Plan Generation & Causal-Link Planning 1 José Luis Ambite.
Planning with Constraints Graphplan & SATplan Yongmei Shi.
Graph-based Planning Brian C. Williams Sept. 25 th & 30 th, J/6.834J.
Planning Graphs * Based on slides by Alan Fern, Berthe Choueiry and Sungwook Yoon.
For Monday Finish chapter 12 Homework: –Chapter 13, exercises 8 and 15.
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.
Planning Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 11.
Artificial Intelligence Chapter 11: Planning
Planning Russell and Norvig: Chapter 11. Planning Agent environment agent ? sensors actuators A1A2A3.
Planning: Part 3 Planning Graphs COMP151 April 4, 2007.
Planning CSE 473. © Daniel S. Weld Topics Agency Problem Spaces Search Knowledge Representation Reinforcement Learning InferencePlanning Supervised.
1 Approaches to Agent Control zAgent senses world, acts to affect world zReactive Control ySet of situation-action rules yE.g. x1) if dog-is-behind-me.
Planning II CSE 473. © Daniel S. Weld 2 Logistics Tournament! PS3 – later today Non programming exercises Programming component: (mini project) SPAM detection.
Planning Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 11.
1 Logistics z1 Handout yCopies of my slides zReading yRecent Advances in AI Planning, sections 1-2.
1 Planning Chapters 11 and 12 Thanks: Professor Dan Weld, University of Washington.
Planning II CSE 573. © Daniel S. Weld 2 Logistics Reading for Wed Ch 18 thru 18.3 Office Hours No Office Hour Today.
Planning Department of Computer Science & Engineering Indian Institute of Technology Kharagpur.
An Introduction to Artificial Intelligence CE Chapter 11 – Planning Ramin Halavati In which we see how an agent can take.
Classical Planning Chapter 10.
For Wednesday Read chapter 12, sections 3-5 Program 2 progress due.
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
Homework 1 ( Written Portion )  Max : 75  Min : 38  Avg : 57.6  Median : 58 (77%)
CSE 473 Automated Planning Dan Weld (With slides by UW AI faculty & Dana Nau I have a plan - a plan that cannot possibly fail. - Inspector Clousseau.
For Monday Read chapter 12, sections 1-2 Homework: –Chapter 10, exercise 3.
1 CS 2710, ISSP 2160 The Situation Calculus KR and Planning Some final topics in KR.
Introduction to Planning Dr. Shazzad Hosain Department of EECS North South Universtiy
Partial Order Planning 1 Brian C. Williams J/6.834J Sept 16 th, 2002 Slides with help from: Dan Weld Stuart Russell & Peter Norvig.
AI Lecture 17 Planning Noémie Elhadad (substituting for Prof. McKeown)
Partial Order Plan Execution 1 Brian C. Williams J/6.834J Sept. 16 th, 2002 Slides with help from: Dan Weld Stuart Russell & Peter Norvig.
Classical Planning Chapter 10 Mausam / Andrey Kolobov (Based on slides of Dan Weld, Marie desJardins)
Graphplan.
© Daniel S. Weld 1 Logistics Travel Wed class led by Mausam Week’s reading R&N ch17 Project meetings.
Planning I: Total Order Planners Sections
Automated Planning and Decision Making Prof. Ronen Brafman Automated Planning and Decision Making Graphplan Based on slides by: Ambite, Blyth and.
Graphplan CSE 574 April 4, 2003 Dan Weld. Schedule BASICS Intro Graphplan SATplan State-space Refinement SPEEDUP EBL & DDB Heuristic Gen TEMPORAL Partial-O.
ADVANCED PLANNING TECHNIQUES Dr. Adam Anthony Lecture 22.
1 Chapter 6 Planning-Graph Techniques. 2 Motivation A big source of inefficiency in search algorithms is the branching factor  the number of children.
Planning as Search State Space Plan Space Algorihtm Progression
Classical Planning via State-space search
Introduction Contents Sungwook Yoon, Postdoctoral Research Associate
Planning Search vs. planning STRIPS operators Partial-order planning
Class #17 – Thursday, October 27
Planning Search vs. planning STRIPS operators Partial-order planning
Planning José Luis Ambite.
Graph-based Planning Slides based on material from: Prof. Maria Fox
Graphplan/ SATPlan Chapter
Planning CSE 573 A handful of GENERAL SEARCH TECHNIQUES lie at the heart of practically all work in AI We will encounter the SAME PRINCIPLES again and.
Introduction to Situation Calculus
AI Planning Introduction to Artificial Intelligence
Class #19 – Monday, November 3
Chapter 6 Planning-Graph Techniques
Class #20 – Wednesday, November 5
Graphplan/ SATPlan Chapter
Graphplan/ SATPlan Chapter
GraphPlan Jim Blythe.
An Introduction to Planning Graph
Graph-based Planning Slides based on material from: Prof. Maria Fox
[* based in part on slides by Jim Blythe and Dan Weld]
Presentation transcript:

Planning CSE 473 AIMA, 10.3 and 11

Overview FOL Planning in Situation Calculus Planning vs. Problem Solving STRIPS Formalism Partial Order Planning GraphPlan SATPlan © D. Weld, D. Fox

FOL Planning: Situation Calculus Situations: Logical description of world at some point in time Result(a,s) returns next state / situation Fluents: Functions and predicates that change over time Holding(G1, S4) Atemporal: Static functions and predicates Gold(G1) © D. Weld, D. Fox

Situation Calculus Result([], s) = s Result([a|seq], s) = Result(seq, Result(a, s)) © D. Weld, D. Fox

Situation Calculus Projection task: Deduce outcome of sequence of actions Planning task: Find sequence of actions that achieves desired effect Examples: At( Agent, [1,1], S0)  At(G1, [1,2], S0 )  ¬Holding( G1, S0 ) Gold( G1)  Adjacent( [1,1], [1,2])  Adjacent( [1,2], [1,1]) © D. Weld, D. Fox

Situation Calculus Projection / prediction / verification: Planning: At( G1, [1,1], Result([Go([1,1],[1,2]), Grab(G1), Go([1,2],[1,1])], S0 )) Planning:  seq At( G1, [1,1], Result(seq, S0)) © D. Weld, D. Fox

Actions in Situation Calculus Possibility axioms: At( Agent, x, s)  Adjacent( x,y)  Poss( Go(x,y),s) Gold( g)  At(Agent,x,s)  At( g, x, s)  Poss( Grab(g),s) Effect axioms: Poss( Go(x,y),s)  At( Agent, y, Result( Go(x,y),S)) Poss( Grab(g),s)  Holding( g, Result( Grab(g),S)) Poss( Release(g),s)  ¬ Holding( g, Result( Release(g),S)) Can prove now: At(Agent, [1,2], Result(Go([1,1],[1,2]), S0 )) Can’t show: At(G1, [1,2], Result(Go([1,1],[1,2]), S0 )) © D. Weld, D. Fox

Frame Problem How to handle the things that are NOT changed by an action? A actions, E effects per action, F fluents Representational frame problem: Size of knowledge base should depend on number of actions and effects, not fluents: O(AE) Inferential frame problem: Updates / prediction of t steps in O(Et) time © D. Weld, D. Fox

Representational Frame Problem Naïve solution O(AF): At(o,x,s)  (o Agent)  ¬Holding(o,s)  At(o,x,Result(Go(y,z),s)) Successor-state axioms (Ray Reiter, ’91) O(AE,F): Action possible  (fluent true in result state  Action’s effect made it true v It was true before and action didn’t change it) Poss(a,s)  (At(Agent,y,Result(a,s)  a = Go(x,y) v (At(Agent,y,s)  a Go(y,z))) Poss(a,s)  Fi(Result(a,s))  (a = A1v a = A2v …) v Fi(s)  a A3  a A4 …) © D. Weld, D. Fox

GOLOG Cognitive robotics Robot programming language based on Situation Calculus Extensions can handle concurrent actions, stochastic environments, and sensing Still too inefficient due to generality © D. Weld, D. Fox

GOLOG Application © D. Weld, D. Fox

Planning Given find a logical description of the initial situation, a logical description of the goal conditions, and a logical description of a set of possible actions, find a sequence of actions (a plan of action) that brings us from the initial situation to a situation in which the goal conditions hold. © D. Weld, D. Fox

Input Representation Description of initial state of world E.g., Set of propositions: ((block a) (block b) (block c) (on-table a) (on-table b) (clear a) (clear b) (clear c) (arm-empty)) Description of goal: i.e. set of worlds E.g., Logical conjunction Any world satisfying conjunction is a goal (and (on a b) (on b c))) Description of available actions © D. Weld, D. Fox

Planning vs. Problem-Solving Basic difference: Explicit, logic-based representation States/Situations: descriptions of the world by logical formulae vs. data structures  agent can explicitly reason about and communicate with the world. Goal conditions as logical formulae vs. goal test (black box)  agent can reflect on its goals. Operators: Axioms or transformation on formulae vs. modification of data structures by programs  agent can gain information about the effects of actions by inspecting the operators. © D. Weld, D. Fox

Searching in State Space We could search through the state space and thereby reduce planning to searching. We can search forwards (progression planning): Or alternatively, we can start at the goal and work backwards (regression planning). Possible since the operators provide enough information © D. Weld, D. Fox

Ways to make “plans” Generative Planning Case-Based Planning Reason from first principles (knowledge of actions) Requires formal model of actions Case-Based Planning Retrieve old plan which worked on similar problem Revise retrieved plan for this problem Reinforcement Learning Act ”randomly” - noticing effects Learn reward, action models, policy © D. Weld, D. Fox

Simplifying Assumptions Environment Static vs. Dynamic Fully Observable Partially Observable Deterministic Stochastic Instantaneous Durative Full vs. Partial satisfaction Perfect Noisy What action next? Percepts Actions © D. Weld, D. Fox

Classical Planning Environment Static Instantaneous Deterministic Perfect Fully Observable Full Oi (prec) (effects) I = initial state G = goal state [ I ] Oi Oj Ok Om [ G ] © D. Weld, D. Fox

How Represent Actions? Simplifying assumptions STRIPS representation Atomic time Agent is omniscient (no sensing necessary). Agent is sole cause of change Actions have deterministic effects STRIPS representation World = set of true propositions (conjunction) Actions: Precondition: (conjunction of positive literals, ground, no functions) Effects (conjunction of literals, ground, no function) Goals = conjunctions (Rich ^ Famous) © D. Weld, D. Fox

STRIPS Actions Action = function: worldState worldState Precondition says where function defined Effects say how to change set of propositions a north11 W0 W1 effect: (and (agent-at 1 2) (not (agent-at 1 1))) north11 precond: (and (agent-at 1 1) (agent-facing north)) © D. Weld, D. Fox

Action Schemata Instead of defining: Define a schema: pickup-A and pickup-B and … Define a schema: (:operator pick-up :parameters ((block ?ob1)) :precondition (and (clear ?ob1) (on-table ?ob1) (arm-empty)) :effect (and (not (clear ?ob1)) (not (on-table ?ob1)) (not (arm-empty)) (holding ?ob1))) © D. Weld, D. Fox

Forward State-Space Search Progression planning Initial state: set of positive ground literals (CWA: literals not appearing are false) Actions: applicable if preconditions satisfied add positive effect literals remove negative effect literals Goal test: checks whether state satisfies goal Step cost: typically 1 © D. Weld, D. Fox

Backward State-Space Search Regression planning Problem: Need to find predecessors of state Problem: Many possible goal states are equally acceptable. From which one does one search? C B A D E D C B A E Initial State is completely defined * * * C B A D E C D A B E © D. Weld, D. Fox

Represents a set of world states Represents a set of world states Regression Let G be a KR sentence (e.g. in logic) Relevance: needs to achieve one subgoal Consistency: does not undo any other subgoal Regressing a goal, G, thru an action, A yields the weakest precondition G’ Such that: if G’ is true before A is executed G is guaranteed to be true afterwards A G’ G precond effect Represents a set of world states Represents a set of world states © D. Weld, D. Fox

Regression Example A G G’ Remove positive effects precond effect (and (clear C) (on-table C) (arm-empty) (on A B)) (and (holding C) (on A B)) pick-up :parameters ((block ?ob1)) :precondition (and (clear ?ob1) (on-table ?ob1) (arm-empty)) :effect (and (not (clear ?ob1)) (not (on-table ?ob1)) (not (arm-empty)) (holding ?ob1))) Remove positive effects Add preconditions for A © D. Weld, D. Fox

Heuristics for State-Space Search Subgoal independence assumption: Cost of solving conjunction is sum of cost of solving each subgoal independently Optimistic: ignores negative interactions Pessimistic: ignores redundancy Relaxed problems: Remove all preconditions from actions and assume subgoal independence  heuristic is number of unsatisfied goals Remove preconditions and negative effects: Goal(A^B^C) Action(X,Effect:A^P) Action(Y,Effect:B^C^Q) Action(Z,Effect:B^P^Q) Set cover problem: NP-hard © D. Weld, D. Fox

Plan = Sequence of Actions? © D. Weld, D. Fox

Searching in Plan Space Instead of searching in state space, can search in space of all plans. Initial state is partial plan containing only start and goal states: Goal state is a complete plan that solves the given problem: © D. Weld, D. Fox

Representation of Partial Order (Non-Linear) Plans During search, plan is represented by sets of actions (empty plan is Start and Finish only) ordering constraints (A<B: A before B) causal links Ai  Aj means “Ai produces the precondition c for Aj” open preconditions (not yet achieved preconditions) variable assignments x = t, where x is a variable and t is a constant or a variable. Solutions to planning problems must be complete and consistent. c © D. Weld, D. Fox

Completeness and Consistency Complete: Every precondition of every step is fulfilled Consistent: No cycles in ordering constraints and no conflicts with causal links Shoe example solution: Actions: { RightSock, RightShoe, LeftSock, LeftShoe, Start, Finish} Orderings: { RightSock < RightShoe, LeftSock < LeftShoe} Links: { RightSock  RightShoe, LeftSock  LeftShoe, RightShoe  Finish, LeftShoe  Finish} OpenPreconditions: {} RightSockOn LeftSockOn RightShoeOn LeftShoeOn © D. Weld, D. Fox

Searching in Plan Space Successor function: (plan refinement) pick open precondition p and check all actions that generate p consistency: add causal link and ordering constraint(s) check whether there are potential conflicts (clobberers) and try to protect violated links Goal test: No open preconditions © D. Weld, D. Fox

Protection of Causal Links (a) Conflict: S3 threatens the causal link between S1 and S2. Conflict solutions: (b) Demotion: Place threatening step before causal link (c) Promotion: Place threatening step after causal link © D. Weld, D. Fox

Blocks World Example © D. Weld, D. Fox

Blocks World Example © D. Weld, D. Fox

Blocks World Example © D. Weld, D. Fox

Blocks World Example © D. Weld, D. Fox

Blocks World Example © D. Weld, D. Fox

POP Algorithm Correctness: Every result of the POP algorithm is a complete, correct plan. Completeness: If breadth-first-search is used, the algorithm finds a solution, given one exists. © D. Weld, D. Fox

GraphPlan: Basic idea Construct a graph that encodes constraints on possible plans Use this “planning graph” to constrain search for a valid plan: If valid plan exists, it’s a subgraph of the planning graph Planning graph can be built for each problem in polynomial time © D. Weld, D. Fox

Problems handled by GraphPlan* Pure STRIPS operators: conjunctive preconditions no negated preconditions no conditional effects no universal effects Finds “shortest parallel plan” Sound, complete and will terminate with failure if there is no plan. *Version in [Blum& Furst IJCAI 95, AIJ 97], later extended to handle all these restrictions [Koehler et al 97] © D. Weld, D. Fox

Graphplan Phase 1 - Graph Expansion Phase 2 - Solution Extraction Necessary (insufficient) conditions for plan existence Local consistency of plan-as-CSP Phase 2 - Solution Extraction Variables action execution at a time point Constraints goals, subgoals achieved no side-effects between actions © D. Weld, D. Fox

The Plan Graph … Note: a few noops missing for clarity propositions actions actions actions level 0 level 2 level 4 level 6 level 1 level 3 level 5 … Note: a few noops missing for clarity © D. Weld, D. Fox

Graph Expansion Proposition level 0 Action level i Proposition level i initial conditions Action level i no-op for each proposition at level i-1 action for each operator instance whose preconditions exist at level i-1 Proposition level i effects of each no-op and action at level i i-1 i i+1 … … … … © D. Weld, D. Fox

Mutual Exclusion Two actions are mutex if Two proposition are mutex if one clobbers the other’s effects or preconditions they have mutex preconditions Two proposition are mutex if one is the negation of the other all ways of achieving them are mutex p p p p © D. Weld, D. Fox

Graphplan Create level 0 in planning graph Loop If goal  contents of highest level (nonmutex) Then search graph for solution If find a solution then return and terminate Else extend graph one more level A kind of double search: forward direction checks necessary (but insufficient) conditions for a solution, ... Backward search verifies... © D. Weld, D. Fox

Searching for a Solution Plan Backward chain on the planning graph Achieve goals level by level At level k, pick a subset of non-mutex actions to achieve current goals. Their preconditions become the goals for k-1 level. Build goal subset by picking each goal and choosing an action to add. Use one already selected if possible. Do forward checking on remaining goals (backtrack if can’t pick non-mutex action) © D. Weld, D. Fox

Searching for a Solution If goals are present & non-mutex: Choose action to achieve each goal Add preconditions to next goal set © D. Weld, D. Fox

Dinner Date Initial Conditions: (:and (cleanHands) (quiet)) Goal: (:and (noGarbage) (dinner) (present)) Actions: (:operator carry :precondition :effect (:and (noGarbage) (:not (cleanHands))) (:operator dolly :precondition :effect (:and (noGarbage) (:not (quiet))) (:operator cook :precondition (cleanHands) :effect (dinner)) (:operator wrap :precondition (quiet) :effect (present)) © D. Weld, D. Fox

Planning Graph cleanH quiet noGarb cleanH quiet dinner present carry dolly cook wrap 0 Prop 1 Action 2 Prop 3 Action 4 Prop © D. Weld, D. Fox

Are there any exclusions? cleanH quiet noGarb cleanH quiet dinner present carry dolly cook wrap 0 Prop 1 Action 2 Prop 3 Action 4 Prop © D. Weld, D. Fox

Do we have a solution? cleanH quiet noGarb cleanH quiet dinner present carry dolly cook wrap 0 Prop 1 Action 2 Prop 3 Action 4 Prop © D. Weld, D. Fox

Extend the Planning Graph cleanH quiet noGarb cleanH quiet dinner present noGarb cleanH quiet dinner present carry dolly cook wrap carry dolly cook wrap 0 Prop 1 Action 2 Prop 3 Action 4 Prop © D. Weld, D. Fox

Searching Backwards cleanH quiet noGarb cleanH quiet dinner present carry dolly cook wrap carry dolly cook wrap 0 Prop 1 Action 2 Prop 3 Action 4 Prop © D. Weld, D. Fox

One (of 4) Possibilities cleanH quiet noGarb cleanH quiet dinner present noGarb cleanH quiet dinner present carry dolly cook wrap carry dolly cook wrap 0 Prop 1 Action 2 Prop 3 Action 4 Prop © D. Weld, D. Fox

One (of 4) possibilities cleanH quiet noGarb cleanH quiet dinner present noGarb cleanH quiet dinner present carry dolly cook wrap carry dolly cook wrap 0 Prop 1 Action 2 Prop 3 Action 4 Prop © D. Weld, D. Fox

Propositions monotonically increase (always carried forward by no-ops) Observation 1 p ¬q ¬r p q ¬q ¬r p q ¬q r ¬r p q ¬q r ¬r A A A B B Propositions monotonically increase (always carried forward by no-ops) © D. Weld, D. Fox

Observation 2 Actions monotonically increase p ¬q ¬r p q ¬q ¬r p q ¬q © D. Weld, D. Fox

Observation 3 Proposition mutex relationships monotonically decrease p q r … p q r … p q r … A Proposition mutex relationships monotonically decrease © D. Weld, D. Fox

Observation 4 Action mutex relationships monotonically decrease A A A q … p q r s … p q r s … p q r s … B B B C C C Action mutex relationships monotonically decrease © D. Weld, D. Fox

Observation 5 Planning Graph ‘levels off’. After some time k all levels are identical Because it’s a finite space, the set of literals never decreases and mutexes don’t reappear. © D. Weld, D. Fox

Planning Summary Problem solving algorithms that operate on explicit propositional representations of states and actions. Make use of specific heuristics. STRIPS: restrictive propositional language State-space search: forward (progression) / backward (regression) search Partial order planners search space of plans from goal to start, adding actions to achieve goals GraphPlan: Generates planning graph to guide backwards search for plan SATplan: Converts planning problem into propositional axioms. Uses SAT solver to find plan. © D. Weld, D. Fox