SlideShare a Scribd company logo
1 of 48
Download to read offline
1
Artificial Intelligence
Brigitte Jaumard
Dept of Computer Science and Software
Engineering
Concordia University
Montreal (Quebec) Canada
Lecturer 7 – Part I: Planning
2
2
Outline
n Planning problem
n State-space search
n Partial-order planning
n Planning graphs
n Planning with propositional logic
3
Search vs. planning
n Consider the task get milk, bananas, and a cordless drill
n Standard search algorithms seem to fail miserably:
n After-the-fact heuristic/goal test inadequate
4
Planning problem
n Planning is the task of determining a sequence of
actions that will achieve a goal.
n Domain independent heuristics and strategies
must be based on a domain independent
representation
q General planning algorithms require a way to represent
states, actions and goals
q STRIPS, ADL, PDDL are languages based on propositional
or first-order logic
n Classical planning environment
q fully observable, deterministic, finite, static and discrete.
5
Additional complexities
n Because the world is …
q Dynamic
q Stochastic
q Partially observable
n And because actions
q take time
q have continuous effects
6
AI Planning background
n Focus on classical planning; assume none of
the above
n Deterministic, static, fully observable
q “Basic”
q Most of the recent progress
q Ideas often also useful for more complex
problems
CPM: Critical Path Method
Start
[0,0]
AddEngine1
30
[0,15]
AddWheels1
30
[30,45]
10
Inspect1
[60,75]
Finish
[85,85]
10
Inspect2
[75,75]
15
AddWheels2
[60,60]
60
AddEngine2
[0,0]
AddEngine1
AddWheels1
Inspect1
AddWheels2
Inspect2
AddEngine2
0 10 20 30 40 50 60 70 80 90
7
Critical Path Method (Cont’d)
n
8
9
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?
q Preconditions and effects
n We’ll represent all these as logical predicates
STRIPS STRIPS
• Developed at Stanford in early 1970s (Stanford Research Institute
Planning System), for the first “intelligent” robot
• Domain: a set of typed objects; usually represented as propositions
• States are represented as first-order predicates over objects
– Closed-world assumption: everything not stated is false; the only
objects in the world are the ones defined
• Operators/Actions defined in terms of:
– Preconditions: when can the action be applied?
– Effects: what happens after the action?
No explicit description of how the action should be executed
• Goals: conjunctions of literals
10
STRIPS Representation
STRIPS representations
• States are represented as conjunctions
In(Robot,room) ¬ In(Charger, r) ...
• Goals are represented as conjunctions:
(implicit ⌥ r) In(Robot, r) In(Charger, r)
• Actions (operators):
– Name: Go(here, there)
– Preconditions: expressed as conjunctions
At(Robot, here) Path(here, there)
– Postconditions (effects): expressed as conjunctions
At(Robot, there) ¬ At(Robot, here)
• Variables can only be instantiated with objects of the correct type
11
STRIPS Operator Representation
STRIPS Operator Representation
• Operators have a name, preconditions and postconditions or effects
• Preconditions are conjunctions of positive literals
• Postconditions/effects are represented in terms of:
– Add-list: list of propositions that become true after the action
– Delete-list: list of propositions that become false after the action
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!
This is a very restricted language, which means we can do e⇥cient inference.
13
Example: Buying Action
Example: Buying Action
• Action: Buy(x) (where x is a good)
• Precondition: At(s), Sells(s,x,p), HaveMoney(p) (where s is a store, p is
the price)
• Effect:
– Add-list: Have(x)
– Delete-list: HaveMoney(p)
• Note that many important details are abstracted away!
• Additional propositions can be added to show that now the store has the
money, the stock has decreased etc.
14
Example: Move Action
Example: Move Action
• Action: Move(object, from, to)
• Preconditions: At(object, from), Clear(to), Clear(object)
• Effects:
– Add-list: At(object, to), Clear(from)
– Delete-list: At(object, from), Clear(to)
15
Pros and Cons of STRIPS
Pros and cons of STRIPS
• Pros:
– Since it is restricted, inference can be done e⇥ciently
– All operators can be viewed as simple deletions and additions of
propositions to the knowledge base
• Cons:
– Assumes that a small number of propositions will change for each
action (otherwise operators are hard to write down, and reasoning
becomes expensive)
– Limited language (preconditions and effects are expressed as
conjunctions, implicit quantifiers), so not applicable to all domains
of interest.
Example: Move action
• Action:
– Move(object, from, to)
• Preconditions:
– At(object, from), Clear(to), Clear(object)
• Effects:
– Add-list: At(object, to), Clear(from)
– Delete-list: At(object, from), Clear(to)
16
Example: Block World
Example: Blocks World
COMP-424: Artificial intelligence Joelle Pineau
14
Welcome to the Blocks World!
Initial state = On(A,table) ! On(B,table) ! On(C,table) ! Clear(A) ! Clear(B) ! Clear(C)
Goal state = On(A,B) !On (B,C)
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)
C
A B C
A
B
Initial state Goal state
17
State Transitions in the Blocks World
State Transitions in the Blocks World
STRIPS state transitions
18
Two Basic Approaches to Planning
Pros and cons of STRIPS
Pros:
– Since it is restricted, inference can be done efficiently.
– All operators can be viewed as simple deletions and additions of
propositions to the knowledge base.
Cons:
– Assumes that a small number of propositions will change for each
Two Basic Approaches to Planning
1. State-space planning works at the level of the states and operators
• Finding a plan is formulated as a search through state space, looking
for a path from the start state to the goal state(s)
• Most similar to constructive search
2. Plan-space planning works at the level of plans
• Finding a plan is formulated as a search through the space of plans
• We start with a partial, possibly incorrect plan, then apply changes to
it to make it a full, correct plan
• Most similar to iterative improvement/repair
19
20
Planning with state-space search
n Both forward and backward search possible
n Progression planners
q forward state-space search
q consider the effect of all possible actions in a given state
n Regression planners
q backward state-space search
q Determine what must have been true in the previous state
in order to achieve the current state
Plan-Space Planning in the Blocks World
Plan-Space Planning in the Blocks World
• Start with plan: Put(A,B), Put(B,C)
• Plan fails because the precondition of the second action is not satisfied
after the first action
• So we can try to add a step, remove a step, or re-order the steps
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
Progression (Forward) Planning
1. Determine all operators that are applicable in the start state
2. Ground the operators, by replacing any variables with constants
3. Choose an operator to apply
4. Determine the new content of the knowledge base, based on the operator
description
5. Repeat until goal state is reached.
23
Example: Supermarket Domain
Example: Supermarket Domain
• In the start state we have At(Home), which allows us to apply operators
of the type Go(x,y).
• The operator can be instantiated as Go(Home, HardwareStore),
Go(Home,GroceryStore), Go(Home, School), ...
• If we choose to apply Go(Home, HardwareStore), we will delete from the
KB At(Home) and add At(HardwareStore).
• The new proposition enables new actions, e.g. Buy
Note that in this case there are a lot of possible operators to perform!
24
Goal Regression
Goal Regression
• Introduced in Newell & Simon’s General Problem Solver
• Algorithm:
1. Pick an action that satisfies (some of) the goal propositions
2. Make a new goal by:
– Removing the goal conditions satisfied by the action
– Adding the preconditions of this action
– Keeping any unsolved goal propositions
3. Repeat until the goal set is satisfied by the start state
25
Example: Supermarket Domain
Example: Supermarket Domain
• In the goal state we have At(Home) Have(Milk) Have(Drill)
• The action Buy(Milk) would allow us to achieve Have(Milk)
• To apply this action we need to have the precondition At(GroceryStore),
so we add it to the set of propositions we want to achieve
• The goal set becomes: At(Home) At(GroceryStore) Have(Drill)
• Next, we may want to achieve At(HardwareStore)
Note that in this case the order in which we try to achieve these propositions
matters!
26
Variations of Goal Regression
Variations of Goal Regression
• Using a stack of goals - also called linear planning
This is not complete! I.e. we may not find a plan even if one exists
• Using a set of goals - also called non-linear planning
This is complete, but more expensive (need to decide what to work on
next)
• Both versions are sound: only legal plans will be found
27
Prodigy Planner
COMP-424, Lecture 9 - February 4, 2013 49
Prodigy Planner
• Do both forward search and goal regression at the same time.
• At each step, choose either an operator to apply or goal to regress
• Uses domain-dependent heuristics to guide the search
• General heuristics (e.g. number of propositions satisfied) do not work
well in planning, because subgoals interact
28
Total vs. Partial Order
Total vs. Partial Order
• Total order: Plan is always a strict sequence of actions
COMP-424: Artificial intelligence Joelle Pineau
3
Total vs. Partial Order
• Total order: Plan is always a strict sequence of actions
E.g. To paint the ceiling
• Partial order: Plan steps may be unordered
Start Get Brush Get Ladder Paint ceiling Finish
Start Get Brush
Get Ladder Paint ceiling Finish
Start
Get Brush
Get Ladder
Paint ceiling Finish
Plan 1:
Plan 2:
• Partial order: Plan steps may be unordered
COMP-424: Artificial intelligence Joelle Pineau
3
Total vs. Partial Order
• Total order: Plan is always a strict sequence of actions
E.g. To paint the ceiling
• Partial order: Plan steps may be unordered
Start Get Brush Get Ladder Paint ceiling Finish
Start Get Brush
Get Ladder Paint ceiling Finish
Start
Get Brush
Get Ladder
Paint ceiling Finish
Plan 1:
Plan 2:
29
Partial Order Planning
2
COMP-424: Artificial intelligence Joelle Pineau
4
Can maintain both state and plans (e.g. Prodigy)
COMP-424: Artificial intelligence Joelle Pineau
4
Can maintain both state and plans (e.g. Prodigy)
–Search space is a set of partial plans
–Transitions are plan operators
Partial Order Planning
• Search in plan space and use least commitment whenever possible
• In state space search:
– Search space is a set of states of the world
– Actions cause transitions between states
– Plan is a path through state space
• In plan space search:
– Search space is a set of partial plans
– Plan operators cause transitions
– Goal is a legal plan
• Can maintain both state and plans (e.g. Prodigy)
30
Plan-Space Planners
31
Plan-Space Planners
Plan is defined by ↵A, O, B, L :
• A is a set of actions/operators from the problem domain
• O is a set of ordering constraints of the form ai < aj
The constraint specifies that ai must come before aj but does not say
exactly when
• B is a set of bindings, of the form vi = C, vi ⇧= C, vi = vj or vi ⇧= vj,
where vi, vj are variables and C is a constant
• L is a set of causal links, which records why a certain ordering has to
occur:
ai ⇥c
aj means that action ai achieves effect c which is a precondition
of aj
Plan Transformations
COMP-424, Lecture 9 - February 4, 2013 53
Plan Transformations
• Adding actions
• Specifying orderings
• Binding variables
Constraint satisfaction is used along the way to ensure the consistency of
orderings
32
Discussion of Partial-Order Planning
33
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
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
• Conditional (contingency) planning:
1. Plans include observation actions which obtain information
2. Sub-plans are created for each contingency (each possible outcome of
the observation actions)
E.g. Check the tire. If it is intact, then we’re ok, otherwise there are
several possible solutions: inflate, call AAA....
Expensive because it plans for many unlikely cases
• Monitoring/Replanning:
1. Assume normal states, outcomes
2. Check progress during execution, replan if necessary
Unanticipated outcomes may lead to failure (e.g., no AAA card)
In general, some monitoring is unavoidable
35
Monitoring
Monitoring
• Execution monitoring: “failure” means that the preconditions of the
remaining plan not met
• Action monitoring: “failure” means that the preconditions of the
next action not met (or action itself fails)
In both cases, need to replan
36
Replanning
Replanning
• Simplest: on failure, replan from scratch
• Better: plan to get back on track by reconnecting to best continuation
In this case, we can try to reconnect to the plan’s next action, or some
future action
The latter is typically more expensive in terms of planning computation
(lots of possible places to reconnect!) but usually yields better plans (e.g.
if it is very hard to achieve the preconditions of the very next action)
37
Summary
Summary
• Planning is very related to search, but allows the actions/states have
more structure
• We typically use logical inference to construct solutions
• State-space vs.plan-space planning
• Least-commitment: we build partial plans, order them only as necessary
• In the real world, it is necessary to consider failure cases - replanning
• Hierarchy and abstraction make planning more e⇥cient
• Many varieties of planners that we have not looked at: case-based
planners, MDP planners (we will see this later on) etc.
38
39
Progression and regression
initial state
goal
40
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
41
Forward Search Methods:
can use A* with some h and g
42
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.
43
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.
n Each precondition literal of A is added , unless it already
appears.
n Any standard search algorithm can be added to perform the
search.
n Termination when predecessor satisfied by initial state.
q In FO case, satisfaction might require a substitution.
44
Backward search methods
Regressing a
ground
operator
45
Regressing an ungrounded operator
Example of Backward Search
47
A partial order plan for putting
shoes and socks
Reading and Suggested Exercises
n Chapters 10
n Exercises: 10.3, 10.4, 10.15
48

