Planning, page 1 CSI 4106, Winter 2005 Planning Points Elements of a planning problem Planning as resolution Conditional plans Actions as preconditions.

Slides:



Advertisements
Similar presentations
Artificial Intelligence
Advertisements

Automated Theorem Proving Lecture 1. Program verification is undecidable! Given program P and specification S, does P satisfy S?
Planning.
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
CSE391 – 2005 NLP 1 Planning The Planning problem Planning with State-space search.
1 Planning Chapter CMSC 471 Adapted from slides by Tim Finin and Marie desJardins. Some material adopted from notes by Andreas Geyer-Schulz,
Comparative Succinctness of KR Formalisms Paolo Liberatore.
Inference Rules Universal Instantiation Existential Generalization
Planning II: Partial Order 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.
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
PLANNING Ivan Bratko Acknowledgement: Some of these slides were adapted from D. Nau’s course on planning.
Inference and Reasoning. Basic Idea Given a set of statements, does a new statement logically follow from this. For example If an animal has wings and.
Logic Use mathematical deduction to derive new knowledge.
13 Automated Reasoning 13.0 Introduction to Weak Methods in Theorem Proving 13.1 The General Problem Solver and Difference Tables 13.2 Resolution.
Methods of Proof Chapter 7, Part II. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound) generation.
Logic CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
F22H1 Logic and Proof Week 7 Clausal Form and Resolution.
Copyright © 2006 Addison-Wesley. All rights reserved.1-1 ICS 410: Programming Languages Chapter 3 : Describing Syntax and Semantics Axiomatic Semantics.
Planning Search vs. planning STRIPS operators Partial-order planning.
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
Formal Logic Proof Methods Direct Proof / Natural Deduction Conditional Proof (Implication Introduction) Reductio ad Absurdum Resolution Refutation.
Artificial Intelligence 2005/06
Planning Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 11.
CS 460, Session 20 1 Planning Search vs. planning STRIPS operators Partial-order planning.
Artificial Intelligence Chapter 11: Planning
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
1 Automated Reasoning Introduction to Weak Methods in Theorem Proving 13.1The General Problem Solver and Difference Tables 13.2Resolution Theorem.
1 Planning. R. Dearden 2007/8 Exam Format  4 questions You must do all questions There is choice within some of the questions  Learning Outcomes: 1.Explain.
Axiomatic Semantics Dr. M Al-Mulhem ICS
CS 561, Session Planning Search vs. planning STRIPS operators Partial-order planning.
Artificial Intelligence 2005/06 Planning: STRIPS.
Knoweldge Representation & Reasoning
Planning Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 11.
Dr. Muhammed Al-Mulhem 1ICS ICS 535 Design and Implementation of Programming Languages Part 1 Fundamentals (Chapter 4) Axiomatic Semantics ICS 535.
1 First order theories. 2 Satisfiability The classic SAT problem: given a propositional formula , is  satisfiable ? Example:  Let x 1,x 2 be propositional.
PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2.
Reading and Writing Mathematical Proofs
Nonlinear Planning Lecture Module 9. Nonlinear Planning with Goal Set Generate a plan by doing some work on one goal, then some on another and then some.
MATH 224 – Discrete Mathematics
22/11/04 AIPP Lecture 16: More Planning and Operators1 More Planning Artificial Intelligence Programming in Prolog.
CS.462 Artificial Intelligence SOMCHAI THANGSATHITYANGKUL Lecture 07 : Planning.
CSI 3125, Axiomatic Semantics, page 1 Axiomatic semantics The assignment statement Statement composition The "if-then-else" statement The "while" statement.
Knowledge and search, page 1 CSI 4106, Winter 2005 Knowledge and search Points Properties of knowledge  Completeness  Objectivity  Certainty  Formalizability.
CS Introduction to AI Tutorial 8 Resolution Tutorial 8 Resolution.
For Friday No reading Homework: –Chapter 11, exercise 4.
COP4020 Programming Languages Introduction to Axiomatic Semantics Prof. Robert van Engelen.
Automated Reasoning Early AI explored how to automated several reasoning tasks – these were solved by what we might call weak problem solving methods as.
Automated Reasoning Early AI explored how to automate several reasoning tasks – these were solved by what we might call weak problem solving methods as.
Introduction to Planning Dr. Shazzad Hosain Department of EECS North South Universtiy
Advanced Problem Solving Systems: Planning  In order to solve nontrivial problems, it is necessary to combine 1.Basic problem solving strategies 2.Knowledge.
Advanced Problem Solving Systems: Planning Lecture Module 8.
AI Lecture 17 Planning Noémie Elhadad (substituting for Prof. McKeown)
Planning I: Total Order Planners Sections
1 Propositional Logic Limits The expressive power of propositional logic is limited. The assumption is that everything can be expressed by simple facts.
Planning in FOL Systems sequences of actions to achieve goals.
Artificial Intelligence 2004 Planning: Situation Calculus Review STRIPS POP Hierarchical Planning Situation Calculus (John McCarthy) situations.
Knowledge Repn. & Reasoning Lecture #9: Propositional Logic UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2005.
Planning Search vs. planning STRIPS operators Partial-order planning
Introduction Defining the Problem as a State Space Search.
Planning Search vs. planning STRIPS operators Partial-order planning
Planning Search vs. planning STRIPS operators Partial-order planning
Axiomatic semantics Points to discuss: The assignment statement
Graph-based Planning Slides based on material from: Prof. Maria Fox
Programming Languages and Compilers (CS 421)
RESOLUTION.
Presentation transcript:

Planning, page 1 CSI 4106, Winter 2005 Planning Points Elements of a planning problem Planning as resolution Conditional plans Actions as preconditions and effects Goal regression

Planning, page 2 CSI 4106, Winter 2005 Elements of a planning problem When is a problem a good application for planning? It can be decomposed into subproblems in such a way that solving each subproblem (in some order) solves the whole problem. It is conjunctive, that is, it can be expressed as a conjunction of conditions, each representing an elementary aspect if the world, the initial situation, the final situation. Each subproblem can be reduced to facts about domain objects, and relations among such objects.

Planning, page 3 CSI 4106, Winter 2005 Elements of a planning problem (2) States, state spaces. Actions with preconditions and postconditions. An action is a function from states to states. It makes local changes that affect few objects. Actions are generic, facts are specific. Actions are elementary: one-step plans. A design decision: granularity of actions. Conditional actions: If( C, A1, A2 ). Frame axioms and the Closed World Assumption. The timing of actions: is a real-time plan needed, or do we only need a sequence of actions with relative time?

Planning, page 4 CSI 4106, Winter 2005 Elements of a planning problem (3) A plan is a sequence of actions that lead from an initial state to a goal state. In a linear plan, the actions required to solve a subproblem precede the actions required to solve the next subproblem. In a non-linear plan, actions for subproblems may be (or even may have to be) interleaved. Optimality of plans: a simple criterion is the number of actions. A plan may be executed either “in batch mode” (after the whole plan has been created), or with every action performed immediately (with feedback for more planning).

Planning, page 5 CSI 4106, Winter 2005 Elements of a planning problem (4) A formal representation of plans may look, for example, like this: Do( Action 3, Do( Action 2, Do( Action 1, init ) ) ) where init denotes an initial state. There are two ways of implementing state changes (we must be able to undo such changes, because planning algorithms usually backtrack). Explicit changes in the knowledge base. Implicit changes, not in the knowledge base but only in the plan representation, recomputed as needed (this is costly, but undoing is easier).

Planning, page 6 CSI 4106, Winter 2005 Planning as resolution The blocks world (find its description in any textbook ) T( p, s ) means "predicate p is true in state s" Elementary conditions: On, OnTbl and Clear. Examples of actions: Stack, Unstack and NoOp. T( OnTbl( x ), s )  T( Clear( x ), s )  T( Clear( y ), s )  x ≠ y  T( On( x, y ), Do( Stack( x, y ), s ) ) T( On( x, y ), s )  T( Clear( x ), s )  T( OnTbl( x ), Do( Unstack( x, y ), s ) )  T( Clear( y ), Do( Unstack( x, y ), s ) ) T( p, s )  T( p, Do( NoOp, s ) )

