SlideShare a Scribd company logo
1 of 28
CPS 270: Artificial Intelligence
http://www.cs.duke.edu/courses/fall08/cps270/
Planning
Instructor: Vincent Conitzer
Planning
• We studied how to take actions in the world
(search)
• We studied how to represent objects, relations,
etc. (logic)
• Now we will combine the two!
State of the world (STRIPS language)
• State of the world = conjunction of positive,
ground, function-free literals
• At(Home) AND IsAt(Umbrella, Home) AND
CanBeCarried(Umbrella) AND
IsUmbrella(Umbrella) AND HandEmpty AND Dry
• Not OK as part of the state:
– NOT(At(Home)) (negative)
– At(x) (not ground)
– At(Bedroom(Home)) (uses the function Bedroom)
• Any literal not mentioned is assumed false
– Other languages make different assumptions, e.g.,
negative literals part of state, unmentioned literals
unknown
An action: TakeObject
• TakeObject(location, x)
• Preconditions:
– HandEmpty
– CanBeCarried(x)
– At(location)
– IsAt(x, location)
• Effects (“NOT something” means that that
something should be removed from state):
– Holding(x)
– NOT(HandEmpty)
– NOT(IsAt(x, location))
Another action
• WalkWithUmbrella(location1, location2,
umbr)
• Preconditions:
–At(location1)
–Holding(umbr)
–IsUmbrella(umbr)
• Effects:
– At(location2)
– NOT(At(location1))
Yet another action
• WalkWithoutUmbrella(location1,
location2)
• Preconditions:
–At(location1)
• Effects:
– At(location2)
– NOT(At(location1))
– NOT(Dry)
A goal and a plan
• Goal: At(Work) AND Dry
• Recall initial state:
– At(Home) AND IsAt(Umbrella, Home) AND
CanBeCarried(Umbrella) AND IsUmbrella(Umbrella)
AND HandEmpty AND Dry
• TakeObject(Home, Umbrella)
– At(Home) AND CanBeCarried(Umbrella) AND
IsUmbrella(Umbrella) AND Dry AND Holding(Umbrella)
• WalkWithUmbrella(Home, Work, Umbrella)
– At(Work) AND CanBeCarried(Umbrella) AND
IsUmbrella(Umbrella) AND Dry AND Holding(Umbrella)
Planning to write a paper
• Suppose your goal is to be a co-author on an AI paper
with both theorems and experiments, within a year
LearnAbout(x,y)
Preconditions: HasTimeForStudy(x)
Effects: Knows(x,y),
NOT(HasTimeForStudy(x))
HaveNewIdea(x)
Preconditions: Knows(x,AI),
Creative(x)
Effects: Idea, Contributed(x)
ProveTheorems(x)
Preconditions: Knows(x,AI),
Knows(x,Math), Idea
Effect: Theorems, Contributed(x)
PerformExperiments(x)
Preconditions: Knows(x,AI),
Knows(x,Coding), Idea
Effect: Experiments, Contributed(x)
WritePaper(x)
Preconditions: Knows(x,AI),
Knows(x,Writing), Idea,
Theorems, Experiments
Effect: Paper, Contributed(x)
Goal: Paper AND Contributed(You)
FindExistingOpenProblem(x)
Preconditions: Knows(x,AI)
Effects: Idea
Name a few things that are
missing/unrealistic…
Some start states
Start1: HasTimeForStudy(You) AND Knows(You,Math) AND Knows(You,Coding) AND
Knows(You,Writing)
Start2: HasTimeForStudy(You) AND Creative(You) AND Knows(Advisor,AI) AND
Knows(Advisor,Math) AND Knows(Advisor,Coding) AND Knows(Advisor,Writing)
(Good luck with that plan…)
Start3: Knows(You,AI) AND Knows(You,Coding) AND Knows(OfficeMate,Math) AND
HasTimeForStudy(OfficeMate) AND Knows(Advisor,AI) AND Knows(Advisor,Writing)
Start4: HasTimeForStudy(You) AND Knows(Advisor,AI) AND Knows(Advisor,Math) AND
Knows(Advisor,Coding) AND Knows(Advisor,Writing)
We’ll use these as examples…
Forward state-space search
(progression planning)
• Successors: all states that can be reached with an
action whose preconditions are satisfied in current state
At(Home)
IsAt(Umbrella, Home)
CanBeCarried(Umbrella)
IsUmbrella(Umbrella)
HandEmpty
Dry
At(Home)
Holding(Umbrella)
CanBeCarried(Umbrella)
IsUmbrella(Umbrella)
Dry
TakeObject(Home, Umbrella)
At(Work)
IsAt(Umbrella, Home)
CanBeCarried(Umbrella)
IsUmbrella(Umbrella)
HandEmpty
WalkWithoutUm
brella(Home,
Work)
WalkWithUmbrella(
Home, Work,
Umbrella)
At(Work)
Holding(Umbrella)
CanBeCarried(Umbrella)
IsUmbrella(Umbrella)
Dry
WalkWithout
Umbrella(Wor
k, Home)
At(Home)
IsAt(Umbrella, Home)
CanBeCarried(Umbrella)
IsUmbrella(Umbrella)
HandEmpty
GOAL!
WalkWithoutUmbrella(
Home, Umbrella) (!)
WalkWithoutUm
brella(Home,
Work)
Backward state-space search
(regression planning)
• Predecessors: for every action that accomplishes one of
the literals (and does not undo another literal), remove
that literal and add all the preconditions
At(location1)
At(location2)
IsAt(umbr, location2)
CanBeCarried(umbr)
IsUmbrella(umbr)
HandEmpty
Dry
At(location1)
Holding(umbr)
IsUmbrella(umbr)
Dry
TakeObject(location2, umbr)
This is accomplished in the
start state, by substituting
location1=location2=Home,
umbr=Umbrella
WalkWithUmbrella(
location1, Work,
umbr)
At(Work)
Dry
GOAL
WalkWithUmbrella(location2, location1)
WalkWithoutUmbrella can never be used, because it undoes Dry
(this is good)
Heuristics for state-space search
• Cost of a plan: (usually) number of actions
• Heuristic 1: plan for each subgoal (literal)
separately, sum costs of plans
– Does this ever underestimate? Overestimate?
• Heuristic 2: solve a relaxed planning problem in
which actions never delete literals (empty-delete-
list heuristic)
– Does this ever underestimate? Overestimate?
– Very effective, even though requires solution to (easy)
planning problem
• Progression planners with empty-delete-list
heuristic perform well
Blocks world
• On(B, A), On(A, Table), On(D, C), On(C,
Table), Clear(B), Clear(D)
A
B
C
D
Blocks world: Move action
• Move(x,y,z)
• Preconditions:
– On(x,y), Clear(x), Clear(z)
• Effects:
– On(x,z), Clear(y), NOT(On(x,y)), NOT(Clear(z))
A
B
C
D
Blocks world: MoveToTable action
• MoveToTable(x,y)
• Preconditions:
– On(x,y), Clear(x)
• Effects:
– On(x,Table), Clear(y), NOT(On(x,y))
A
B
C
D
Blocks world example
• Goal: On(A,B) AND Clear(A) AND On(C,D)
AND Clear(C)
• A plan: MoveToTable(B, A), MoveToTable(D,
C), Move(C, Table, D), Move(A, Table, B)
• Really two separate problems
A
B
C
D
A partial-order plan
Goal: On(A,B) AND
Clear(A) AND
On(C,D) AND
Clear(C)
A
B
C
D
Start
MoveToTable(
B,A)
MoveToTable(
D,C)
Move(A,
Table, B)
Move(C,
Table, D)
Finish
Any total order on the actions consistent with
this partial order will work
A partial-order plan (with more detail)
Start
MoveToTable(B,
A)
MoveToTable(D,
C)
Move(A,T
able, B)
Move(C,
Table, D)
Finish
On(B,A) Clear(B) On(D,C)
Clear(D)
Clear(A)Clear(B) On(A, Table) Clear(D) Clear(C)
On(C, Table)
On(A, B) On(C, D)
Clear(A) Clear(C)
On(B,A) Clear(B) On(D,C)
Clear(D)
On(A, Table) On(C, Table)
Not everything decomposes into
multiple problems: Sussman Anomaly
• Goal: On(A,B) AND On(B,C)
• Focusing on one of these two individually first
does not work
• Optimal plan: MoveToTable(C,A),
Move(B,Table,C), Move(A,Table,B)
A B
C
An incorrect partial order plan for
the Sussman Anomaly
Start
Finish
On(A, B)
On(A, Table)
MoveToTable(C,
A) Move(B,
Table,C)
Move(A,
Table,B)
On(B, C)
On(B, Table) Clear(B)
On(C, A)
Clear(C)
On(C, A)
Clear(C)
Clear(A) On(A, Table) Clear(B)
Clear(B)
Clear(C) On(B, Table)
Move(B,Table,C) must be
after MoveToTable(C,A),
otherwise it will ruin
Clear(C)
Move(A,Table,B) must be
after Move(B,Table,C),
otherwise it will ruin
Clear(B)
Corrected partial order plan for the
Sussman Anomaly
Start
Finish
On(A, B)
On(A, Table)
MoveToTable(C,
A) Move(B,
Table, C)
Move(A,
Table, B)
On(B, C)
On(B, Table) Clear(B)
On(C, A)
Clear(C)
On(C, A)
Clear(C)
Clear(A) On(A, Table) Clear(B)
Clear(B)
Clear(C) On(B, Table)
No more flexibility in the
order due to protection of
causal links
Searching for partial-order plans
• Somewhat similar to constraint satisfaction
• Search state = partially completed partial order plan
– Not to be confused with states of the world
– Contains actions, ordering constraints on actions, causal links, some open
preconditions
• Search works as follows:
– Choose one open precondition p,
– Consider all actions that achieve p (including ones already in the plan),
– For each such action, consider each way of resolving conflicts using ordering
constraints
• Why do we need to consider only one open precondition (instead of
all)? Is this true for backward state-space search?
• Tricky to resolve conflicts if we leave variables unbound
Searching for a partial-order plan
Start
WalkWithoutUmbrella(H
ome, Work
Finish
At(Work) Dry
At(Home) IsAt(Umbrella,Home) CanBeCarried(Umbrella) IsUmbrella(Umbrella) HandEmpty Dry
no way to resolve conflict!
WalkWithUmbrella(H
ome, Work
At(Home)
At(Home)Holding(Umbrella) IsUmbrella(Umbrella)
TakeObject(Home,
Umbrella)
HandEmpty
CanBeCarried(Umbrella)
At(Home) IsAt(Umbrella,Home)
Planning graphs
• Each level has literals
that “could be true” at
that level
• Mutex (mutual
exclusion) relations
indicate incompatible
actions/literals
On(C, A)
On(A, Table)
Clear(C)
MoveToTable(C,A)
Move(C,A,B)
On(B, Table)
Clear(B)
Move(B,Table,C)
On(C, A)
On(A, Table)
Clear(C)
On(B, Table)
Clear(B)
On(C, Table)
On(C, B)
On(B, C)
Clear(A) … continued on board
Reasons for mutex relations…
• … between actions:
– Inconsistent effects: one action negates effect of
the other
– Interference: effect of one action negates
precondition of the other
– Competing needs: the actions have preconditions
that are mutex
• … between literals:
– Inconsistent support: any pair of actions that can
achieve these literals is mutex
A problematic case for
planning graphs
• FeedWith(x, y)
–Preconditions: Edible(y)
–Effects: NOT(Edible(y)), Fed(x)
• Start: Edible(Bread1), Edible(Bread2)
• Goal: Fed(Person1), Fed(Person2),
Fed(Person3)
Planning graph for feeding
• Any two of these could
simultaneously be true at
time 1, so no mutex
relations
• Really need 3-way mutex
relations, but experimentally
this is computationally not
worthwhile
Edible(Bread1) FeedWith(Person1,
Bread1)
Edible(Bread2)
FeedWith(Person2,
Bread1)
FeedWith(Person3,
Bread1)
FeedWith(Person1,
Bread2)
FeedWith(Person2,
Bread2)
FeedWith(Person3,
Bread2)
Edible(Bread1)
Edible(Bread2)
Fed(Person1)
Fed(Person2)
Fed(Person3)
Uses of planning graphs
• If the goal literals do not all appear at a level (or
have mutex relations) then we know we need
another level
– Converse does not hold
• Useful heuristic: first time that all goal literals
appear at a level, with no mutex relations
• Graphplan algorithm: once all goal literals appear,
try to extract solution from graph
– Can use CSP techniques by labeling each action as “in
the plan” or “out of the plan”
– In case of failure, generate another level

More Related Content

Similar to cps270_planning.ppt

Lesson10 transformational geometry
Lesson10 transformational geometryLesson10 transformational geometry
Lesson10 transformational geometryAcceleratedClasses
 
D.E.V. Project- Precalculus Functions
D.E.V. Project- Precalculus FunctionsD.E.V. Project- Precalculus Functions
D.E.V. Project- Precalculus Functionshilschroeds19
 
Brains@Bay Meetup: The Increasing Role of Sensorimotor Experience in Artifici...
Brains@Bay Meetup: The Increasing Role of Sensorimotor Experience in Artifici...Brains@Bay Meetup: The Increasing Role of Sensorimotor Experience in Artifici...
Brains@Bay Meetup: The Increasing Role of Sensorimotor Experience in Artifici...Numenta
 
Integrated Influence - The Six Million Dollar Man of AI
Integrated Influence - The Six Million Dollar Man of AIIntegrated Influence - The Six Million Dollar Man of AI
Integrated Influence - The Six Million Dollar Man of AILuke Dicken
 
2.a-CMPS 403-F20-Session 2-Search Problems.pdf
2.a-CMPS 403-F20-Session 2-Search Problems.pdf2.a-CMPS 403-F20-Session 2-Search Problems.pdf
2.a-CMPS 403-F20-Session 2-Search Problems.pdfAmirMohamedNabilSale
 
2.7 Piecewise Functions
2.7 Piecewise Functions2.7 Piecewise Functions
2.7 Piecewise Functionshisema01
 
Week 2 - ML models and Linear Regression.pptx
Week 2 - ML models and Linear Regression.pptxWeek 2 - ML models and Linear Regression.pptx
Week 2 - ML models and Linear Regression.pptxHafizAliHummad
 
Chap 4 local_search
Chap 4 local_search Chap 4 local_search
Chap 4 local_search Rakhi Gupta
 
Introduction to search and optimisation for the design theorist
Introduction to search and optimisation for the design theoristIntroduction to search and optimisation for the design theorist
Introduction to search and optimisation for the design theoristAkin Osman Kazakci
 

Similar to cps270_planning.ppt (20)

Classical Planning
Classical PlanningClassical Planning
Classical Planning
 
Classical Planning
Classical PlanningClassical Planning
Classical Planning
 
l2.pptx
l2.pptxl2.pptx
l2.pptx
 
Lesson10 transformational geometry
Lesson10 transformational geometryLesson10 transformational geometry
Lesson10 transformational geometry
 
Planning
PlanningPlanning
Planning
 
Planning
PlanningPlanning
Planning
 
Planning
Planning Planning
Planning
 
l2.pptx
l2.pptxl2.pptx
l2.pptx
 
D.E.V. Project- Precalculus Functions
D.E.V. Project- Precalculus FunctionsD.E.V. Project- Precalculus Functions
D.E.V. Project- Precalculus Functions
 
Brains@Bay Meetup: The Increasing Role of Sensorimotor Experience in Artifici...
Brains@Bay Meetup: The Increasing Role of Sensorimotor Experience in Artifici...Brains@Bay Meetup: The Increasing Role of Sensorimotor Experience in Artifici...
Brains@Bay Meetup: The Increasing Role of Sensorimotor Experience in Artifici...
 
Integrated Influence - The Six Million Dollar Man of AI
Integrated Influence - The Six Million Dollar Man of AIIntegrated Influence - The Six Million Dollar Man of AI
Integrated Influence - The Six Million Dollar Man of AI
 
2.a-CMPS 403-F20-Session 2-Search Problems.pdf
2.a-CMPS 403-F20-Session 2-Search Problems.pdf2.a-CMPS 403-F20-Session 2-Search Problems.pdf
2.a-CMPS 403-F20-Session 2-Search Problems.pdf
 
2.7 Piecewise Functions
2.7 Piecewise Functions2.7 Piecewise Functions
2.7 Piecewise Functions
 
Week 2 - ML models and Linear Regression.pptx
Week 2 - ML models and Linear Regression.pptxWeek 2 - ML models and Linear Regression.pptx
Week 2 - ML models and Linear Regression.pptx
 
Chap 4 local_search
Chap 4 local_search Chap 4 local_search
Chap 4 local_search
 
Lesson 23
Lesson 23Lesson 23
Lesson 23
 
AI Lesson 23
AI Lesson 23AI Lesson 23
AI Lesson 23
 
Introduction to search and optimisation for the design theorist
Introduction to search and optimisation for the design theoristIntroduction to search and optimisation for the design theorist
Introduction to search and optimisation for the design theorist
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
 
RPT_AI-06_A_Planning Intro.ppt
RPT_AI-06_A_Planning Intro.pptRPT_AI-06_A_Planning Intro.ppt
RPT_AI-06_A_Planning Intro.ppt
 

Recently uploaded

Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and usesDevarapalliHaritha
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2RajaP95
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 

Recently uploaded (20)

Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and uses
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 

cps270_planning.ppt

  • 1. CPS 270: Artificial Intelligence http://www.cs.duke.edu/courses/fall08/cps270/ Planning Instructor: Vincent Conitzer
  • 2. Planning • We studied how to take actions in the world (search) • We studied how to represent objects, relations, etc. (logic) • Now we will combine the two!
  • 3. State of the world (STRIPS language) • State of the world = conjunction of positive, ground, function-free literals • At(Home) AND IsAt(Umbrella, Home) AND CanBeCarried(Umbrella) AND IsUmbrella(Umbrella) AND HandEmpty AND Dry • Not OK as part of the state: – NOT(At(Home)) (negative) – At(x) (not ground) – At(Bedroom(Home)) (uses the function Bedroom) • Any literal not mentioned is assumed false – Other languages make different assumptions, e.g., negative literals part of state, unmentioned literals unknown
  • 4. An action: TakeObject • TakeObject(location, x) • Preconditions: – HandEmpty – CanBeCarried(x) – At(location) – IsAt(x, location) • Effects (“NOT something” means that that something should be removed from state): – Holding(x) – NOT(HandEmpty) – NOT(IsAt(x, location))
  • 5. Another action • WalkWithUmbrella(location1, location2, umbr) • Preconditions: –At(location1) –Holding(umbr) –IsUmbrella(umbr) • Effects: – At(location2) – NOT(At(location1))
  • 6. Yet another action • WalkWithoutUmbrella(location1, location2) • Preconditions: –At(location1) • Effects: – At(location2) – NOT(At(location1)) – NOT(Dry)
  • 7. A goal and a plan • Goal: At(Work) AND Dry • Recall initial state: – At(Home) AND IsAt(Umbrella, Home) AND CanBeCarried(Umbrella) AND IsUmbrella(Umbrella) AND HandEmpty AND Dry • TakeObject(Home, Umbrella) – At(Home) AND CanBeCarried(Umbrella) AND IsUmbrella(Umbrella) AND Dry AND Holding(Umbrella) • WalkWithUmbrella(Home, Work, Umbrella) – At(Work) AND CanBeCarried(Umbrella) AND IsUmbrella(Umbrella) AND Dry AND Holding(Umbrella)
  • 8. Planning to write a paper • Suppose your goal is to be a co-author on an AI paper with both theorems and experiments, within a year LearnAbout(x,y) Preconditions: HasTimeForStudy(x) Effects: Knows(x,y), NOT(HasTimeForStudy(x)) HaveNewIdea(x) Preconditions: Knows(x,AI), Creative(x) Effects: Idea, Contributed(x) ProveTheorems(x) Preconditions: Knows(x,AI), Knows(x,Math), Idea Effect: Theorems, Contributed(x) PerformExperiments(x) Preconditions: Knows(x,AI), Knows(x,Coding), Idea Effect: Experiments, Contributed(x) WritePaper(x) Preconditions: Knows(x,AI), Knows(x,Writing), Idea, Theorems, Experiments Effect: Paper, Contributed(x) Goal: Paper AND Contributed(You) FindExistingOpenProblem(x) Preconditions: Knows(x,AI) Effects: Idea Name a few things that are missing/unrealistic…
  • 9. Some start states Start1: HasTimeForStudy(You) AND Knows(You,Math) AND Knows(You,Coding) AND Knows(You,Writing) Start2: HasTimeForStudy(You) AND Creative(You) AND Knows(Advisor,AI) AND Knows(Advisor,Math) AND Knows(Advisor,Coding) AND Knows(Advisor,Writing) (Good luck with that plan…) Start3: Knows(You,AI) AND Knows(You,Coding) AND Knows(OfficeMate,Math) AND HasTimeForStudy(OfficeMate) AND Knows(Advisor,AI) AND Knows(Advisor,Writing) Start4: HasTimeForStudy(You) AND Knows(Advisor,AI) AND Knows(Advisor,Math) AND Knows(Advisor,Coding) AND Knows(Advisor,Writing) We’ll use these as examples…
  • 10. Forward state-space search (progression planning) • Successors: all states that can be reached with an action whose preconditions are satisfied in current state At(Home) IsAt(Umbrella, Home) CanBeCarried(Umbrella) IsUmbrella(Umbrella) HandEmpty Dry At(Home) Holding(Umbrella) CanBeCarried(Umbrella) IsUmbrella(Umbrella) Dry TakeObject(Home, Umbrella) At(Work) IsAt(Umbrella, Home) CanBeCarried(Umbrella) IsUmbrella(Umbrella) HandEmpty WalkWithoutUm brella(Home, Work) WalkWithUmbrella( Home, Work, Umbrella) At(Work) Holding(Umbrella) CanBeCarried(Umbrella) IsUmbrella(Umbrella) Dry WalkWithout Umbrella(Wor k, Home) At(Home) IsAt(Umbrella, Home) CanBeCarried(Umbrella) IsUmbrella(Umbrella) HandEmpty GOAL! WalkWithoutUmbrella( Home, Umbrella) (!) WalkWithoutUm brella(Home, Work)
  • 11. Backward state-space search (regression planning) • Predecessors: for every action that accomplishes one of the literals (and does not undo another literal), remove that literal and add all the preconditions At(location1) At(location2) IsAt(umbr, location2) CanBeCarried(umbr) IsUmbrella(umbr) HandEmpty Dry At(location1) Holding(umbr) IsUmbrella(umbr) Dry TakeObject(location2, umbr) This is accomplished in the start state, by substituting location1=location2=Home, umbr=Umbrella WalkWithUmbrella( location1, Work, umbr) At(Work) Dry GOAL WalkWithUmbrella(location2, location1) WalkWithoutUmbrella can never be used, because it undoes Dry (this is good)
  • 12. Heuristics for state-space search • Cost of a plan: (usually) number of actions • Heuristic 1: plan for each subgoal (literal) separately, sum costs of plans – Does this ever underestimate? Overestimate? • Heuristic 2: solve a relaxed planning problem in which actions never delete literals (empty-delete- list heuristic) – Does this ever underestimate? Overestimate? – Very effective, even though requires solution to (easy) planning problem • Progression planners with empty-delete-list heuristic perform well
  • 13. Blocks world • On(B, A), On(A, Table), On(D, C), On(C, Table), Clear(B), Clear(D) A B C D
  • 14. Blocks world: Move action • Move(x,y,z) • Preconditions: – On(x,y), Clear(x), Clear(z) • Effects: – On(x,z), Clear(y), NOT(On(x,y)), NOT(Clear(z)) A B C D
  • 15. Blocks world: MoveToTable action • MoveToTable(x,y) • Preconditions: – On(x,y), Clear(x) • Effects: – On(x,Table), Clear(y), NOT(On(x,y)) A B C D
  • 16. Blocks world example • Goal: On(A,B) AND Clear(A) AND On(C,D) AND Clear(C) • A plan: MoveToTable(B, A), MoveToTable(D, C), Move(C, Table, D), Move(A, Table, B) • Really two separate problems A B C D
  • 17. A partial-order plan Goal: On(A,B) AND Clear(A) AND On(C,D) AND Clear(C) A B C D Start MoveToTable( B,A) MoveToTable( D,C) Move(A, Table, B) Move(C, Table, D) Finish Any total order on the actions consistent with this partial order will work
  • 18. A partial-order plan (with more detail) Start MoveToTable(B, A) MoveToTable(D, C) Move(A,T able, B) Move(C, Table, D) Finish On(B,A) Clear(B) On(D,C) Clear(D) Clear(A)Clear(B) On(A, Table) Clear(D) Clear(C) On(C, Table) On(A, B) On(C, D) Clear(A) Clear(C) On(B,A) Clear(B) On(D,C) Clear(D) On(A, Table) On(C, Table)
  • 19. Not everything decomposes into multiple problems: Sussman Anomaly • Goal: On(A,B) AND On(B,C) • Focusing on one of these two individually first does not work • Optimal plan: MoveToTable(C,A), Move(B,Table,C), Move(A,Table,B) A B C
  • 20. An incorrect partial order plan for the Sussman Anomaly Start Finish On(A, B) On(A, Table) MoveToTable(C, A) Move(B, Table,C) Move(A, Table,B) On(B, C) On(B, Table) Clear(B) On(C, A) Clear(C) On(C, A) Clear(C) Clear(A) On(A, Table) Clear(B) Clear(B) Clear(C) On(B, Table) Move(B,Table,C) must be after MoveToTable(C,A), otherwise it will ruin Clear(C) Move(A,Table,B) must be after Move(B,Table,C), otherwise it will ruin Clear(B)
  • 21. Corrected partial order plan for the Sussman Anomaly Start Finish On(A, B) On(A, Table) MoveToTable(C, A) Move(B, Table, C) Move(A, Table, B) On(B, C) On(B, Table) Clear(B) On(C, A) Clear(C) On(C, A) Clear(C) Clear(A) On(A, Table) Clear(B) Clear(B) Clear(C) On(B, Table) No more flexibility in the order due to protection of causal links
  • 22. Searching for partial-order plans • Somewhat similar to constraint satisfaction • Search state = partially completed partial order plan – Not to be confused with states of the world – Contains actions, ordering constraints on actions, causal links, some open preconditions • Search works as follows: – Choose one open precondition p, – Consider all actions that achieve p (including ones already in the plan), – For each such action, consider each way of resolving conflicts using ordering constraints • Why do we need to consider only one open precondition (instead of all)? Is this true for backward state-space search? • Tricky to resolve conflicts if we leave variables unbound
  • 23. Searching for a partial-order plan Start WalkWithoutUmbrella(H ome, Work Finish At(Work) Dry At(Home) IsAt(Umbrella,Home) CanBeCarried(Umbrella) IsUmbrella(Umbrella) HandEmpty Dry no way to resolve conflict! WalkWithUmbrella(H ome, Work At(Home) At(Home)Holding(Umbrella) IsUmbrella(Umbrella) TakeObject(Home, Umbrella) HandEmpty CanBeCarried(Umbrella) At(Home) IsAt(Umbrella,Home)
  • 24. Planning graphs • Each level has literals that “could be true” at that level • Mutex (mutual exclusion) relations indicate incompatible actions/literals On(C, A) On(A, Table) Clear(C) MoveToTable(C,A) Move(C,A,B) On(B, Table) Clear(B) Move(B,Table,C) On(C, A) On(A, Table) Clear(C) On(B, Table) Clear(B) On(C, Table) On(C, B) On(B, C) Clear(A) … continued on board
  • 25. Reasons for mutex relations… • … between actions: – Inconsistent effects: one action negates effect of the other – Interference: effect of one action negates precondition of the other – Competing needs: the actions have preconditions that are mutex • … between literals: – Inconsistent support: any pair of actions that can achieve these literals is mutex
  • 26. A problematic case for planning graphs • FeedWith(x, y) –Preconditions: Edible(y) –Effects: NOT(Edible(y)), Fed(x) • Start: Edible(Bread1), Edible(Bread2) • Goal: Fed(Person1), Fed(Person2), Fed(Person3)
  • 27. Planning graph for feeding • Any two of these could simultaneously be true at time 1, so no mutex relations • Really need 3-way mutex relations, but experimentally this is computationally not worthwhile Edible(Bread1) FeedWith(Person1, Bread1) Edible(Bread2) FeedWith(Person2, Bread1) FeedWith(Person3, Bread1) FeedWith(Person1, Bread2) FeedWith(Person2, Bread2) FeedWith(Person3, Bread2) Edible(Bread1) Edible(Bread2) Fed(Person1) Fed(Person2) Fed(Person3)
  • 28. Uses of planning graphs • If the goal literals do not all appear at a level (or have mutex relations) then we know we need another level – Converse does not hold • Useful heuristic: first time that all goal literals appear at a level, with no mutex relations • Graphplan algorithm: once all goal literals appear, try to extract solution from graph – Can use CSP techniques by labeling each action as “in the plan” or “out of the plan” – In case of failure, generate another level