Notes 10: Planning; STRIPs Planning Systems ICS 271 Fall 2008.

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 II: Partial Order Planning
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]
Artificial Intelligence Chapter 21 The Situation Calculus Biointelligence Lab School of Computer Sci. & Eng. Seoul National University.
Plan Generation & Causal-Link Planning 1 José Luis Ambite.
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.
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.
Artificial Intelligence 2005/06
Planning Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 11.
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
Planning Russell and Norvig: Chapter 11. Planning Agent environment agent ? sensors actuators A1A2A3.
Planning: Part 3 Planning Graphs COMP151 April 4, 2007.
Artificial Intelligence 2005/06 Planning: STRIPS.
Planning: Part 1 Representation and State-space Search COMP151 March 30, 2007.
Planning Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 11.
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 II CSE 573. © Daniel S. Weld 2 Logistics Reading for Wed Ch 18 thru 18.3 Office Hours No Office Hour Today.
PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2.
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.
April 3, 2006AI: Chapter 11: Planning1 Artificial Intelligence Chapter 11: Planning Michael Scherger Department of Computer Science Kent State University.
Homework 1 ( Written Portion )  Max : 75  Min : 38  Avg : 57.6  Median : 58 (77%)
Planning, page 1 CSI 4106, Winter 2005 Planning Points Elements of a planning problem Planning as resolution Conditional plans Actions as preconditions.
Planning (Chapter 10)
Midterm Review Prateek Tandon, John Dickerson. Basic Uninformed Search (Summary) b = branching factor d = depth of shallowest goal state m = depth of.
First-Order Logic and Plans Reading: C. 11 (Plans)
For Monday Read chapter 12, sections 1-2 Homework: –Chapter 10, exercise 3.
Artificial Intelligence Chapter 22 Planning Biointelligence Lab School of Computer Sci. & Eng. Seoul National University.
CPS 270: Artificial Intelligence Planning Instructor: Vincent Conitzer.
1 Search vs. planning Situation calculus STRIPS operators Search vs. planning Situation calculus STRIPS operators.
Computing & Information Sciences Kansas State University Lecture 21 of 42 CIS 530 / 730 Artificial Intelligence Lecture 21 of 42 Planning: Graph Planning.
CPS 570: Artificial Intelligence Planning Instructor: Vincent Conitzer.
Automated Reasoning Early AI explored how to automated several reasoning tasks – these were solved by what we might call weak problem solving methods as.
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.
Introduction to Planning Dr. Shazzad Hosain Department of EECS North South Universtiy
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)
Notes 9: Planning; Strips Planning Systems ICS 270a Spring 2003.
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.
1 Propositional Logic Limits The expressive power of propositional logic is limited. The assumption is that everything can be expressed by simple facts.
April 3, 2006AI: Chapter 11: Planning1 Artificial Intelligence Chapter 11: Planning.
Planning in FOL Systems sequences of actions to achieve goals.
The situation calculus K. V. S. Prasad Notes for TIN171/DIT410 (Friday, 26 March 2010) Based on Nils Nilsson, “Artificial Intelligence: a new synthesis”,
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
Artificial Intelligence 2004 Planning: Situation Calculus Review STRIPS POP Hierarchical Planning Situation Calculus (John McCarthy) situations.
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
CLASSICAL PLANNING. Outline  The challenges in planning with standard search algorithm  Representing Plans – the PDDL language  Planning as state -
L9. Planning Agents L7_exAnswer and explanation Review
Class #17 – Thursday, October 27
Graphplan/ SATPlan Chapter
L11. Planning Agents and STRIPS
Planning Problems On(C, A)‏ On(A, Table)‏ On(B, Table)‏ Clear(C)‏
Class #19 – Monday, November 3
Artificial Intelligence Chapter 21. The Situation Calculus
Graphplan/ SATPlan Chapter
Graphplan/ SATPlan Chapter
GraphPlan Jim Blythe.
Presentation transcript:

Notes 10: Planning; STRIPs Planning Systems ICS 271 Fall 2008