More Related Content

What's hot

Planning Agent
Planning AgentPlanning Agent
Planning AgentShiwani Gupta
 
Classical Planning
Classical PlanningClassical Planning
Classical Planningahmad bassiouny
 
Propositional logic
Propositional logicPropositional logic
Propositional logicRushdi Shams
 
I. Hill climbing algorithm II. Steepest hill climbing algorithm
I. Hill climbing algorithm II. Steepest hill climbing algorithmI. Hill climbing algorithm II. Steepest hill climbing algorithm
I. Hill climbing algorithm II. Steepest hill climbing algorithmvikas dhakane
 
AI_Session 25 classical planning.pptx
AI_Session 25 classical planning.pptxAI_Session 25 classical planning.pptx
AI_Session 25 classical planning.pptxAsst.prof M.Gokilavani
 
AI_Session 11: searching with Non-Deterministic Actions and partial observati...
AI_Session 11: searching with Non-Deterministic Actions and partial observati...AI_Session 11: searching with Non-Deterministic Actions and partial observati...
AI_Session 11: searching with Non-Deterministic Actions and partial observati...Asst.prof M.Gokilavani
 
Inference in First-Order Logic
Inference in First-Order Logic Inference in First-Order Logic
Inference in First-Order Logic Junya Tanaka
 
Knowledge based agents
Knowledge based agentsKnowledge based agents
Knowledge based agentsMegha Sharma
 
First order logic
First order logicFirst order logic
First order logicChinmay Patel
 
Introduction to prolog
Introduction to prologIntroduction to prolog
Introduction to prologHarry Potter
 
Ch2 3-informed (heuristic) search
Ch2 3-informed (heuristic) searchCh2 3-informed (heuristic) search
Ch2 3-informed (heuristic) searchchandsek666
 
5 csp
5 csp5 csp
5 cspMhd Sb
 
Structured Knowledge Representation
Structured Knowledge RepresentationStructured Knowledge Representation
Structured Knowledge RepresentationSagacious IT Solution
 
Forms of learning in ai
Forms of learning in aiForms of learning in ai
Forms of learning in aiRobert Antony
 
Semantic nets in artificial intelligence
Semantic nets in artificial intelligenceSemantic nets in artificial intelligence
Semantic nets in artificial intelligenceharshita virwani
 

What's hot (20)

Planning Agent
Planning AgentPlanning Agent
Planning Agent
 
Classical Planning
Classical PlanningClassical Planning
Classical Planning
 
Propositional logic
Propositional logicPropositional logic
Propositional logic
 
AI: Planning and AI
AI: Planning and AIAI: Planning and AI
AI: Planning and AI
 
I. Hill climbing algorithm II. Steepest hill climbing algorithm
I. Hill climbing algorithm II. Steepest hill climbing algorithmI. Hill climbing algorithm II. Steepest hill climbing algorithm
I. Hill climbing algorithm II. Steepest hill climbing algorithm
 
AI_Session 25 classical planning.pptx
AI_Session 25 classical planning.pptxAI_Session 25 classical planning.pptx
AI_Session 25 classical planning.pptx
 
AI_Session 11: searching with Non-Deterministic Actions and partial observati...
AI_Session 11: searching with Non-Deterministic Actions and partial observati...AI_Session 11: searching with Non-Deterministic Actions and partial observati...
AI_Session 11: searching with Non-Deterministic Actions and partial observati...
 
Inference in First-Order Logic
Inference in First-Order Logic Inference in First-Order Logic
Inference in First-Order Logic
 
Knowledge based agents
Knowledge based agentsKnowledge based agents
Knowledge based agents
 
First order logic
First order logicFirst order logic
First order logic
 
Introduction to prolog
Introduction to prologIntroduction to prolog
Introduction to prolog
 
Ch2 3-informed (heuristic) search
Ch2 3-informed (heuristic) searchCh2 3-informed (heuristic) search
Ch2 3-informed (heuristic) search
 
5 csp
5 csp5 csp
5 csp
 
Structured Knowledge Representation
Structured Knowledge RepresentationStructured Knowledge Representation
Structured Knowledge Representation
 
Planning
Planning Planning
Planning
 
Ai Slides
Ai SlidesAi Slides
Ai Slides
 
AI_unit IV Full Notes.pdf
AI_unit IV Full Notes.pdfAI_unit IV Full Notes.pdf
AI_unit IV Full Notes.pdf
 
AI_Session 20 Horn clause.pptx
AI_Session 20 Horn clause.pptxAI_Session 20 Horn clause.pptx
AI_Session 20 Horn clause.pptx
 
Forms of learning in ai
Forms of learning in aiForms of learning in ai
Forms of learning in ai
 
Semantic nets in artificial intelligence
Semantic nets in artificial intelligenceSemantic nets in artificial intelligence
Semantic nets in artificial intelligence
 

Similar to AI_Planning.pdf

CH4_AI_Lecture.ppt
CH4_AI_Lecture.pptCH4_AI_Lecture.ppt
CH4_AI_Lecture.pptAhmedNURHUSIEN
 
21CSC206T_UNIT 5.pptx artificial intelligence
21CSC206T_UNIT 5.pptx artificial intelligence21CSC206T_UNIT 5.pptx artificial intelligence
21CSC206T_UNIT 5.pptx artificial intelligenceANTOARA2211003040050
 
