Automated Planning
Dr. Héctor Muñoz-Avila
Source:• Ch. 1• Appendix B.3• Dana Nau’s slides• My own
What is Planning? Classical Definition
Domain Independent: symbolic descriptions of the problems and the domain. The plan generation algorithm remains the same
Domain Specific: The plan generation algorithm depends on the particular domain
Advantage: - opportunity to have clear semanticsDisadvantage: - symbolic description requirement
Advantage: - can be very efficientDisadvantage: - lack of clear semantics - knowledge-engineering for adaptation
Planning: finding a sequence of actions to achieve a goal
Example of Planning Tasks: Military Planning
Example of Planning Tasks: Playing a Game
Example of Planning Tasks: Route Planning
• Classical planning makes a number of assumptions:Symbolic information (i.e., non numerical)Actions always succeedThe “Strips” assumption: only changes that takes place
are those indicated by the operatorsNext slide enumerates all assumptions
• Despite these (admittedly unrealistic) assumptions some work-around can be made (and have been made!) to apply the principles of classical planning to games
• “Hot” research topic: to removes some of these assumptions
Classical Planning
State & Goals
• Initial state: (on A Table) (on C A) (on B Table) (clear B) (clear C)
• Goals: (on C Table) (on B C) (on A B) (clear A)
A
C
B C
B
AInitial state Goals
(Ke Xu)
General-Purpose Planning: Operators
?y
?x
No block on top of ?x
transformation
?y
?x…
…
No block on top of ?y nor ?x
Operator: (Unstack ?x)• Preconditions: (on ?x ?y) (clear ?x) • Effects:
Add: (on ?x table) (clear ?y)Delete: (on ?x ?y)
On table
Classical Planning can be Hard
AC
B A B C A CB
CBA
BA
C
BAC
B CA
CAB
ACB
BCA
A BC
AB
C
ABC
(Michael Moll)
Conceptual Model1. Environment
State transition system = (S,A,E,)
System
Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/
= (S,A,E,)
• S = {states}• A = {actions}• E = {exogenous events}• State-transition function
: S x (A E) 2S
S = {s0, …, s5}
A = {move1, move2,
put, take, load, unload}E = {} : see the arrows
State Transition System
take
put
move1
put
take
move1
move1move2
loadunload
move2
move2
location 1 location 2
s0
location 1 location 2
s1
s4
location 1 location 2
s5
location 1 location 2
location 1 location 2
s3
location 1 location 2
s2
The Dock Worker Robots (DWR) domainDana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/
Observation functionh: S O
State transition system = (S,A,E,)location 1 location 2
s3
Given observation o in O, produces action a in A
Conceptual Model2. Controller
Controller
Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/
State transition system = (S,A,E,)location 1 location 2
s3
Complete observability:
h(s) = s
Observation functionh: S O
Given observation o in O, produces action a in A
Given state s, produces action a
Conceptual Model2. Controller
Controller
Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/
State transition system = (S,A,E,)
Depends on whether planning is online or offline
Observation functionh: S O
Given observation o in O, produces action a in A
Conceptual Model3. Planner’s Input
Planner
Planning problemPlanning problemPlanning problem
Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/
PlanningProblem
take
put
move1
put
take
move1
move1move2
loadunload
move2
move2
location 1 location 2
s0
location 1 location 2
s1
s4
location 1 location 2
s5
location 1 location 2
location 1 location 2
s3
location 1 location 2
s2
Description of Initial state or set of states
Initial state = s0
ObjectiveGoal state, set of goal states, set of tasks, “trajectory” of states, objective function, …Goal state = s5
The Dock Worker Robots (DWR) domainDana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/
State transition system = (S,A,E,)
Given observation o in O, produces action a in A
Instructions tothe controller
Depends on whether planning is online or offline
Observation functionh(s) = s
Conceptual Model4. Planner’s Output
Planner
Planning problemPlanning problemPlanning problem
Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/
Classical Assumptions (I)
• A0: Finite system finitely many states,
actions, and events• A1: Fully observable
the controller alwaysknows what state is in
• A2: Deterministiceach action or event has
only one possible outcome• A3: Static
No exogenous events: no changes except those performed by the controller
Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/
Classical Assumptions (II)
A4: Attainment goalsa set of goal states Sg
A5: Sequential plansa plan is a linearly
ordered sequence of actions (a1, a2, … an)
A6 :Implicit timeno time durations linear sequence of instantaneous states
A7: Off-line planning planner doesn’t know the execution status
Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/
This is Nice but How About Actual Deployed Applications?
• We briefly discuss three deployed applications:
Fear: application of a “classical” planner
Bridge: application of a “new-classical” planner
MRB: planning + execution
• We will discuss these again in detail later in the semester
Detailed Discussion of Topics
• See web page
Math Background: Logic
Source: Appendix B.3
Introduction to Logic
• A logic is a formal system of representing knowledge
• A logic has:Syntax – indicates the valid expressionsSemantics – provides meaning to the expressions Inference mechanism – draw conclusions from a set
of statements
Example: propositional Logic
Definition. A propositonal formula is defined recursively as follows:
•A symbol form a predefined list P is a proposition •If 1 and 2, are propositions then:
(1 2)
(1 2)
(1 2)
are also propositions•If is a proposition then ¬() is a proposition
Example. (a) (¬a ¬b c d) (¬c ¬d) (¬d)
Semantics. Truth tablesInference mechanism. Modus ponens
Predicate Logic
• Definition. A term is defined as follows:A constant is a termA variable is a term If t1, …, tn are terms and f is a function symbols then
f(t1,…,tn) is a term
• Definition. If t1, …, tn are terms and p is a symbol for an n-ary predicate then p(t1, …, tn ) are predicates
Predicate Logic: FormulasDefinition. An atomic formula is defined recursively as follows:
•An atom is an atomic formula •If 1 and 2, are atomic formulas then:
(1 2)
(1 2)
(1 2)
are also atomic formulas•If is a atomic formula then ¬() is an atomic formula•If is a atomic formula and x is a variable then:
• x() is an atomic formula• x() is an atomic formula
Example: x (likes(Mephistus,x) evilThing(x)) How do we say that Mephistus likes only evil things?
Predicate Logic: Semantics
(1 2)
(1 2)
(1 2) ¬()x()x()
Predicate Logic: Literals and Clauses
• Definition. A literal is an atomic formula consisting of a single atom and no quantifiers likes(Mephistus,x)¬ evilThing(x)
• Definition. A clause is a disjunction of literals likes(Mephistus,x) ¬ evilThing(x)
Resolution: Inference Mechanism for Predicate Logic
• Substitution,
• UnificationMost general unifier
• Resolution: Given two clauses: • L = l1 l2 … ln• M = m1 m2 … mn
If there is and li and mk such that:• li = a and mk = ¬a’ and• There is a most general unifier for a and a’
Then: (L – li) (M – mk) is a resolvent of L and M
• Idea behind the resolution procedure