Lecture7 Part I Planning
Lecture7 Part I Planning
Brigitte Jaumard
Dept of Computer Science and Software
Engineering
Concordia University
Montreal (Quebec) Canada
1
Outline
n Planning problem
n State-space search
n Partial-order planning
n Planning graphs
n Planning with propositional logic
2
2
Search vs. planning
n Consider the task get milk, bananas, and a cordless drill
n Standard search algorithms seem to fail miserably:
3
n After-the-fact heuristic/goal test inadequate
Planning problem
4
Additional complexities
5
AI Planning background
6
CPM: Critical Path Method
[0,15] [30,45] [60,75]
AddEngine1 AddWheels1 Inspect1
30 30 10
[0,0] [85,85]
Start Finish
AddWheels1
AddEngine1 Inspect1
AddEngine2 Inspect2
AddWheels2
0 10 20 30 40 50 60 70 80 90
7
Critical Path Method (Cont’d)
n
8
Problem Representation
n State
q What is true about the (hypothesized) world?
n Goal
q What must be true in the final state of the world?
n Actions
q What can be done to change the world?
9
STRIPS STRIPS
10
STRIPS Representation
STRIPS representations
11
STRIPS Operator Representation
STRIPS Operator Representation
12
Semantics
Semantics
• If the precondition is false in a world state, the action does not change
anything (since it cannot be applied)
• If the precondition is true:
– Delete the items in the Delete-list
– Add the items in the Add-list.
Order of operations is important here!
13
Example: Buying Action
Example: Buying Action
14
Example: Move Action
Example: Move Action
15
Pros and Cons of STRIPS
Pros and cons of STRIPS
• Pros:
Example: Move action
– Since it is restricted, inference can be done e⇥ciently
– All operators can be viewed as simple deletions and additions of
• Action: to the knowledge base
propositions
• Cons: – Move(object, from, to)
– Assumes that a small number of propositions will change for each
• Preconditions:
action– (otherwise operators
At(object, from), Clear(to), are hard to write down, and reasoning
Clear(object)
becomes expensive)
• Effects:
– Limited language (preconditions and effects are expressed as
conjunctions,
– Add-list: implicit
At(object, quantifiers),
to), Clear(from) so not applicable to all domains
of interest.
– Delete-list: At(object, from), Clear(to)
16
Example: Block World
Welcome to the Blocks World!
Example: Blocks World
A
B
A B C C
Initial state Goal state
Action = Move(b,x,y)
Precondition = On(b,x) ! Clear(b) ! Clear(y)
Effect = On(b,y) ! Clear(x) ! ¬On(b,x) ! ¬Clear(y)
Action = MoveToTable(b,x)
Preconditions = On(b,x) ! Clear(b)
Effect = On(b,Table) ! Clear(x) ! ¬On(b,x)
18
Two Basic Approaches to Planning
Two Basic Approaches to Planning
Cons:
– Assumes that a small number of propositions will change for19each
Planning with state-space search
n Regression planners
q backward state-space search
20
Plan-Space Planning in the Blocks World
21
State-Space Planners
State-Space Planners
• Progression planners reason from the start state, trying to find the
operators that can be applied (match preconditions)
• Regression planners reason from the goal state, trying to find the actions
that will lead to the goal (match effects or post-conditions)
In both cases, the planners work with sets of states instead of using
individual states, like in straightforward search
22
Progression (Forward) Planning
23
Example: Supermarket Domain
Example: Supermarket Domain
Note that in this case there are a lot of possible operators to perform!
24
Goal Regression
Goal Regression
25
Example: Supermarket Domain
Example: Supermarket Domain
Note that in this case the order in which we try to achieve these propositions
matters!
26
Variations of Goal Regression
27
COMP-424, Lecture 9 - February 4, 2013 49
Prodigy Planner
Prodigy Planner
28
Total vs. Partial Order
Total vs. Partial Order
Total vs. Partial Order
Total vs. Partial Order
• Total order: Plan is always a astrict sequence of actions
• Total order: Plan is
• Total always aalways
order: Plan is strict sequence
strict of actions
sequence of actions
E.g. E.g.
To paint thethe
To paint ceiling
ceiling
Plan 1:PlanStart
1: Start Get Get
Brush
Brush Get
GetLadder
Ladder Paint ceiling
Paint ceiling Finish
Finish
29
–Search space is a set of partial plans
–Transitions
Can are
maintain both plan
state andoperators
plans (e.g. Prodigy)
Partial Order Planning Can maintain both state and plans (e.g. Prodigy)
30
Plan-Space Planners
Plan-Space Planners
Plan is defined by ↵A, O, B, L :
31
COMP-424, Lecture 9 - February 4, 2013 53
Plan Transformations
Plan Transformations
• Adding actions
• Specifying orderings
• Binding variables
32
Discussion of Partial-Order Planning
Discussion of Partial-Order Planning
• Advantages:
– Plan steps may be unordered (plan will be ordered, or linearized, before
execution)
– Handles concurrent plans
– Least commitment can lead to shorter search times
– Sound and complete
– Typically produces the optimal plan
• Disadvantages:
– Complex plan operators lead to high cost for generating every action
– Larger search space, because of concurrent actions
– Hard to determine what is true in a state
33
The real world
The real world
Things are usually not as expected:
• Incomplete information
– Unknown preconditions, e.g., Intact(Spare)
– Disjunctive effects, e.g., Inflate(x) causes Inflated(x) according to
the knowledge base, but in reality it actually causes Inflated(x)
SlowHiss(x) Burst(x) BrokenPump . . .
• Incorrect information
– Current state incorrect, e.g., spare NOT intact
– Missing/incorrect postconditions in operators
• Qualification problem: can never finish listing all the required
preconditions and possible conditional outcomes of actions
34
Solutions
Solutions
35
Monitoring
Monitoring
36
Replanning
Replanning
37
Summary
Summary
38
Progression and regression
initial state
goal
39
Progression algorithm
n Formulation as state-space search problem:
q Initial state and goal test: obvious
q Successor function: generate from applicable actions
q Step cost = each action costs 1
n Any complete graph search algorithm is a complete planning
algorithm.
q E.g. A*
n Inherently inefficient:
q (1) irrelevant actions lead to very broad search tree
q (2) good heuristic required for efficient search
40
Forward Search Methods:
can use A* with some h and g
41
Regression algorithm
n How to determine predecessors?
q What are the states from which applying a given action leads to the
goal?
Goal state = At(C1, B) Ù At(C2, B) Ù … Ù At(C20, B)
Relevant action for first conjunct: Unload(C1,p,B)
Works only if pre-conditions are satisfied.
Previous state= In(C1, p) Ù At(p, B) Ù At(C2, B) Ù … Ù At(C20, B)
Subgoal At(C1,B) should not be present in this state.
n Actions must not undo desired literals (consistent)
n Main advantage: only relevant actions are considered.
q Often much lower branching factor than forward search.
42
Regression algorithm
n General process for predecessor construction
q Give a goal description G
q Let A be an action that is relevant and consistent
q The predecessors are as follows:
n Any positive effects of A that appear in G are deleted.
43
Backward search methods
Regressing a
ground
operator
44
Regressing an ungrounded operator
45
Example of Backward Search
A partial order plan for putting
shoes and socks
47
Reading and Suggested Exercises
n Chapters 10
n Exercises: 10.3, 10.4, 10.15
48