Outline: Planning  Situation Calculus  STRIPS Planning  Partial order planning  Planning graphs  Readings: Russel andNorvig chapter 11, Nillson’s Chapters 21-22

The Situation Calculus  A goal can be described by a sentence (wff): if we want to have a block on B  Planning: finding a set of actions to achieve a goal wff.  Situation Calculus (McCarthy, Hayes, 1969, Green 1969) A Predicate Calculus formalization of states, actions, and their effects. S o state in the figure can be described by: we reify the state and include them as arguments

The Situation Calculus (continued)  The atoms denotes relations over states called fluents.  We can also have.  Knowledge about state and actions = predicate calculus theory.  Inferene can be used to answer: Is there a state satisfying a goal? How can the present state be transformed into that state by actions? The answer is a plan

Representing Actions  Reify the actions: denote an action by a symbol  actions are functions  move(B,A,F1): move block A from block B to F1  move (x,y,z) - action schema  do: A function constant, do denotes a function that maps actions and states into states action state

Representing Actions (continued)  Express the effects of actions. Example: (on, move) (expresses the effect of move on “On”) Positive effect axiom: Positive: describes how action makes a fluent true Negative : describes how action makes a fluent false Antecedent: pre-condition for actions Consequent: how the fluent is changed

Representing Actions (continued)  Effect axioms for (clear, move): (move(x,y,z))  Precondition are satisfied with  B/x, A/y, S0/s, F1/z  What was true in S0 remains true. figure 21

Frame Axioms  Not everything true can be inferred On(C,F1) remains true but cannot be inferred  Actions have local effect We need frame axioms for each action and each fluent that does not change as a result of the action example: frame axioms for (move, on) If a block is on another block and move is not relevant, it will stay the same.  Positive:  negative

Frame Axioms (continued) Frame axioms for (move, clear): The frame problem: need axioms for every pair of {action, fluent}!!! There are languages that embed some assumption on frame axioms that can be derived automatically:  Default logic  Negation as failure  Nonmonotonic reasoning  Minimizing change

Other problems  The qualification problem: qualifying the antecedent for all possible exception. Needs to enumerate all exceptions ~heavy and ~glued and ~armbroken  can-move ~bird and ~cast-in-concrete and ~dead…  flies  Solutions: default logics, Non-monotonic logics  The ramification problem: If a robot carries a package, the package will be where the robot is. But what about the frame axiom, when can we infer about the effect of the actions and when we cannot.

Generating plans  To generate a plan to achieve a goal, we attempt to prove  Example: Get block B on the floor from S0.  Prove:  By resolution refutation: add forall s not On(B,F1,s)  (page 370 top, try it)

Proof  ~On(B,F1,s) v Ans(s)  On(B,A,S0)  On(A,C,S0)  On(C,F1,S0)  Clear(B,S0)  Clear(F1,S0)  [On(x,y,s) /\ Clear(x,s) /\ Clear(z,s)/\(x not equal y)  On(x,z,do(move(x,y,z),s))]  (inequality is negation of equality and we assume infinite supply of (A=A))

Alternative to frame problem STRIPS Planning systems

STRIPS: describing goals and state  On(B,A)  On(A,C)  On(C,F1)  Clear(B)  Clear(F1)  The formula describes a set of world states  Planning search for a formula satisfying a goal description  State descriptions: conjunctions of ground literals.  Also universal formulas: On(x,y)  (y=F1) or ~Clear(y)  Goal wff:  Given a goal wff, the search algorithm looks for a sequence of actions That transform into a state description that entails the goal wff.

STRIPS Description of Operators  A STRIPS operator has 3 parts: A set, PC (preconditions) of ground literals A set D, of ground literals called the delete list A set A, of ground literals called add list  Usually described by Schema: Move(x,y,z) PC: On(x,y) and Clear(x) and Clear(z) D: Clear(z), On(x,y) A: On(x,z), Clear(y), Clear(F1)  A state S1 is created applying operator O by adding A and deleting D from S1.

