Partial Order Planning
description
Transcript of Partial Order Planning
![Page 1: Partial Order Planning](https://reader036.fdocuments.net/reader036/viewer/2022062502/56814e82550346895dbc1f0e/html5/thumbnails/1.jpg)
Partial Order Planning
1
Brian C. Williams16.412J/6.834J Sept 16th, 2002Slides with help from:
Dan Weld Stuart Russell & Peter Norvig
![Page 2: Partial Order Planning](https://reader036.fdocuments.net/reader036/viewer/2022062502/56814e82550346895dbc1f0e/html5/thumbnails/2.jpg)
Self Repairing Explorers
![Page 3: Partial Order Planning](https://reader036.fdocuments.net/reader036/viewer/2022062502/56814e82550346895dbc1f0e/html5/thumbnails/3.jpg)
Monitors
Autonomous Agents
Command dispatchFault protectionAttitude control
Mission Goal Scenario
Self-commandingSelf-commandingSelf-diagnosingSelf-diagnosingSelf-repairingSelf-repairing
RECOVERY
PLANNIN
G
EXECUTION
Commanded at:• Mission level• Engineering level
![Page 4: Partial Order Planning](https://reader036.fdocuments.net/reader036/viewer/2022062502/56814e82550346895dbc1f0e/html5/thumbnails/4.jpg)
Readings for Today’s Lecture• Partial Order Planning
AIMA Chapter 11• Execution and Conditional Planning
AIMA Chapter 13
• * AIMA = “Artificial Intelligence: A Modern Approach,” by Russell and Norvig.
• Optional Reading:Weld “Introduction to Least Commitment Planning,” AI Magazine.(To be posted on the class web site)
![Page 5: Partial Order Planning](https://reader036.fdocuments.net/reader036/viewer/2022062502/56814e82550346895dbc1f0e/html5/thumbnails/5.jpg)
Planning with Atomic Time
• Operator-based planning as search• Declarative encoding of states and operators• Partial order planning
– Planning problem– Partial order planning algorithm
![Page 6: Partial Order Planning](https://reader036.fdocuments.net/reader036/viewer/2022062502/56814e82550346895dbc1f0e/html5/thumbnails/6.jpg)
Operator-based Planning Problem• Input
– Set of world states– Action operators
• Fn: world-stateworld-state– Initial state of world– Goal
• partial state (set of world states)
• Output– Sequence of actions
What assumptions areimplied?
• Atomic time.• Agent is omniscient
(no sensing necessary).
• Agent is sole cause of change.
• Actions have deterministic effects.
• No indirect effects.
STRIPS Assumptions
aa
anorth11 north12
W0 W2W1
![Page 7: Partial Order Planning](https://reader036.fdocuments.net/reader036/viewer/2022062502/56814e82550346895dbc1f0e/html5/thumbnails/7.jpg)
Operator-based Planning as Search
AC
B
InitialState
CBA
GoalState
1) Forward-Chaining State-Space Search
What problems arise?
![Page 8: Partial Order Planning](https://reader036.fdocuments.net/reader036/viewer/2022062502/56814e82550346895dbc1f0e/html5/thumbnails/8.jpg)
What Are Alternative Strategies?
AC
B
InitialState
CBA
GoalState
Need more declarative description of operators and state
Are these strategies supported by our current representation?
![Page 9: Partial Order Planning](https://reader036.fdocuments.net/reader036/viewer/2022062502/56814e82550346895dbc1f0e/html5/thumbnails/9.jpg)
Planning as Search 2) Backward-Chaining (goal-directed search)
Many Goal StatesWhere do we start?
Initial State is completely defined
AC
BDE
DCBA
E
D
CBA
E
CBA
E
* * *
D
•Search partial worlds (partial assignment)
Subgoals weakly interact:• Maintain goal/subgoal decomposition
• Order action sequences only where needed (partial orders)
How do we represent the search state?
![Page 10: Partial Order Planning](https://reader036.fdocuments.net/reader036/viewer/2022062502/56814e82550346895dbc1f0e/html5/thumbnails/10.jpg)
Plan-Space Search
• How do we represent plans?• How do we test if a plan is a solution?• How do we generate a plan?
pick-from-table(C)
pick-from-table(B)
pick-from-table(C)put-on(C,B)
Idea: Each state is a partial plan
![Page 11: Partial Order Planning](https://reader036.fdocuments.net/reader036/viewer/2022062502/56814e82550346895dbc1f0e/html5/thumbnails/11.jpg)
Partial Order Planning
• Plan from goals, back to initial state• Search through partial plans
• Representation:– Operators given in declarative representation, rather
than black box functions.– Plans represent only relevant commitments
(e.g., relevant ordering of operators, not total ordering)
![Page 12: Partial Order Planning](https://reader036.fdocuments.net/reader036/viewer/2022062502/56814e82550346895dbc1f0e/html5/thumbnails/12.jpg)
Planning with Atomic Time
• Operator-based planning as search• Declarative encoding of state and operators• Partial order planning
– Planning problem– Partial order planning algorithm
![Page 13: Partial Order Planning](https://reader036.fdocuments.net/reader036/viewer/2022062502/56814e82550346895dbc1f0e/html5/thumbnails/13.jpg)
STRIPS Representation: Encode world states as conjunctions of literals
a anorth11
W0 W1
• Propositions • True/False Statements
(block a)
• Literals• Proposition or its negation
(not (block a) )
• Conjunction• And of literals• (And (block a) (block b)
(block c) (on-table a) …)
• A World state is a conjunction with every proposition appearing exactly once.
• A Partial state is a conjunction with every proposition appearing at most once.
What is missing from this logic?
![Page 14: Partial Order Planning](https://reader036.fdocuments.net/reader036/viewer/2022062502/56814e82550346895dbc1f0e/html5/thumbnails/14.jpg)
STRIPS Operator Representation
• Effects specify how to change the set of propositions.
a anorth11
W0 W1
• Initial state:• ((block a) (block
b) (block c) (on-table a) (on-table b) (clear a) (clear b) (clear c)
(arm-empty))
• goal (partial state):• ((on a b)
(on b c)))
• Available actions• Strips operators
precond: (and (agent-at 1 1)(agent-facing north))
effect: (and (agent-at 1 2) (not (agent-at 1 1)))
North11
![Page 15: Partial Order Planning](https://reader036.fdocuments.net/reader036/viewer/2022062502/56814e82550346895dbc1f0e/html5/thumbnails/15.jpg)
(Parameterized) Operator Schemata
(:operator pick-up :parameters ((block ?ob1)) :precondition (and (clear ?ob1)
(on-table ?ob1) (arm-empty))
:effect (and (not (clear ?ob1)) (not (on-table ?ob1))
(not (arm-empty)) (holding ?ob1)))
• Instead of defining: pickup-A and pickup-B and …
• Define a schema:Note: strips doesn’t
allow derived effects;
you must be complete!}
?var denotes a free variable
![Page 16: Partial Order Planning](https://reader036.fdocuments.net/reader036/viewer/2022062502/56814e82550346895dbc1f0e/html5/thumbnails/16.jpg)
Planning with Atomic Time
• Operator-based planning as search• Declarative encoding of state and operators• Partial order planning
– Planning problem– Partial order planning algorithm
![Page 17: Partial Order Planning](https://reader036.fdocuments.net/reader036/viewer/2022062502/56814e82550346895dbc1f0e/html5/thumbnails/17.jpg)
Given Initial and Goal State
Have(Milk) At(Home) Have(Ban.) Have(Drill)
Finish
StartAt(Home) Sells(HWS,Drill) Sells(SM,Milk) Sells(SM,Ban.)
Initial and Goal states are encoded as operators, Why?
Don’t need to introduce (partial) states as separate objects.
Keeps theory minimal.
![Page 18: Partial Order Planning](https://reader036.fdocuments.net/reader036/viewer/2022062502/56814e82550346895dbc1f0e/html5/thumbnails/18.jpg)
Given Plan Operators
Go(HWS)
Go(Home)
Buy(Drill)
Buy(Milk)
Buy(Ban.)Go(SM)
At(SM), Sells(SM,Milk)At(SM)
At(SM), Sells(SM,Ban.)
At(Home)
At(HWS)
At(HWS) Sells(HWS,Drill)
Have(Milk)
Have(Drill)
Have(Ban)
At(Home)
At(HWS)
At(SM)
What is a solution?
![Page 19: Partial Order Planning](https://reader036.fdocuments.net/reader036/viewer/2022062502/56814e82550346895dbc1f0e/html5/thumbnails/19.jpg)
Start
FinishHave(Milk) At(Home) Have(Ban.) Have(Drill)
Buy(Milk)At(SM), Sells(SM,Milk)
Buy(Ban.)At(SM), Sells(SM,Ban.)
Buy(Drill)At(HWS) Sells(HWS,Drill)
At(Home) Sells(HWS,Drill) Sells(SM,Milk) Sells(SM,Ban.)
Partial Order Plan <Actions,Orderings,Links>
![Page 20: Partial Order Planning](https://reader036.fdocuments.net/reader036/viewer/2022062502/56814e82550346895dbc1f0e/html5/thumbnails/20.jpg)
Start
Finish
Buy(Drill)
Buy(Milk) Buy(Ban.)
Have(Milk) At(Home) Have(Ban.) Have(Drill)
At(SM), Sells(SM,Milk) At(SM), Sells(SM,Ban.)
At(HWS) Sells(HWS,Drill)
At(Home) Sells(HWS,Drill) Sells(SM,Milk) Sells(SM,Ban.)
Partial Order Plan <Actions,Orderings,Links>
![Page 21: Partial Order Planning](https://reader036.fdocuments.net/reader036/viewer/2022062502/56814e82550346895dbc1f0e/html5/thumbnails/21.jpg)
Start
Finish
Buy(Drill)
Buy(Milk) Buy(Ban.)
Have(Milk) At(Home) Have(Ban.) Have(Drill)
At(SM), Sells(SM,Milk) At(SM), Sells(SM,Ban.)
At(HWS) Sells(HWS,Drill)
Go(Home)
At(HWS)Go(SM)
At(SM)
At(Home) Sells(HWS,Drill) Sells(SM,Milk) Sells(SM,Ban.)
Partial Order Plan <Actions,Orderings,Links>
![Page 22: Partial Order Planning](https://reader036.fdocuments.net/reader036/viewer/2022062502/56814e82550346895dbc1f0e/html5/thumbnails/22.jpg)
Start
Go(Home)
Finish
Buy(Drill)
Buy(Milk) Buy(Ban.)
Go(SM)
Have(Milk) At(Home) Have(Ban.) Have(Drill)
At(SM), Sells(SM,Milk)
At(SM)
At(SM), Sells(SM,Ban.)
At(HWS)
At(HWS) Sells(HWS,Drill)
At(Home) Sells(HWS,Drill) Sells(SM,Milk) Sells(SM,Ban.)
Go(HWS)At(Home)
Partial Order Plan <Actions,Orderings,Links>
![Page 23: Partial Order Planning](https://reader036.fdocuments.net/reader036/viewer/2022062502/56814e82550346895dbc1f0e/html5/thumbnails/23.jpg)
Start
Go(HWS)
Go(Home)
Finish
Buy(Drill)
Buy(Milk) Buy(Ban.)
Go(SM)
Have(Milk) At(Home) Have(Ban.) Have(Drill)
At(SM), Sells(SM,Milk)
At(SM)
At(SM), Sells(SM,Ban.)
At(Home)
At(HWS)
At(HWS) Sells(HWS,Drill)
At(Home) Sells(HWS,Drill) Sells(SM,Milk) Sells(SM,Ban.)
Partial Order Plan <Actions,Orderings,Links>
![Page 24: Partial Order Planning](https://reader036.fdocuments.net/reader036/viewer/2022062502/56814e82550346895dbc1f0e/html5/thumbnails/24.jpg)
Why is an ordering needed?
Go(Home)
Buy(Milk)
Go(SM)
At(Home)
At(SM)
At(SM)
At(HWS)
![Page 25: Partial Order Planning](https://reader036.fdocuments.net/reader036/viewer/2022062502/56814e82550346895dbc1f0e/html5/thumbnails/25.jpg)
Why is an ordering needed?
Go(Home)
Go(SM)
At(Home)
At(SM)
At(HWS)
Buy(Milk)At(SM)
Suppose the other order is allowed,what happens?
“Threatened Precondition”
![Page 26: Partial Order Planning](https://reader036.fdocuments.net/reader036/viewer/2022062502/56814e82550346895dbc1f0e/html5/thumbnails/26.jpg)
Why is an ordering needed?
Go(Home)
Go(SM)
At(Home)
At(SM)
At(HWS)
Buy(Milk)At(SM)
Suppose the other order is allowed,what happens?
Link indicatesprotected timeinterval.
![Page 27: Partial Order Planning](https://reader036.fdocuments.net/reader036/viewer/2022062502/56814e82550346895dbc1f0e/html5/thumbnails/27.jpg)
Ordering Resolves Threat
Go(Home)
Buy(Milk)
Go(SM)
At(Home)
At(SM)
At(SM)
At(HWS)
![Page 28: Partial Order Planning](https://reader036.fdocuments.net/reader036/viewer/2022062502/56814e82550346895dbc1f0e/html5/thumbnails/28.jpg)
A Solution: Complete and Consistent Plan
• Complete Plan
• Consistent Plan
IFF every precondition of every step is achieved
A step’s precondition is achieved iff • its the effect of a preceding step,• no possibly intervening step undoes it.
IFF there is no contradiction in the ordering constraints(I.e., never si < sj and sj < si.)
Start
Go(HWS)
Go(Home)
Finish
Buy(Drill)
Buy(Milk) Buy(Ban.)
Go(SM)
Have(Milk) At(Home) Have(Ban.) Have(Drill)
At(SM), Sells(SM,Milk)
At(SM)
At(SM), Sells(SM,Ban.)
At(Home)
At(HWS)
At(HWS) Sells(HWS,Drill)
At(Home) Sells(HWS,Drill) Sells(SM,Milk) Sells(SM,Ban.)
![Page 29: Partial Order Planning](https://reader036.fdocuments.net/reader036/viewer/2022062502/56814e82550346895dbc1f0e/html5/thumbnails/29.jpg)
Planning with Atomic Time
• Operator-based planning as search• Declarative encoding of state and operators• Partial order planning
– Planning problem– Partial order planning algorithm
![Page 30: Partial Order Planning](https://reader036.fdocuments.net/reader036/viewer/2022062502/56814e82550346895dbc1f0e/html5/thumbnails/30.jpg)
POP(<A,O,L>, agenda, actions)
• <A,O,L>, A partial plan to expand
• Agenda: A queue of open conditions still to be satisfied: <p, aneed >
• Actions: A set of actions that may be introduced to meet needs.
• aadd: an action that produces the needed condition p for aneed
• Athreat : an action that might threaten a causal link from aproducer to aconsumer
![Page 31: Partial Order Planning](https://reader036.fdocuments.net/reader036/viewer/2022062502/56814e82550346895dbc1f0e/html5/thumbnails/31.jpg)
POP(<A,O,L>, agenda, actions)1. Termination: If agenda is empty, return plan <A,O,L>.2. Goal Selection: select and remove open condition <p, aneed > from
agenda.3. Action Selection: Choose new or existing action aadd that can
precede aneed and whose effects include p. Link and order actions.
4. Update Agenda: If aadd is new, add its preconditions to agenda.
5. Threat Detection: For every action athreat that might threaten some causal link from aproduce to aconsume, choose a consistent ordering:
a) Demotion: Add athreat < aproduce
b) Promotion: Add aconsume < athreat
6. Recurse: on modified plan and agendaChoose is nondeterministic Select is deterministic
![Page 32: Partial Order Planning](https://reader036.fdocuments.net/reader036/viewer/2022062502/56814e82550346895dbc1f0e/html5/thumbnails/32.jpg)
To remove threats…
Go(Home)
Go(SM)
At(Home)
At(SM)
At(HWS)
Buy(Milk)At(SM)
promote the threat…
![Page 33: Partial Order Planning](https://reader036.fdocuments.net/reader036/viewer/2022062502/56814e82550346895dbc1f0e/html5/thumbnails/33.jpg)
To remove threats…
Go(Home)
Go(SM)
At(Home)
At(SM)
At(HWS)
Buy(Milk)At(SM)
promote the threat… demote the threat…
![Page 34: Partial Order Planning](https://reader036.fdocuments.net/reader036/viewer/2022062502/56814e82550346895dbc1f0e/html5/thumbnails/34.jpg)
Go(SM)At(HWS)
• But only allow demotion/promotion if schedulable
• consistent = loop free• no action precedes initial state
To remove threats…promote the threat… demote the threat…
Buy(Milk)At(SM)
Buy(Milk)At(SM)
Go(Home)At(Home)
At(SM)
![Page 35: Partial Order Planning](https://reader036.fdocuments.net/reader036/viewer/2022062502/56814e82550346895dbc1f0e/html5/thumbnails/35.jpg)
Start
FinishHave(Drill) Have(Milk) Have(Ban.) at(Home)
At(Home) Sells(HWS,Drill) Sells(SM,Milk) Sells(SM,Ban.)
![Page 36: Partial Order Planning](https://reader036.fdocuments.net/reader036/viewer/2022062502/56814e82550346895dbc1f0e/html5/thumbnails/36.jpg)
Start
FinishHave(Drill) Have(Milk) Have(Ban.) at(Home)
Buy(Drill)At(HWS) Sells(HWS,Drill)
Buy(Ban.)At(SM), Sells(SM,Ban.)
Buy(Milk)At(SM), Sells(SM,Milk)
At(Home) Sells(HWS,Drill) Sells(SM,Milk) Sells(SM,Ban.)
![Page 37: Partial Order Planning](https://reader036.fdocuments.net/reader036/viewer/2022062502/56814e82550346895dbc1f0e/html5/thumbnails/37.jpg)
Start
Finish
Buy(Drill) Buy(Milk) Buy(Ban.)
Have(Drill) Have(Milk) Have(Ban.) at(Home)
At(SM), Sells(SM,Milk) At(SM), Sells(SM,Ban.)At(HWS) Sells(HWS,Drill)
At(Home) Sells(HWS,Drill) Sells(SM,Milk) Sells(SM,Ban.)
![Page 38: Partial Order Planning](https://reader036.fdocuments.net/reader036/viewer/2022062502/56814e82550346895dbc1f0e/html5/thumbnails/38.jpg)
Start
Finish
Buy(Drill) Buy(Milk) Buy(Ban.)
Have(Drill) Have(Milk) Have(Ban.) at(Home)
At(SM), Sells(SM,Milk) At(SM), Sells(SM,Ban.)At(HWS) Sells(HWS,Drill)
At(Home) Sells(HWS,Drill) Sells(SM,Milk) Sells(SM,Ban.)
Go(HWS)At(x) Go(SM)
At(x)
![Page 39: Partial Order Planning](https://reader036.fdocuments.net/reader036/viewer/2022062502/56814e82550346895dbc1f0e/html5/thumbnails/39.jpg)
Start
Go(HWS)
Finish
Buy(Drill) Buy(Milk) Buy(Ban.)
Go(SM)
Have(Drill) Have(Milk) Have(Ban.) at(Home)
At(SM), Sells(SM,Milk) At(SM), Sells(SM,Ban.)
At(Home)
At(HWS) Sells(HWS,Drill)
At(Home) Sells(HWS,Drill) Sells(SM,Milk) Sells(SM,Ban.)
At(Home)
![Page 40: Partial Order Planning](https://reader036.fdocuments.net/reader036/viewer/2022062502/56814e82550346895dbc1f0e/html5/thumbnails/40.jpg)
Start
Go(HWS)
Finish
Buy(Drill) Buy(Milk) Buy(Ban.)
Go(SM)
Have(Drill) Have(Milk) Have(Ban.) at(Home)
At(SM), Sells(SM,Milk) At(SM), Sells(SM,Ban.)
At(Home)
At(HWS) Sells(HWS,Drill)
At(Home) Sells(HWS,Drill) Sells(SM,Milk) Sells(SM,Ban.)
At(Home)
![Page 41: Partial Order Planning](https://reader036.fdocuments.net/reader036/viewer/2022062502/56814e82550346895dbc1f0e/html5/thumbnails/41.jpg)
Start
Go(HWS)
Finish
Buy(Drill) Buy(Milk) Buy(Ban.)
Go(SM)
Have(Drill) Have(Milk) Have(Ban.) at(Home)
At(SM), Sells(SM,Milk) At(SM), Sells(SM,Ban.)
At(Home)
At(HWS) Sells(HWS,Drill)
At(Home) Sells(HWS,Drill) Sells(SM,Milk) Sells(SM,Ban.)
At(Home)
![Page 42: Partial Order Planning](https://reader036.fdocuments.net/reader036/viewer/2022062502/56814e82550346895dbc1f0e/html5/thumbnails/42.jpg)
Start
Go(HWS)
Finish
Buy(Drill) Buy(Milk) Buy(Ban.)
Go(SM)
Have(Drill) Have(Milk) Have(Ban.) at(Home)
At(SM), Sells(SM,Milk) At(SM), Sells(SM,Ban.)
At(Home)
At(HWS) Sells(HWS,Drill)
At(Home) Sells(HWS,Drill) Sells(SM,Milk) Sells(SM,Ban.)
At(x)
Go(Home)At(SM)
![Page 43: Partial Order Planning](https://reader036.fdocuments.net/reader036/viewer/2022062502/56814e82550346895dbc1f0e/html5/thumbnails/43.jpg)
Start
Finish
Buy(Drill) Buy(Milk) Buy(Ban.)
Have(Drill) Have(Milk) Have(Ban.) at(Home)
At(SM), Sells(SM,Milk) At(SM), Sells(SM,Ban.)At(HWS) Sells(HWS,Drill)
At(Home) Sells(HWS,Drill) Sells(SM,Milk) Sells(SM,Ban.)
Go(HWS)At(x) Go(SM)
At(x)
![Page 44: Partial Order Planning](https://reader036.fdocuments.net/reader036/viewer/2022062502/56814e82550346895dbc1f0e/html5/thumbnails/44.jpg)
Start
Go(HWS)
Finish
Buy(Drill) Buy(Milk) Buy(Ban.)
Go(SM)
Have(Drill) Have(Milk) Have(Ban.) at(Home)
At(SM), Sells(SM,Milk) At(SM), Sells(SM,Ban.)
At(Home)
At(HWS) Sells(HWS,Drill)
At(Home) Sells(HWS,Drill) Sells(SM,Milk) Sells(SM,Ban.)
At(Home)
![Page 45: Partial Order Planning](https://reader036.fdocuments.net/reader036/viewer/2022062502/56814e82550346895dbc1f0e/html5/thumbnails/45.jpg)
Start
Go(HWS)
Finish
Buy(Drill) Buy(Milk) Buy(Ban.)
Go(SM)
Have(Drill) Have(Milk) Have(Ban.) at(Home)
At(SM), Sells(SM,Milk) At(SM), Sells(SM,Ban.)
At(Home)
At(HWS) Sells(HWS,Drill)
At(Home) Sells(HWS,Drill) Sells(SM,Milk) Sells(SM,Ban.)
At(Home)
![Page 46: Partial Order Planning](https://reader036.fdocuments.net/reader036/viewer/2022062502/56814e82550346895dbc1f0e/html5/thumbnails/46.jpg)
Start
Go(HWS)
Finish
Buy(Drill) Buy(Milk) Buy(Ban.)
Go(SM)
Have(Drill) Have(Milk) Have(Ban.) at(Home)
At(SM), Sells(SM,Milk) At(SM), Sells(SM,Ban.)
At(Home)
At(HWS) Sells(HWS,Drill)
At(Home) Sells(HWS,Drill) Sells(SM,Milk) Sells(SM,Ban.)
At(x)
Go(Home)At(SM)
![Page 47: Partial Order Planning](https://reader036.fdocuments.net/reader036/viewer/2022062502/56814e82550346895dbc1f0e/html5/thumbnails/47.jpg)
Monitors
Autonomous Agents: What is missing?
Command dispatchFault protectionAttitude control
Mission Goal Scenario
Self-commandingSelf-commandingSelf-diagnosingSelf-diagnosingSelf-repairingSelf-repairing
RECOVERY
PLANNIN
G
EXECUTION
![Page 48: Partial Order Planning](https://reader036.fdocuments.net/reader036/viewer/2022062502/56814e82550346895dbc1f0e/html5/thumbnails/48.jpg)
Many Action Representations:(Many Studied In This Course)
Trac
tabl
eEx
pres
sive
STRIPS
MDPs
POMDPs
Situation Calculus
SADL
ADL, UWL
ProbabilisticConcurrent ConstraintAutomata
HierarchicalHybrid
ConstraintAutomata
DS1 DDL
TPNs