Planning, page 7 CSI 4106, Winter 2005 Planning as resolution (2) On means “sitting on another block”. OnTbl means “sitting on the table”. Some facts about this worlds are always true. For example: T( OnTbl( x ), s )    y T( On( x, y ), s)[=] Frame axioms — two examples: T( Clear( u ), s )  u ≠ y  T( Clear( u ), Do( Stack( x, y ), s ) ) T( On( u, w ), s )  u ≠ x  T( On( u, w ), Do( Unstack( x, y ), s ) )

Planning, page 8 CSI 4106, Winter 2005 Planning as resolution (3) An initial state T( Clear( C ), S 0 )T( On( C, A ), S 0 ) T( Clear( B ), S 0 ) T( OnTbl( A ), S 0 )T( OnTbl( B ), S 0 ) Another (possibly final) state T( Clear( A ), S 1 )T( On( A, B ), S 1 ) T( On( B, C ), S 1 )T( OnTbl( C ), S 1 ) A B C S1S1 AB C S0S0

Planning, page 9 CSI 4106, Winter 2005 Planning as resolution (4) We want to prove that T( OnTbl( A ), t ) given S 1. We assume that we can do it in one action , so that state t should look like Do( , S 1 ). If this is not possible, we will try Do( , Do( , S 1 ) ), Do( , Do( , Do( , S 1 ) ) ), and so on. Let’s negate the fact that we want proven.  T( OnTbl( A ), Do( , S 1 ) ) Action  could be Unstack. That is because one of the clauses in its clausal-form definition is this:  T( On( x, y ), s ),  T( Clear( x ), s ), T( OnTbl( x ), Do( Unstack( x, y ), s ) ) Plan construction by resolution (a very simple example)

Planning, page 10 CSI 4106, Winter 2005 Planning as resolution (5)  T( OnTbl( A ), Do( , S 1 ) ) T( OnTbl( x ), Do( Unstack( x, y ), s ) ),  T( On( x, y ), s ),  T( Clear( x ), s ) This gives  T( On( A, y ), S 1 ),  T( Clear( A ), S 1 ) after assigning x  A, s  S 1,   Unstack( A, y ). This is given: T( On( A, B ), S 1 ). We resolve and get  T( Clear( A ), S 1 ) with y  B. This too is given: T( Clear( A ), S 1 ). so we produce the empty resolvent: done. t  Do( , S 1 ) = Do( Unstack( A, B ), S 1 ) Plan construction by resolution (continued)

Planning, page 11 CSI 4106, Winter 2005 Conditional plans Let T( Clear( A ), S 2 ) be the only given fact. We can find a plan for the goal T( OnTbl( A ), Do( , S 2 ) ) even though the problem is under-constrained. Axioms for conditional actions T( p, s )  T( q, Do( , s ) )  T( q, Do( If( p, ,  ), s ) ) ¬ T( p, s )  T( q, Do( , s ) )  T( q, Do( If( p, ,  ), s ) ) Again, we begin by assuming a one-step plan, but now it will be a conditional plan.

Planning, page 12 CSI 4106, Winter 2005 Conditional plans (2) ¬ T( OnTbl( A ), Do( , S 2 ) ) Assume   If( p, ,  ). ¬ T( OnTbl( A ), Do( If( p, ,  ), S 2 ) ) The first axiom as a clause:[+] T( q, Do( If( p, ,  ), s ) ), ¬ T( p, s ), ¬ T( q, Do( , s ) ) Resolve with q  OnTbl( A ), s  S 2 and get ¬ T( p, S 2 ), ¬ T( OnTbl( A ), Do( , S 2 ) ) We need again that axiom for Unstack: T( OnTbl( x ), Do( Unstack( x, y ), s ) ),  T( On( x, y ), s ),  T( Clear( x ), s )

Planning, page 13 CSI 4106, Winter 2005 Conditional plans (3) ¬ T( p, S 2 ), ¬ T( OnTbl( A ), Do( , S 2 ) ) T( OnTbl( x ), Do( Unstack( x, y ), s ) ),  T( On( x, y ), s ),  T( Clear( x ), s ) With x  A,   Unstack( A, y ), s  S 2 we get ¬ T( p, S 2 ),  T( On( A, y ), S 2 ),  T( Clear( A ), S 2 ) We resolve this with our only fact: ¬ T( p, S 2 ),  T( On( A, y ), S 2 )... and this is it. We need something new to move on. One possibility is factoring: look for matching literals on the resolvent. Here we can assign p  On( A, y ) and reduce the resolvent to  T( On( A, y ), S 2 ).