Example: the move operator

Strips vs ADL language (ADL: Action Description Language)

STRIPS formulation for transportation problem In(c,p)- cargo c is inside plane p At(x,a) – object x is at airport a

STRIP for spare tire problem

The block world

Planning forward and backwords

Forward Search Methods: can use A* with some h and g

Recursive STRIPS  Forward search with islands:  Achieve one subgoal at a time. Achieve a new conjunct without ever violating already achieved conjuncts or maybe temporarily violating previous subgoals.  General Problem Solver (GPS) by Newell Shaw and Simon (1959) uses Means-Ends analysis.  Each subgoal is achieved via a matched rule, then its preconditions are subgoals and so on. This leads to a planner called STRIPS(gamma) when gamma is a goal formula.

STRIPS algorithm  Given a goal stack:  1. Consider the top goal  2. Find a sequence of actions satisfying the goal from the current state and apply them.  3. The next goal is considered from the new state.  4. Temination: stack empty  5. Check goals again.

The Sussman annomaly  RSTRIPS cannot achieve shortest plan  Two possible orderings of subgoals: On(A,B) and On(B,C) or On(B,C) and On(A,B)

Backward search methods;  Regressing a ground operator

Regressing an ungrounded operator

Example of Backward Search

Heuristics for state-space search  Use relax problem idea to get lower bounds on least number of actions to the goal. Remove all or some preconditions  Subgoal independence: the cost of solving a set of subgoals equal the sum cost of solving each one independently. Can be pesimistic (interacting subplans) Can be optimistic (negative effects)  Simple: number of unsatisfied subgoals.  Various ideas related to removing negative effects or positive effects.

Partial order planning  Least commitment planning  Nonlinear planning  Search in the space of partial plans  A state is a partial incomplete partially ordered plan  Operators transform plans to other plans by: Adding steps Reordering Grounding variables  SNLP: Systematic Nonlinear Planning (McAllester and Rosenblitt 1991)  NONLIN (Tate 1977)

A partial order plan for putting shoes and socks

State-space vs Plan-space search

Plan-Transforming Operators

STRIPS RULES  Graph structure  Oval nodes are operators  Boxed: preconditions  Boxed: effects

Goal and Initials states are rules  Example: Sussman  Initial plan

The next Plan structure  A possible transformation: add a rule to achieve one of the conjuncts: On(A,B)

A subsequent Plan structure  Attempt to Clear(A) by: move(u,A,v)  Then instantiate u to C and V to F1 and add correspondence links.  Preconditions of moves are established. Order constraint b < a

Achieving next subgoal: On(B,C)  Add move(B,z,C)  Instantiate z to F1

Add Threat arcs  An arc from an operator to precondition if the operator can delete a precondition  Complete plan when we find a consistent set of ordering constraints that discharge the threats  We have b<c<a

Heirarchical Planning  ABSTRIPS  (Sacerdoti 1974)  Preconditions, conjuncts  Have criticality numbers  Use high treshold first.  Plan1:  goto(r1,d1,12),goto(r2,d2,r3)  Plan2:  Achieve preconditions of goto1,  Then apply, then achieve preconditions  Of goto2:goto1,ooengto2

Learning Plans  Unstacking two blocks  Remember a macro plan  A triangle table for bock unstacking :  Columns: operators in order of executions  Cell to the left are preconditions, below are add lists  Cell(I,j): literals added by oper(I) and needed by oper(j+1)

A triangle table schema for block unstacking

Solving the flat tire problem by partial planning

The initial partial plan for Spare tire  From initial plan, pick an open precond (At(Spare,Axle)) and choose an applicable action (PutOn))  Pick precond At(Spare,ground) and choose an applicable action Remove(Spare,trunk)

Spare-tire, continued  Pick precond ~At(Flat,Axle) and choose Leaveovernight action.  Because it has ~At(Spare,ground) it conflicts with “Remove”,  We add athreat constraint

