Planning
Planning
Classical AI Planning
Jana Tumova
Planning 1
Planning
Planning 2
Planning
Planning 3
Real-world planning
Planning 4
Real-world planning
Planning 4
Planning problem
Planning problem:
• Initial state
• Actions available in a state ACTIONS(s)
• Results of applying action RESULT (s, a)
• Goal test
Planning 5
Planning vs. problem solving
Planning 6
Challenges
Planning 7
Challenges
Planning 7
Planning Domain Definition Language
(PDDL)
States
• At(P, SFO)
• At(P, Arlanda) ∧ Plane(P) ∧ Loaded(Cargo, P)
Actions (think of them as universally quantified)
Planning 8
PDDL States
Planning 9
PDDL Action Schemes
Actions and their results are represented through action schemes
• Action name with the list of all used variables
• Precondition: a conjunction of literals saying when an action is
applicable in a state s, namely if s entails the precondition
ACTIONS(s) = {a | s |= PRECOND(a)}.
where DEL(a) are the fluents that appear as negative literals in the
effect and ADD(a) are the fluents that appear as positive ones.
Planning 10
Block World in PDDL
Planning 11
Block World in PDDL
Planning 11
Block World in PDDL
Planning 12
Q: What are the initial state and the goal
test?
Action(Slide(t, s1 , s2 ))
PRECOND : On(t, s1 ) ∧ Tile(t) ∧ Blank(s2 ) ∧ Adjacent(s1 , s2 )
EFFECT : On(t, s2 ) ∧ Blank(s1 ) ∧ ¬On(t, s1 ) ∧ ¬Blank(s2 )
Planning 13
Challenges
Planning 14
Challenges
Planning 14
PDDL Planning Problem as a State Space
Search
• Description of a planning problem defines a search problem
• States are truth assignments to fluents, actions and results define
the transitions
… …
Planning 15
PDDL Planning Problem as a State Space
Search
• Description of a planning problem defines a search problem
• States are truth assignments to fluents, actions and results define
the transitions
… …
Planning 16
Forward (progression) search
• As expected
• Start at the initial state
• Explore applicable actions
• Properties
• Large branching factor, often explores irrelevant actions
• Needs a good heuristic, ideally domain-independent
Planning 17
Example: Air Cargo Transport in PDDL
Planning 18
Heuristics
Planning 19
Domain-independent heuristics
Planning 20
Domain-independent heuristics
Planning 21
Ignore preconditions
Planning 22
Example: Ignore preconditions
Action(Slide(t, s1 , s2 ))
PRECOND : On(t, s1 ) ∧ Tile(t) ∧ Blank(s2 ) ∧ Adjacent(s1 , s2 )
EFFECT : On(t, s2 ) ∧ Blank(s1 ) ∧ ¬On(t, s1 ) ∧ ¬Blank(s2 )
Planning 23
Example: Ignore preconditions
Action(Slide(t, s1 , s2 ))
PRECOND : On(t, s1 ) ∧ Tile(t) ∧ Blank(s2 ) ∧ Adjacent(s1 , s2 )
EFFECT : On(t, s2 ) ∧ Blank(s1 ) ∧ ¬On(t, s1 ) ∧ ¬Blank(s2 )
Action(Slide(t, s1 , s2 ))
PRECOND : On(t, s1 ) ∧ Tile(t) ∧ Blank(s2 ) ∧ Adjacent(s1 , s2 )
EFFECT : On(t, s2 ) ∧ Blank(s1 ) ∧ ¬On(t, s1 ) ∧ ¬Blank(s2 )
h2 (n): sum of the distances of the tiles from the goal position
Planning 24
Q: Match ignoring preconditions with the
heuristic
Action(Slide(t, s1 , s2 ))
PRECOND : On(t, s1 ) ∧ Tile(t) ∧ Blank(s2 ) ∧ Adjacent(s1 , s2 )
EFFECT : On(t, s2 ) ∧ Blank(s1 ) ∧ ¬On(t, s1 ) ∧ ¬Blank(s2 )
h2 (n): sum of the distances of the tiles from the goal position
Planning 25
Ignore Delete Lists
Planning 26
Domain-independent Heuristics
Planning 27
State Abstraction
Planning 28
Domain-independent Heuristics
Planning 29
Decomposition
• G = G1 ∧ . . . ∧ Gn
• Instead of problem P, we solve problems P1 , . . . , Pn
• We can use maxi COST (Pi ) as a heuristic
Planning 30
Decomposition
• G = G1 ∧ . . . ∧ Gn
• Instead of problem P, we solve problems P1 , . . . , Pn
• We can use maxi COST (Pi ) as a heuristic
Planning 30
Decomposition
• G = G1 ∧ . . . ∧ Gn
• Instead of problem P, we solve problems P1 , . . . , Pn
• We can use maxi COST (Pi ) as a heuristic
Planning 30
Domain-independent Heuristics
Planning 31
Planning Graph
Planning 32
Planning Graph
Planning 33
Planning Graph
Mutex:
• Inconsistent effects: one
action negates the effect of
State level Action level
the other
• Interference: one of the
effects of one action is the
negation of a precondition of
the other
• Competing needs: one of the
preconditions of one action is
Each fluent that Persistence
Mutex
the negation of a precondition
holds initially actions
of the other
Planning 34
Planning Graph
Planning 35
Planning Graph
Planning 36
Planning Graph
State level Action level State level Action level State level
Planning 37
Planning Graph
Planning 38
Planning Graph Properties
Planning 39
Challenges
Planning 40
Challenges
Planning 40
GRAPHPlan
• Using the planning graph to extract a plan directly instead of using
it to design a heuristic for search
• EXTRACT-SOLUTION either through CSP or through backward
search in the planning graph, not in the state space
• If EXTRACT-SOLUTION does not find a plan, we store
(level, goals) in nogoods
Planning 41
GRAPHPlan
Planning 42
GRAPHPlan Properties
Planning 43
Challenges
Planning 44
Final remarks
Planning 45