CS440/ECE448: Intro to Artificial Intelligence � Lecture 11: Planning What is planning? � � Prof. Julia Hockenmaier � juliahmr@illinois.edu � � http://cs.illinois.edu/fa11/cs440 � � � What is planning? � Applications of planning � – Space exploration � Plan = ʻ plan of attack ʼ : � – Manufacturing � Use inference to find a sequence of actions to reach a goal state from the initial state � – Games (Bridge) � � – Scheduling � Combines logic and search: � – Logistics � – Logic: to describe states and define actions � – Semantic web support – Search: to find the actual sequence of actions � � CS440/ECE448: Intro AI � 4 �
Main types of planners � Classical planning: assumptions � The environment is: � Domain-specific: � – Fully observable � Tuned to target domain; don ʼ t generalize; – Deterministic � used in real-world applications � – Static � – Known � ( In CS440): domain-independent planning � – Finite (finitely many states and actions) � the only domain-specific knowledge: � definitions of basic actions; Under these assumptions, requires many simplifying assumptions; a plan is a linear sequence of actions, = classical planning � and planning can be done off-line � CS440/ECE448: Intro AI � 5 � CS440/ECE448: Intro AI � 6 � Classical Planning � Classical planning � State transition State transition system ! = (S, A, ! ) system ! = (S,A, ! ) – S = {states} – A = {actions} Solution – ! = S " A # 2 S {state transition function) � Initial state s 0 � Planner � (= sequence � of actions) � Initial state: s 0 Set of goal states: S g � (a 1 ,a 2 ,…,a n-1 ,a n ) � � Task: Given ( ! , s 0 , S g ) , find a sequence of actions Goal specification � (a 1 ,a 2 ,…,a n-1 ,a n ) that produces a sequence of state (description of goal transitions (s 1 ,s 2 ,…,s n-1 ,s n ) such that s n ∈ S g . � states) S g � CS440/ECE448: Intro AI � 7 �
Granularities of representations: Blocks World � Blocks World � F � F � A � A � C � C � E � E � D � D � B � G � B � G � Goals: � Several ontologies possible – Build a tower of A,B,C,… � (ways to conceptualize the world and its – Get block G, � changes) � – …. � � Silly domain, but concisely illustrates many general planning issues � Alternative Ontologies: Levels of Ontological Commitment � how to move a block � Version 1: � Version 3: � Version 5: � Abstract, High-Level Ontology MoveBlock � MoveGripper � Motor1-Voltage Action(Achieve-Block-Configuration3) Problem is trivialized � � OpenGripper � (current, dutycycle) � � MoveGripper � … � Planning � Assume Version 2: � CloseGripper � � MoveGripper � � …. � we ʼ re here � Mid-Level Ontology GraspBlock � Version 4: � MoveBlock( ... ) � MoveGripper � Motor1 Velocity � Assumed Hardware UngraspBlock � Motor2 Velocity � Low-Level Ontology Support � � … � Action(Motor3, Voltage7) Artificially and unnecessarily difficult � CS440/ECE448: Intro AI � 11 �
All reachable situations are Traditional Blocks World � defined by… � F � 1) The initial state � A � C � 2) Axioms of world change E � D � (= operator definitions ) � B � G � ! " Initial State # Operator Definitions � Only support relationships matter (and change): � I,a4 � On(x,y) (x is on y) , Clr(x) (x is clear) � I,a2 � Assumptions: � I,a4,a3 � I � I,a2,a34 � – A block can support at most one other block � I,a15 � – The table can support any number of blocks � – Generalized block movement move(x,y,z) � I,a15,a4 � I,a17 � Planning as search � Planning vs. Search � Planning is ʻ just ʼ search: � – Nodes = states � Interesting All – Edges = actions � action action << � � sequences � sequences � But: � – the state space can be very large! � Search operators are “inferentially opaque” � – we don ʼ t describe states with an atomic label Planning allows reasoning about state ( ʻ s10 ʼ ), but use a ʻ factored ʼ representation to features � capture only the essential properties � � CS440/ECE448: Intro AI � 15 �
Planning as theorem proving � This week ʼ s lectures � Planning: given the initial state, find a sequence Representations for planning: � of actions that yield a situation where goal holds. – Situation calculus � = Use operators to derive goal from initial state. � – STRIPS � Operator : carry(x) – PDLL � General knowledge of one kind of action: Planning algorithms: � preconditions and effects � – Forward chaining and backward chaining � Action : carry(BlockA) – Propositionalization (SATplan) � Ground instance of an operator � – GraphPlan � CS440/ECE448: Intro AI � 18 � Key questions � How do we represent states? � – What information do we need to know? � – What information can we (safely) ignore? � Representations � How do we represent actions? � for planning � – When can we perform an action? � – What changes when we perform an action? � – What stays the same? � – What level of detail do we care about? �
Atomic vs. factored Representations for states � state representations � We want to know what state the world is in: � – What are the current properties of the entities? � s 213 – What are the current relations between the entities? � � Logic representation : � Each state is a conjunction of ground predicates: � Universe U Block(A) ∧ Block(B) ∧ Block(C) ∧ Table(T) ∧ On(A,B) ∧ On(B,T) ∧ On(C,T) ∧ Clear(A) ∧ Clear(C) on(A, C) CS440/ECE448: Intro AI � 21 � Fluents vs. Planning: Database semantics � atemporal propositions � – Each constant refers to a unique object � (no two names for the same object) Atemporal propositions: � � Certain properties and relations – Domain closure : the domain consists only of hold always true: table(T) does not change. � those objects for which we have a name. � � Fluents: � – Closed world assumption : if we don ʼ t know on(A, B) may be true in current state, but not after that P is true, we assume it ʼ s false. the action move(A,B,T) is performed. � � on(x, y) is a fluent. � – No function symbols � We may add a state variable: on(x, y, s) � CS440/ECE448: Intro AI � 23 �
Representations for operators � Representations for operators � The operator definitions model world dynamics: � Operator name (and arity): move x from y to z � – When can an action be performed? � � � move(x,y,z) – How does the world change as a result? � � � Preconditions: when can the action be performed � Different languages: � clear(x) ∧ clear(z) ∧ on(x,y) – Situation Calculus �� Pure first-order logic � � – Strips Operators � � � – PDDL Operators* � Specialized syntax � Effects : how does the world change? � � clear(y) ∧ on(x,z) ∧ clear(x) ∧ ¬clear(z) ∧ ¬on(x,y) � � new persist retract * Ch10 R & N say PDDL but actually discuss Strips � => main differences between languages � � CS440/ECE448: Intro AI � 26 � Summary: representations for classical planning � Language: restricted FO predicate logic; � – No functions; database semantics: � – Finite number of predicates and constants � � Situation calculus � States: sets (conjunction) of ground atoms � � (positive literals) � – Only finite number of states is possible � Operators: (name, preconditions, effects) � – Preconditions and effects: sets of literals � CS440/ECE448: Intro AI � 27 �
The “Result” Function: � Operators: Situation Calculus � Result: Action $ Situation % Situation � FOPC with some conventions � State transition function (not a predicate). � � Result (Move (A, B, C), S i ) Move-Block ontology with: � – at most one block directly on top of another � Result (Move (B, Tbl, A), Result (Move (A, B, C), S i )) – a big table (always empty space available) � Straightforward generalization to variables: � move(x,y,z) operator: move x from y to z � Result (Move (?x, ?y, C), S i ) � Fluents require situation variable: clear(x,s) � denotes the set of situations where something was just moved to C from the previous state S i � Useful in “Goal Regression” planning � Situation calculus identifies states World Change � by history, not configuration A � � B � C � A � A � B � C � B � C � Initial State: S i On(A, C, S i ) � S i � Result (Move(A,C,B),S i ) � Move(A,C,Tbl) � B � C � A � B � B � C � C � A � A � Next State: Result(Move(A,C,Tbl),S i ) Result (Move(A,C,Tbl),S i ) � Result(Move(A,Tbl, � On(A, Tbl, Result(Move(A,C,Tbl),S i )) � Result (Move(A,C,B),S i ) �
Recommend
More recommend