Flate-tire, continued  Removeovernight doesn’t work so:  Consider ~At(Flat,Axle) and choose Remove(Flat,axle)  Pick At(Spare,Trunk) precond, and Start to achieve it.

Planning Graphs  A planning graph consists of a sequence of levels that correspond to time-steps in the plan  Level 0 is the initial state.  Each level contains a set of literals and a set of actions  Literals are those that could be true at the time step.  Actions are those that their preconditions could be satisfied at the time step.  Works only for propositional planning.

Example:Have cake and eat it too

The Planning graphs for “have cake”,  Persistence actions: Represent “inactions” by boxes: frame axiom  Mutual exclusions (mutex) are represented between literals and actions.  S1 represents multiple states  Continue until two levels are identical. The graph levels off.  The graph records the impossibility of certain choices using mutex links.  Complexity of graph generation: polynomial in number of literals.

Defining Mutex relations  A mutex relation holds between two actions on the same level iff any of the following holds: Inconsistency effect :one action negates the effect of another. Example “eat cake and presistence of have cake” Interference : One of the effect of one action is the negation of the precondition of the other. Example: eat cake and persistence of Have cake Competing needs: one of the preconditions of one action is mutually exclusive with a precondition of another. Example: Bake(cake) and Eat(Cake). A mutex relation holds between 2 literals at the same level iff one is the negation of the other or if each possible pair of actions that can achieve the 2 literals is mutually exclusive.

Planning graphs for heuristic estimation  Estimate the cost of achieving a goal by the leve in the planning graph where it appears.  To estimate the cost of a conjunction of goals use one of the following:  Max-level: take the maximum level of any goal (admissible)  Sum-cost: Take the sum of levels (inadmissible)  Set-level: find the level where they all appear without Mutex  Graph plans are relaxation of the problem. Rrepresenting more than pair-wise mutex is not cost-effective

The graphplan algorithm

Planning graph for spare tire a S2 goal: at(spare,axle)  S2 has all goals and no mutex so we can try to extract solutions  Use either CSP algorithm with actions as variables  Or search backwards

Search planning-graph backwards with heuristics  How to choose an action during backwards search:  Use greedy algorithm based on the level cost of the literals.  For any set of goals:  1. Pick first the literal with the highest level cost.  2. To achieve the literal, choose the action with the easiest preconditions first (based on sum or max level of precond literals).

Properties of planning graphs; termination  Literals increase monotonically Once a literal is in a level it will persist to the next level  Actions increase monotonically Since the precondition of an action was satisfied at a level and literals persist the action’s precond will be satisfied from now on  Mutexes decrease monotonically: If two actions are mutex at level Si, they will be mutex at all previous levels at which they both appear  Because literals increase and mutex decrease it is guaranteed that we will have a level where all goals are non-mutex

Planning with propositional logic  Express propositional planning as a set of propositions.  Index propositions with time steps:  On(A,B)_0, ON(B,C)_0  Goal conditions: the goal conjuncts at time T, T is determined arbitrarily.  Unknown propositions are not stated.  Propositions known not to be true are stated negatively.  Actions: a proposition for each action for each time slot.  Succesor state axioms need to be expressed for each action (like in the situation calculus but it is propositional)

Planning with propositional logic (continued)  We write the formula: Initial state and succesor state axioms and goal  We search for a model to the formula. Those actions that are assigned true consititute a plan.  To have a single plan we may have a mutual exclusion for all actions in the same time slot.  We can also choose to allow partial order plans and only write exclusions between actions that interfere with each other.  Planning: iteratively try to find longer and longer plans.

SATplan algorithm

Complexity of satplan  The total number of action symbols is: |T|x|Act|x|O|^p O = number of objects, p is scope of atoms.  Number of clauses is higher.  Example: 10 time steps, 12 planes, 30 airports, the complete action exclusion axiom has 583 million clauses.  More information is in project papers

Summary: Planning  Situation Calculus  STRIPS Planning  Forward and backward planning  Partial order planning  Heirarchical planning  Graph planning  Satplan  Readings: Nillson’s Chapters 21-22, RN 11