15_Planninsjsjsjsjajahajahahatayayyaauua
15_Planninsjsjsjsjajahajahahatayayyaauua15_Planninsjsjsjsjajahajahahatayayyaauua
15_PlanninsjsjsjsjajahajahahatayayyaauuaFunnyPoi
 
Search-Beyond-Classical-no-exercise-answers.pdf
Search-Beyond-Classical-no-exercise-answers.pdfSearch-Beyond-Classical-no-exercise-answers.pdf
Search-Beyond-Classical-no-exercise-answers.pdfMrRRThirrunavukkaras
 
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.pptRahulkumarTivarekar1
 
Scheduling And Htn
Scheduling And HtnScheduling And Htn
Scheduling And Htnahmad bassiouny
 
Hierarchical Reinforcement Learning
Hierarchical Reinforcement LearningHierarchical Reinforcement Learning
Hierarchical Reinforcement Learningahmad bassiouny
 
Cs344 lect15-robotic-knowledge-inferencing-prolog-11feb08
Cs344 lect15-robotic-knowledge-inferencing-prolog-11feb08Cs344 lect15-robotic-knowledge-inferencing-prolog-11feb08
Cs344 lect15-robotic-knowledge-inferencing-prolog-11feb08Praveen Kumar
 
1.1 1.4-introduction
1.1 1.4-introduction1.1 1.4-introduction
1.1 1.4-introductionatulg0213
 
Reinfrocement Learning
Reinfrocement LearningReinfrocement Learning
Reinfrocement LearningNatan Katz
 
anintroductiontoreinforcementlearning-180912151720.pdf
anintroductiontoreinforcementlearning-180912151720.pdfanintroductiontoreinforcementlearning-180912151720.pdf
anintroductiontoreinforcementlearning-180912151720.pdfssuseradaf5f
 
An introduction to reinforcement learning
An introduction to reinforcement learningAn introduction to reinforcement learning
An introduction to reinforcement learningSubrat Panda, PhD
 
Lecture 3 Problem Solving.pptx
Lecture 3 Problem Solving.pptxLecture 3 Problem Solving.pptx
Lecture 3 Problem Solving.pptxAndrewKuziwakwasheMu
 
Unit 5 Introduction to Planning and ANN.pptx
Unit 5 Introduction to Planning and ANN.pptxUnit 5 Introduction to Planning and ANN.pptx
Unit 5 Introduction to Planning and ANN.pptxDrYogeshDeshmukh1
 
09_Informed_Search.ppt
09_Informed_Search.ppt09_Informed_Search.ppt
09_Informed_Search.pptrnyau
 

Similar to AI_Planning.pdf (20)

CH4_AI_Lecture.ppt
CH4_AI_Lecture.pptCH4_AI_Lecture.ppt
CH4_AI_Lecture.ppt
 
21CSC206T_UNIT 5.pptx artificial intelligence
21CSC206T_UNIT 5.pptx artificial intelligence21CSC206T_UNIT 5.pptx artificial intelligence
21CSC206T_UNIT 5.pptx artificial intelligence
 
15_Planninsjsjsjsjajahajahahatayayyaauua
15_Planninsjsjsjsjajahajahahatayayyaauua15_Planninsjsjsjsjajahajahahatayayyaauua
15_Planninsjsjsjsjajahajahahatayayyaauua
 
Planning
PlanningPlanning
Planning
 
Search-Beyond-Classical-no-exercise-answers.pdf
Search-Beyond-Classical-no-exercise-answers.pdfSearch-Beyond-Classical-no-exercise-answers.pdf
Search-Beyond-Classical-no-exercise-answers.pdf
 
Slides15
Slides15Slides15
Slides15
 
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
 
Scheduling And Htn
Scheduling And HtnScheduling And Htn
Scheduling And Htn
 
Lesson 22
Lesson 22Lesson 22
Lesson 22
 
AI Lesson 22
AI Lesson 22AI Lesson 22
AI Lesson 22
 
Hierarchical Reinforcement Learning
Hierarchical Reinforcement LearningHierarchical Reinforcement Learning
Hierarchical Reinforcement Learning
 
Cs344 lect15-robotic-knowledge-inferencing-prolog-11feb08
Cs344 lect15-robotic-knowledge-inferencing-prolog-11feb08Cs344 lect15-robotic-knowledge-inferencing-prolog-11feb08
Cs344 lect15-robotic-knowledge-inferencing-prolog-11feb08
 
1.1 1.4-introduction
1.1 1.4-introduction1.1 1.4-introduction
1.1 1.4-introduction
 
Reinfrocement Learning
Reinfrocement LearningReinfrocement Learning
Reinfrocement Learning
 
anintroductiontoreinforcementlearning-180912151720.pdf
anintroductiontoreinforcementlearning-180912151720.pdfanintroductiontoreinforcementlearning-180912151720.pdf
anintroductiontoreinforcementlearning-180912151720.pdf
 
An introduction to reinforcement learning
An introduction to reinforcement learningAn introduction to reinforcement learning
An introduction to reinforcement learning
 
Lecture 3 Problem Solving.pptx
Lecture 3 Problem Solving.pptxLecture 3 Problem Solving.pptx
Lecture 3 Problem Solving.pptx
 
Unit 5 Introduction to Planning and ANN.pptx
Unit 5 Introduction to Planning and ANN.pptxUnit 5 Introduction to Planning and ANN.pptx
Unit 5 Introduction to Planning and ANN.pptx
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
 
09_Informed_Search.ppt
09_Informed_Search.ppt09_Informed_Search.ppt
09_Informed_Search.ppt
 

Recently uploaded

Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonJericReyAuditor
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 

Recently uploaded (20)

Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lesson
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 

AI_Planning.pdf

  • 1. 1 Artificial Intelligence Brigitte Jaumard Dept of Computer Science and Software Engineering Concordia University Montreal (Quebec) Canada Lecturer 7 – Part I: Planning
  • 2. 2 2 Outline n Planning problem n State-space search n Partial-order planning n Planning graphs n Planning with propositional logic
  • 3. 3 Search vs. planning n Consider the task get milk, bananas, and a cordless drill n Standard search algorithms seem to fail miserably: n After-the-fact heuristic/goal test inadequate
  • 4. 4 Planning problem n Planning is the task of determining a sequence of actions that will achieve a goal. n Domain independent heuristics and strategies must be based on a domain independent representation q General planning algorithms require a way to represent states, actions and goals q STRIPS, ADL, PDDL are languages based on propositional or first-order logic n Classical planning environment q fully observable, deterministic, finite, static and discrete.
  • 5. 5 Additional complexities n Because the world is … q Dynamic q Stochastic q Partially observable n And because actions q take time q have continuous effects
  • 6. 6 AI Planning background n Focus on classical planning; assume none of the above n Deterministic, static, fully observable q “Basic” q Most of the recent progress q Ideas often also useful for more complex problems
  • 7. CPM: Critical Path Method Start [0,0] AddEngine1 30 [0,15] AddWheels1 30 [30,45] 10 Inspect1 [60,75] Finish [85,85] 10 Inspect2 [75,75] 15 AddWheels2 [60,60] 60 AddEngine2 [0,0] AddEngine1 AddWheels1 Inspect1 AddWheels2 Inspect2 AddEngine2 0 10 20 30 40 50 60 70 80 90 7
  • 8. Critical Path Method (Cont’d) n 8
  • 9. 9 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? q Preconditions and effects n We’ll represent all these as logical predicates
  • 10. STRIPS STRIPS • Developed at Stanford in early 1970s (Stanford Research Institute Planning System), for the first “intelligent” robot • Domain: a set of typed objects; usually represented as propositions • States are represented as first-order predicates over objects – Closed-world assumption: everything not stated is false; the only objects in the world are the ones defined • Operators/Actions defined in terms of: – Preconditions: when can the action be applied? – Effects: what happens after the action? No explicit description of how the action should be executed • Goals: conjunctions of literals 10
  • 11. STRIPS Representation STRIPS representations • States are represented as conjunctions In(Robot,room) ¬ In(Charger, r) ... • Goals are represented as conjunctions: (implicit ⌥ r) In(Robot, r) In(Charger, r) • Actions (operators): – Name: Go(here, there) – Preconditions: expressed as conjunctions At(Robot, here) Path(here, there) – Postconditions (effects): expressed as conjunctions At(Robot, there) ¬ At(Robot, here) • Variables can only be instantiated with objects of the correct type 11
  • 12. STRIPS Operator Representation STRIPS Operator Representation • Operators have a name, preconditions and postconditions or effects • Preconditions are conjunctions of positive literals • Postconditions/effects are represented in terms of: – Add-list: list of propositions that become true after the action – Delete-list: list of propositions that become false after the action 12
  • 13. 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! This is a very restricted language, which means we can do e⇥cient inference. 13
  • 14. Example: Buying Action Example: Buying Action • Action: Buy(x) (where x is a good) • Precondition: At(s), Sells(s,x,p), HaveMoney(p) (where s is a store, p is the price) • Effect: – Add-list: Have(x) – Delete-list: HaveMoney(p) • Note that many important details are abstracted away! • Additional propositions can be added to show that now the store has the money, the stock has decreased etc. 14
  • 15. Example: Move Action Example: Move Action • Action: Move(object, from, to) • Preconditions: At(object, from), Clear(to), Clear(object) • Effects: – Add-list: At(object, to), Clear(from) – Delete-list: At(object, from), Clear(to) 15
  • 16. Pros and Cons of STRIPS Pros and cons of STRIPS • Pros: – Since it is restricted, inference can be done e⇥ciently – All operators can be viewed as simple deletions and additions of propositions to the knowledge base • Cons: – Assumes that a small number of propositions will change for each action (otherwise operators are hard to write down, and reasoning becomes expensive) – Limited language (preconditions and effects are expressed as conjunctions, implicit quantifiers), so not applicable to all domains of interest. Example: Move action • Action: – Move(object, from, to) • Preconditions: – At(object, from), Clear(to), Clear(object) • Effects: – Add-list: At(object, to), Clear(from) – Delete-list: At(object, from), Clear(to) 16
  • 17. Example: Block World Example: Blocks World COMP-424: Artificial intelligence Joelle Pineau 14 Welcome to the Blocks World! Initial state = On(A,table) ! On(B,table) ! On(C,table) ! Clear(A) ! Clear(B) ! Clear(C) Goal state = On(A,B) !On (B,C) 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) C A B C A B Initial state Goal state 17
  • 18. State Transitions in the Blocks World State Transitions in the Blocks World STRIPS state transitions 18
  • 19. Two Basic Approaches to Planning Pros and cons of STRIPS Pros: – Since it is restricted, inference can be done efficiently. – All operators can be viewed as simple deletions and additions of propositions to the knowledge base. Cons: – Assumes that a small number of propositions will change for each Two Basic Approaches to Planning 1. State-space planning works at the level of the states and operators • Finding a plan is formulated as a search through state space, looking for a path from the start state to the goal state(s) • Most similar to constructive search 2. Plan-space planning works at the level of plans • Finding a plan is formulated as a search through the space of plans • We start with a partial, possibly incorrect plan, then apply changes to it to make it a full, correct plan • Most similar to iterative improvement/repair 19
  • 20. 20 Planning with state-space search n Both forward and backward search possible n Progression planners q forward state-space search q consider the effect of all possible actions in a given state n Regression planners q backward state-space search q Determine what must have been true in the previous state in order to achieve the current state
  • 21. Plan-Space Planning in the Blocks World Plan-Space Planning in the Blocks World • Start with plan: Put(A,B), Put(B,C) • Plan fails because the precondition of the second action is not satisfied after the first action • So we can try to add a step, remove a step, or re-order the steps 21
  • 22. 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
  • 23. Progression (Forward) Planning Progression (Forward) Planning 1. Determine all operators that are applicable in the start state 2. Ground the operators, by replacing any variables with constants 3. Choose an operator to apply 4. Determine the new content of the knowledge base, based on the operator description 5. Repeat until goal state is reached. 23
  • 24. Example: Supermarket Domain Example: Supermarket Domain • In the start state we have At(Home), which allows us to apply operators of the type Go(x,y). • The operator can be instantiated as Go(Home, HardwareStore), Go(Home,GroceryStore), Go(Home, School), ... • If we choose to apply Go(Home, HardwareStore), we will delete from the KB At(Home) and add At(HardwareStore). • The new proposition enables new actions, e.g. Buy Note that in this case there are a lot of possible operators to perform! 24
  • 25. Goal Regression Goal Regression • Introduced in Newell & Simon’s General Problem Solver • Algorithm: 1. Pick an action that satisfies (some of) the goal propositions 2. Make a new goal by: – Removing the goal conditions satisfied by the action – Adding the preconditions of this action – Keeping any unsolved goal propositions 3. Repeat until the goal set is satisfied by the start state 25
  • 26. Example: Supermarket Domain Example: Supermarket Domain • In the goal state we have At(Home) Have(Milk) Have(Drill) • The action Buy(Milk) would allow us to achieve Have(Milk) • To apply this action we need to have the precondition At(GroceryStore), so we add it to the set of propositions we want to achieve • The goal set becomes: At(Home) At(GroceryStore) Have(Drill) • Next, we may want to achieve At(HardwareStore) Note that in this case the order in which we try to achieve these propositions matters! 26
  • 27. Variations of Goal Regression Variations of Goal Regression • Using a stack of goals - also called linear planning This is not complete! I.e. we may not find a plan even if one exists • Using a set of goals - also called non-linear planning This is complete, but more expensive (need to decide what to work on next) • Both versions are sound: only legal plans will be found 27
  • 28. Prodigy Planner COMP-424, Lecture 9 - February 4, 2013 49 Prodigy Planner • Do both forward search and goal regression at the same time. • At each step, choose either an operator to apply or goal to regress • Uses domain-dependent heuristics to guide the search • General heuristics (e.g. number of propositions satisfied) do not work well in planning, because subgoals interact 28
  • 29. Total vs. Partial Order Total vs. Partial Order • Total order: Plan is always a strict sequence of actions COMP-424: Artificial intelligence Joelle Pineau 3 Total vs. Partial Order • Total order: Plan is always a strict sequence of actions E.g. To paint the ceiling • Partial order: Plan steps may be unordered Start Get Brush Get Ladder Paint ceiling Finish Start Get Brush Get Ladder Paint ceiling Finish Start Get Brush Get Ladder Paint ceiling Finish Plan 1: Plan 2: • Partial order: Plan steps may be unordered COMP-424: Artificial intelligence Joelle Pineau 3 Total vs. Partial Order • Total order: Plan is always a strict sequence of actions E.g. To paint the ceiling • Partial order: Plan steps may be unordered Start Get Brush Get Ladder Paint ceiling Finish Start Get Brush Get Ladder Paint ceiling Finish Start Get Brush Get Ladder Paint ceiling Finish Plan 1: Plan 2: 29
  • 30. Partial Order Planning 2 COMP-424: Artificial intelligence Joelle Pineau 4 Can maintain both state and plans (e.g. Prodigy) COMP-424: Artificial intelligence Joelle Pineau 4 Can maintain both state and plans (e.g. Prodigy) –Search space is a set of partial plans –Transitions are plan operators Partial Order Planning • Search in plan space and use least commitment whenever possible • In state space search: – Search space is a set of states of the world – Actions cause transitions between states – Plan is a path through state space • In plan space search: – Search space is a set of partial plans – Plan operators cause transitions – Goal is a legal plan • Can maintain both state and plans (e.g. Prodigy) 30
  • 31. Plan-Space Planners 31 Plan-Space Planners Plan is defined by ↵A, O, B, L : • A is a set of actions/operators from the problem domain • O is a set of ordering constraints of the form ai < aj The constraint specifies that ai must come before aj but does not say exactly when • B is a set of bindings, of the form vi = C, vi ⇧= C, vi = vj or vi ⇧= vj, where vi, vj are variables and C is a constant • L is a set of causal links, which records why a certain ordering has to occur: ai ⇥c aj means that action ai achieves effect c which is a precondition of aj
  • 32. Plan Transformations COMP-424, Lecture 9 - February 4, 2013 53 Plan Transformations • Adding actions • Specifying orderings • Binding variables Constraint satisfaction is used along the way to ensure the consistency of orderings 32
  • 33. Discussion of Partial-Order Planning 33 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
  • 34. 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
  • 35. Solutions Solutions • Conditional (contingency) planning: 1. Plans include observation actions which obtain information 2. Sub-plans are created for each contingency (each possible outcome of the observation actions) E.g. Check the tire. If it is intact, then we’re ok, otherwise there are several possible solutions: inflate, call AAA.... Expensive because it plans for many unlikely cases • Monitoring/Replanning: 1. Assume normal states, outcomes 2. Check progress during execution, replan if necessary Unanticipated outcomes may lead to failure (e.g., no AAA card) In general, some monitoring is unavoidable 35
  • 36. Monitoring Monitoring • Execution monitoring: “failure” means that the preconditions of the remaining plan not met • Action monitoring: “failure” means that the preconditions of the next action not met (or action itself fails) In both cases, need to replan 36
  • 37. Replanning Replanning • Simplest: on failure, replan from scratch • Better: plan to get back on track by reconnecting to best continuation In this case, we can try to reconnect to the plan’s next action, or some future action The latter is typically more expensive in terms of planning computation (lots of possible places to reconnect!) but usually yields better plans (e.g. if it is very hard to achieve the preconditions of the very next action) 37
  • 38. Summary Summary • Planning is very related to search, but allows the actions/states have more structure • We typically use logical inference to construct solutions • State-space vs.plan-space planning • Least-commitment: we build partial plans, order them only as necessary • In the real world, it is necessary to consider failure cases - replanning • Hierarchy and abstraction make planning more e⇥cient • Many varieties of planners that we have not looked at: case-based planners, MDP planners (we will see this later on) etc. 38
  • 40. 40 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
  • 41. 41 Forward Search Methods: can use A* with some h and g
  • 42. 42 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.
  • 43. 43 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. n Each precondition literal of A is added , unless it already appears. n Any standard search algorithm can be added to perform the search. n Termination when predecessor satisfied by initial state. q In FO case, satisfaction might require a substitution.
  • 47. 47 A partial order plan for putting shoes and socks
  • 48. Reading and Suggested Exercises n Chapters 10 n Exercises: 10.3, 10.4, 10.15 48