Planning, page 14 CSI 4106, Winter 2005 Conditional plans (4) We can conclude the proof if we assume T( On( A, y ), S 2 ) Here, the conditional nature of the plan helps. We combine everything we have found so far. Our one-action plan looks like this: Do( If( On( A, y ), Unstack( A, y ),  ), S 2 ) To also determine , we return to the point marked [+] and look at the second axiom for conditional actions: T( q, Do( If( p, ,  ), s ) ), T( p, s ), ¬ T( q, Do( , s ) ) ¬ T( OnTbl( A ), Do( , S 2 ) ) Resolve with q  OnTbl( A ), s  S 2 and get T( p, S 2 ), ¬ T( OnTbl( A ), Do( , S 2 ) )

Planning, page 15 CSI 4106, Winter 2005 Conditional plans (5) T( p, S 2 ), ¬ T( OnTbl( A ), Do( , S 2 ) ) The clausal form of action NoOp: ¬ T( p, s ), T( p, Do( NoOp, s ) ) Assign p  OnTbl( A ),   NoOp and get this: T( p, S 2 ), ¬ T( OnTbl( A ), S 2 ) It is time to recall that useful fact [=] about OnTbl: T( OnTbl( x ), s )    y T( On( x, y ), s) So, we can replace one side with the other: T( p, S 2 ),  y T( On( A, y ), S 2 ) Skolemize (  is the Skolem constant): T( p, S 2 ), T( On( A,  ), S 2 )

Planning, page 16 CSI 4106, Winter 2005 Conditional plans (6) T( p, S 2 ), T( On( A,  ), S 2 ) We perform factorization, assigning p  On( A,  ): T( On( A,  ), S 2 ) To conclude the second part of the proof, we assume  T( On( A,  ), S 2 ) Now, our one-action plan is either of these: Do( If( On( A, y ), Unstack( A, y ),  ), S 2 ) Do( If( On( A,  ), , NoOp ), S 2 ) We can finally put these partial plans together: Do( If( On( A,  ), Unstack( A,  ), NoOp ), S 2 )

Planning, page 17 CSI 4106, Winter 2005 Another representation of actions Preconditions of an action + facts added (made true) by this action + facts deleted (made false) by this action. Pre( Unstack( x, y ) )={ On( x, y ), Clear( x ) } Add( Unstack( x, y ) )={ OnTbl( x ), Clear( y ) } Del( Unstack( x, y ) )={ On( x, y ) } The Closed World Assumption serves as the frame axiom: facts not on the Add list and on the Del list are by default preserved. A state is represented as a set of facts, for example: { OnTbl( A ), OnTbl( B ) }

Planning, page 18 CSI 4106, Winter 2005 Goal regression Reduce one of the goals to its subgoal or subgoals. This means working backward from a state to a state by looking at the preconditions and effects of some action. Let Regr( q,  ) be a state achieved by regression from q through  (“undoing” the effects of  ).  cannot delete a fact that must be true in q: q  Del(  ) = Ø If  has this property, we can define: Regr( q,  ) = Pre(  )  (q — Add(  ) ) So: keep the preconditions of , undo the effects of .

Planning, page 19 CSI 4106, Winter 2005 Goal regression (2) Example If we begin with { OnTbl( A ), OnTbl( B ) } we can “recreate” { Clear( A ), On( A, B ), OnTbl( B ) } by regression through Unstack( A, B ). Protection violation Actions for a subproblem must not undo the effects of earlier actions for already solved subproblems.

Planning, page 20 CSI 4106, Winter 2005 A planning strategy for conjunctive problems Going left to right, make a plan for each conjunct and freeze the effects (put the added or preserved goals on a list of protected goals). This simple method is weak. It will not work even for the following trivial problem. S initial On( C, A )  OnTbl( A )  OnTbl( B ) S final On( C, A )  On( A, B ) On( C, A ) is true in S initial and must be protected. But: it must be temporarily destroyed to achieve On( A, B ). Goal protection makes planning impossible. Here, rearrangement helps: On( A, B )  On( C, A ) “works”. In general non-linear planning is necessary. One such a smarter planner is Warplan.Warplan