planning
play

Planning Volker Sorge Intro to AI: Logical Knowledge - PowerPoint PPT Presentation

Intro to AI: Lecture 6 Volker Sorge Background Planning Example Domain: Blocks World Planning Volker Sorge Intro to AI: Logical Knowledge Representation Lecture 6 Volker Sorge Background Planning Example Domain: Blocks World


  1. Intro to AI: Lecture 6 Volker Sorge Background Planning Example Domain: Blocks World Planning Volker Sorge

  2. Intro to AI: Logical Knowledge Representation Lecture 6 Volker Sorge Background Planning Example Domain: Blocks World ◮ Knowledge is represented as logical sentences. ◮ Each sentence is self-contained ◮ Representation is flat

  3. Intro to AI: Advantage of Logic KR Lecture 6 Volker Sorge Background Planning Example Domain: Blocks World ◮ We have reasoning/proof procedures for a knowledge base. ◮ We can easily determine incosistency. ◮ We can infer new conclusions from the given knowledge base or proof the correctness of new propositions.

  4. Intro to AI: Applications of Logic in AI Lecture 6 Volker Sorge Background Planning There are many applications of logic KR and reasoning. For Example Domain: example: Blocks World ◮ Automated Theorem Proving ◮ Constraint Solving ◮ Satisfiability Solving ◮ Description logics for the Semantic Web Some of these will be discussed in the second year module Reasoning. We will have a look at the use of Logic in reprsenting states and operators in AI planning.

  5. Intro to AI: Planning: Introduction Lecture 6 Volker Sorge Background Planning Example Domain: Blocks World ◮ Planning is a type of problem solving where states, goals and actions are declaratively specified in logic. ◮ It generally is concerned with more abstract steps than meticulous search, thereby modelling more closely real world actions and behaviour. ◮ Often subgoals are independent and problems can be solved by divide and conquer.

  6. Intro to AI: Strips Lecture 6 Volker Sorge Background ◮ Initial state and goals logical sentences: conjunction of Planning Example Domain: (negated) predicates. Blocks World ◮ Operators specify general actions by three sets of predicates: ◮ Preconditions: have to hold for operator to be applicable. ◮ Delete list: are deleted when operator is executed. ◮ Add list: are added when operator is executed. ◮ Operators usually contain variables that are instantiated in current state. ◮ Find a sequence of instantiated operators that applied to the start state delivers all the specified goals.

  7. Intro to AI: Plan Construction Lecture 6 Volker Sorge Background We have two basic ways of constructing plans: Planning Example Domain: Forward This is similar to regular search. We apply Blocks World operators to the start state until we fulfill all the conditions of the goal state. Backward We apply operators inversely, to the goal state and then look to satisfy its preconditions. We do this until all the elements in the start state are represented as preconditions. In planning backward search is easier than in normal search, as the preconditions are generally given explicitly, hence we do not have to construct reverse actions first.

  8. Intro to AI: Algorithm: Forward (Progression) Planning Lecture 6 Volker Sorge Input : Set of operators O , Start state s , Goal state g Background Output : Plan P Planning 1 begin Example Domain: Blocks World let P = []; 2 while g �⊆ s do 3 let E = { a | a is ground instance of an operator in O , 4 and Preconditions( a ) hold in s } ; if E = {} then 5 return failure 6 end 7 choose a ∈ E ; 8 let s = s \ DeleteList( a ) ∪ AddList( a ); 9 P = P @[ a ] 10 end 11 return P ; 12 13 end \

  9. Intro to AI: Algorithm: Backward (Regression) Planning Lecture 6 Volker Sorge Background Input : Set of operators O , Start state s , Goal state g Planning Output : Plan P Example Domain: 1 begin Blocks World let P = []; 2 while s �⊆ g do 3 let E = { a | a is ground instance of an operator in O , 4 and AddList( a ) hold in g } ; if E = {} then 5 return failure 6 end 7 choose a ∈ E ; 8 let g = g \ AddList( a ) ∪ Preconditions( a ); 9 P = a :: P 10 end 11 return P ; 12 13 end

  10. Intro to AI: Remarks on the Algorithms Lecture 6 Volker Sorge Background Planning Example Domain: ◮ The notion of a ground instance refers to the Blocks World requirement that for an operator to be applicable all its variables have to be instantiated. ◮ Both algorithms contain a choose command, which effectively is non-deterministic choice. Here we can backtrack to in search or apply heuristics to express preference. ◮ In Backward Planning we use the fact that the delete list is a subset of the preconditions.

  11. Intro to AI: Blocks world: Idea Lecture 6 Volker Sorge Background Planning Example Domain: ◮ This is a classic example. We stack blocks on a table Blocks World using a robotic arm.

  12. Intro to AI: Blocks world: First Attempt Lecture 6 Volker Sorge Background Let’s formulate start state and goal state using logic Planning predicates On and Handempty: Example Domain: Blocks World Start State: On(A,Table) ∧ On(D,A) ∧ On(C,D) ∧ On(Empty,C) ∧ On(B,Table) ∧ On(Empty,B) ∧ Handempty Goal State: On(B,Table) ∧ On(D,B) ∧ On(A,D) ∧ On(Empty,A) ∧ On(C,Table) ∧ On(Empty,C) ∧ Handempty Note, that ◮ Empty and Table are used to represent explicitly that a block is accessible or sitting on the table. ◮ we usually omit the formal conjunction ∧ .

  13. Intro to AI: Blocks world: Operators Lecture 6 Volker Sorge Background Planning We design operators for picking up a block and putting it Example Domain: Blocks World down: PICKUP(x,y) On(Empty,x), On(x,y), Handempty Preconditions: On(Empty,x), On(x,y), Handempty Delete List: On(Empty,y), Holds(x) Add List: PUTDOWN(x,y) Holds(x), On(Empty,y) Preconditions: Holds(x), On(Empty,y) Delete List: On(Empty,x), On(x,y), Handempty Add List:

  14. Intro to AI: Blocks world: Operators (ctd.) Lecture 6 Volker Sorge Background Planning ◮ Operators are parameterised with variables that have to Example Domain: be grounded (i.e., instantiated) for the operator to be Blocks World applicable. ◮ We introduce the predicate Hold to express that a the robot arm holds a block. ◮ While in the above example preconditions and delete list are the same for each operator, this is not always the case. Consider an operator, to pick up red blocks only. Precondition would include Red(x), which would not be deleted, as the block will stay red even after we have picked it up.

  15. Intro to AI: Blocks world: Operator Application Lecture 6 Volker Sorge Forward Planning: Background Start State: On(A,Table), On(D,A), On(C,D), On(Empty,C), Planning On(B,Table), On(Empty,B), Handempty Example Domain: Blocks World Matching Operator: PICKUP(C,D) Next State: On(A,Table), On(D,A), On(C,D), On(Empty,C), On(B,Table), On(Empty,B), Handempty, On(Empty,D), Holds(C) Backward Planning: Goal State: On(B,Table), On(D,B), On(A,D), On(Empty,A), On(C,Table), On(Empty,C), Handempty Matching Operator: PUTDOWN(C,Table) Previous State: On(B,Table), On(D,B), On(A,D), On(Empty,A), On(C,Table), On(Empty,C), Handempty, Holds(C), On(Empty, Table)

  16. Intro to AI: Blocks world: Some Problems Lecture 6 Volker Sorge From the operator applications we can observe that our Background current domain formulation exhibits a couple of problems: Planning Example Domain: ◮ When forward planning we would need to put the block Blocks World down onto the table, however, this is currently not possible, as we are missing an On(Empty, Table). ◮ In backward planning we get the desired On(Empty, Table), however, the only realistic move is now to stack on top of A, which leads to the planner being stuck. ◮ If we are not careful in defininig our operators, we might be able to pickup empty or table, which we certainly would not want to do. We possibly could fix some of these problems, e.g., by adding a constant state On(Empty, Table), this would be rather messy.

  17. Intro to AI: Blocks world (2): Second Attempt Lecture 6 Volker Sorge Background Planning In the light of the shortcompings of our first attempt, let’s Example Domain: Blocks World reformulate the problem, by only reifying blocks, and instead having predicates that explicitly state if a block is on the table and/or clear. Start State: Ontable(A), Ontable(B), On(D,A), On(C,D), Clear(C), Clear(B), Handempty Goal State: Ontable(B), Ontable(C), On(D,B), On(A,D), Clear(A), Clear(C), Handempty

  18. Intro to AI: Blocks world (2): Operators Lecture 6 We now also reformulate our operators, with explicit Volker Sorge stacking and unstacking operations. Background PICKUP(x) Planning Clear(x), Ontable(x), Handempty Preconditions: Example Domain: Clear(x), Ontable(x), Handempty Blocks World Delete List: Holds(x) Add List: PUTDOWN(x) Holds(x) Preconditions: Holds(x) Delete List: Clear(x), Ontable(x), Handempty Add List: STACK(x,y) Holds(x), Clear(y) Preconditions: Holds(x), Clear(y) Delete List: Clear(x), On(x,y), Handempty Add List: UNSTACK(x,y) Clear(x), On(x,y), Handempty Preconditions: Clear(x), On(x,y), Handempty Delete List: Holds(x), Clear(y) Add List:

  19. Intro to AI: Blocks world (2): Example Operator Application Lecture 6 Volker Sorge Start State: Background Ontable(A), Ontable(B), On(D,A), On(C,D), Clear(C), Clear(B), Planning Handempty Example Domain: Blocks World Matching Operator: UNSTACK(C, D) New State: Ontable(A), Ontable(B), On(D,A), On(C,D), Clear(C), Clear(B), Handempty, Holds(C) , Clear(D) Matching Operator: PUTDOWN(C) New State: Ontable(A), Ontable(B), On(D,A), Clear(B), Holds(C), Clear(D), Clear(C) , Ontable(C) , Handempty . . . Plan: [ UNSTACK(C,D), PUTDOWN(C), UNSTACK(D,A), STACK(D,B), PICKUP(A), STACK(A,D) ]

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend