Title: Planners and Planning Languages
1Planners and Planning Languages
- April 4th, 2000
- Ryan Wagner
2- Introduction
- Simple Planning Agent
- Planning vs. Problem Solving
- Planning Using Situation Calculus
- Basic Representation for Planning
- Planning Examples
- Summary
3Introduction
- Origins
- Problem solving using state-space searching
- Theorem proving
- Robotics
- Planners are like problem solving agents
- states
- goals
- actions
4Introduction (2)
- Differences
- use logic to represent goals, states, and actions
- searches are executed differently
- use of partial plans and planning algorithms to
achieve a solution - in some ways more intelligent than a problem
solving agent
5- Introduction
- Simple Planning Agent
- Planning vs. Problem Solving
- Planning Using Situation Calculus
- Basic Representation for Planning
- Planning Examples
- Summary
6Simple Planning Agent
- The planning agent uses its percepts of the world
state to form a model of the world. - The agent then takes the goal and formulates a
plan to achieve it. - Planners must be able to distinguish two special
cases - infeasible goals
- goals that are already achieved
7Plans
- Sets of executable steps ordered to achieve the
goal given. - Can be formed progressively or regressively
- i.e. from the initial state (progressive), or
from the goal state backwards (regressive) - Partial plans are basically frameworks for the
plan that will achieve the goal.
8Plans A simple example
- Suppose we are at home and we want to go to
school, and we must take the bus to do so. - A simple plan would likely be
- Start state We are at home.
- Actions required to get to school
- Go to the bus stop
- Get on the bus
- Ride the bus to school
- Get off of the bus
- Walk from the bus stop to the school
- Goal State We are at school.
9- Introduction
- Simple Planning Agent
- Planning vs. Problem Solving
- Planning Using Situation Calculus
- Basic Representation for Planning
- Planning Examples
- Summary
10Planning vs. Problem Solving
- Planning tries to create a representation of
goals, states, and actions that are a bit more
flexible. - These elements are described using a formal
language, like first-order logic. - States and goals correspond to logical sentences
and actions are pairings of preconditions and the
resulting effects.
11Planning vs. Problem Solving (2)
- In creating a plan, actions are added in a
non-linear manner - whenever and wherever they
are needed. - Planners try to make important decisions first to
avoid having to backtrack. - Planners assume the world is mostly independent,
so multiple conjunctive goals can be achieved.
12Conjunctive Goals
- The planner will attempt to solve a conjunctive
goal by splitting it into sub-goals and creating
individual plans to deal with each piece. - Often, however, we require a complex planning
algorithm to achieve a solution as there may be a
particular order in which the sub-plans must be
executed.
13Video Rental - Search
Goal Rent a video, buy some bread, and come home
Start
14Video Rental - Planning
- A simple regressive plan might be
- Start state At Home without Video and Bread
- Actions
- Go to Store
- Buy Bread
- Go to Rogers
- Rent Video
- Go Home
- Goal state At Home with Video and Bread
15- Introduction
- Simple Planning Agent
- Planning vs. Problem Solving
- Planning Using Situation Calculus
- Basic Representation for Planning
- Planning Examples
- Summary
16Planning Using Situation Calculus
- Situation Calculus can often aid us in creating a
planner, using a theorem-prover to decide on a
plan. - Situation Calculus planners represent the initial
state as a sentence, the goal state as a query,
and the actions are such that they transform the
state. - A solution is a plan that achieves the goal state.
17Planning Using Situation Calculus (2)
- The major drawback of using a theorem-prover for
a planner is that a theoretical solution and a
practical solution are often not one and the
same. - In fact, the only guarantee we have for the
solution is that we have reached the goal state,
but no information on the means. - (DoNothing, DoNothing, , Plan)
- (DoSomething, Plan, UndoSomething)
18Planning Using Situation Calculus (3)
- Remember that the method of logical inference is
semidecidable. This affects planning if the
method of inference is unguided by making it
extremely inefficient. - The solution to the problem of semidecidability
is to restrict the language understood by the
prover - i.e. create a planner rather than a
general purpose theorem prover. - The planner will have an algorithm to handle its
language efficiently.
19- Introduction
- Simple Planning Agent
- Planning vs. Problem Solving
- Planning Using Situation Calculus
- Basic Representation for Planning
- Planning Examples
- Summary
20Basic Representation for Planning
- The most basic representation used for creating
planners was developed in 1970 - a language known
as STRIPS - STanford Research Institute Problem Solver
- Extensions of the STRIPS language are often used
in planners today. - STRIPS blends efficient planning with the
expressive situation calculus representation.
21Basic Representation for Planning (2)
- States are represented as conjunctions of
literals, though planners will often not store
entire sets of literals describing the current
state. - In fact, incomplete states often assume that
the literals not indicated are to be treated as
false. - Goals are conjunctions of literals and (often
existentially) qualified variables.
22Planner vs. Theorem Prover
- The fundamental difference between a planner and
a theorem prover is that the planner requests a
sequence of steps that, if executed, will result
in the goal state being true. The theorem prover
evaluates the sentences for validity.
23STRIPS Operators
- Action, Preconditions, and Effects
- An operator is applicable to a given state just
in case the variables for the operator can be
instantiated so all preconditions are satisfied. - The result contains all items introduced by the
effect, plus the old status. However, any effect
that negates something in the old status will not
be true in the new state.
24Situation and Plan Spaces
- Situations are nodes of the search tree between
the initial and goal states. - Planners can search through the situation space
progressively or regressively. - Regressive searches are possible because the
operators have enough knowledge about the
resulting state and the preconditions to decide
if an operator is actually applicable. - Regressive searching is desirable as goals are
not as complex as initial states (fewer
conjuncts), but it is very complicated in
application, and inefficient to do attempt to
overcome this.
25Situation and Plan Spaces (2)
- Plan spaces are made up of partial plans -
basically frameworks for plans - Plan modification involves inserting, removing,
and ordering steps, instantiating variables, etc. - The solution is the final plan
- The steps taken to achieve this are irrelevant
26Situation and Plan Spaces (3)
- Two operators are generally used on plans
- Refinement constrain or eliminate plans from the
space - Modification any other type of plan modification
- Plan frameworks will all contain a start state
and a goal descriptor. The start state sets the
preconditions for the first action, and the goal
state matches the results of the last action.
27Plan Spaces
- Least Commitment - dont make a decision until
you have to. - If a decision is not important at a given stage,
leaving it undecided allows for greater
flexibility later on and results in less
backtracking - This leads to a partial order within the plan.
Any given plan will be a linearization of this
partial ordering.
28Causal Links
- Causal links are formed based on precondition
fulfilling. A causal link is created when a
given state s1 contains a precondition c for
state s2. - s1 c s2
- Causal links are protected. Threats that may
delete a precondition are ordered either before
the first state (demoted) or after the second
(promoted) when linearizing the plan. This
prevents removing the link.
29Causal Links (2)
promote
demote
s1
s3
c
c
s2
30Plans
- Are a set of steps (starting with a start state
and ending with a goal), that involve - ordering restraints (s1 comes before s2)
- variable binding (v is set to X)
- causal links (if it is possible to reach a state
s2 from s1, any preconditions to reach s2 created
by s1 are stored)
31Solutions
- Solutions are executable plans
- Complete Solutions
- if then s1 lt s2 and there is no s3 such that
c results from it where s1 lt s3 lt s2 - Consistent Solutions
- there are no orderings such that s1 lt s2 and s2 lt
s1, or where a variable v A and v B (or v x
B) - Note the transitivity of the lt and operators
s1 c s2
32Possible Threats
- When a state threatens to remove a precondition
necessary to reach another state, it is called a
threat. - Often when variables are not yet instantiated,
they pose possible threats, depending on what
they are later assigned. - There are 3 methods of dealing with the possible
threat.
33Possible Threat Solutions
- Resolving with an equality constraint
- Immediately instantiate the variable to something
that is non-threatening - Resolving with an inequality constraint
- Immediately mark the variable as not equal to the
threatening value. This has lower commitment. - Resolve the threat later
- This has the lowest commitment, but may not
result in an actual solution plan.
34- Introduction
- Simple Planning Agent
- Planning vs. Problem Solving
- Planning Using Situation Calculus
- Basic Representation for Planning
- Planning Examples
- Summary
35Planning Examples
- Partial-order Planner (POP) algorithm - p356
- Blocks World - p359
- Shakeys World - p360
- Video Rental Problem - revisited
36Partial Order Planner
- Uses regressive planning to create a solution.
- Starts with a minimal partial plan and extends
the plan at each step by achieving the
precondition of a state S. - operators are chosen from any steps currently in
the plan or the operator pool - It then sets up causal links and eliminates
threats - If it cannot find an operator at a given point,
it backtracks to the previous choice point. - The POP algorithm is sound and complete - it
always finds a solution if one is possible.
37Blocks World
- Builds stacks of blocks on a table top
- Uses two state descriptors and an operator
- On(x, y) indicates x is on top of y
- Clear(x) indicates x has nothing on top of it
- Move(x, y, z)
- Preconditions Clear(x) /\ Clear(z) /\ On(x, y)
- Effect On(x, z) /\ Clear(y) /\ On(x, y) /\
Clear(z) - Note Move(x, y, Table) and Move(x, Table, z)
have some concerns with Clear(Table). In the
former, the table must be clear to move the block
and in the later, the table is then marked as
clear.
38Blocks World (2)
- Solution
- Change the meaning of Clear(x) to mean there is
room on x for a block - Add a new rule MoveToTable(x, y)
- Preconditions On(x, y) /\ Clear(x) /\ Table(y)
- Effect On(x, Table) /\ Clear(y) /\ On(x, y)
- Modify the Move(x, y, z) rule
- Preconditions On(x,y) /\ Clear(x) /\ Clear(z)
/\ Table(z) - Effect On(x, z) /\ Clear(y) /\ On(x, y) /\
Clear(z)
39Blocks World Example
- Start State On(A, Table) /\ On(C, A) /\
Clear(C) /\ On(B, Table) /\ Clear(B)
- Goal State On(C, Table) /\ On(B, C) /\ On(A,
B) /\ Clear(A)
40Shakeys World
- A planner designed to allow a robot to move
between rooms and perform some restricted
actions. - Uses actions such as
- Go(loc),
- Push(obj, loc1, loc2),
- Climb(box) and Down(box)
- TurnOn(light_switch) and TurnOff(light_switch)
- Predicates such as
- Pushable(object), On(Shakey, level), At(Shakey,
loc), Climbable(box), In(obj, loc) - Constant - Floor
41Video Rental - Search
Goal Rent a video, buy some bread, and come home
Start
42Video Rental - Planning
Start
At(Home) Rents(Rogers, Video) Sells(Store, Bread)
At(Home) Have(Video) Have(Bread)
Finish
43Video Rental - Planning
Start
At(Home) Rents(Rogers, Video) Sells(Store, Bread)
At(Home) Have(Video) Have(Bread)
Finish
44Video Rental - Planning
Start
At(Home) Rents(Rogers, Video) Sells(Store, Bread)
At(Home) Have(Video) Have(Bread)
Finish
45Video Rental - Planning
Start
At(Home) Rents(Rogers, Video) Sells(Store, Bread)
At(x)
At(x)
Go(Rogers)
Go(Store)
At(Rogers) Rents(Rogers, Video)
At(Store) Sells(Store, Bread)
Buy(Bread)
Rent(Video)
At(Home) Have(Video) Have(Bread)
Finish
46Video Rental - Planning
Start
At(Home) Rents(Rogers, Video) Sells(Store, Bread)
At(Home)
Go(Rogers)
Go(Store)
At(Rogers) Rents(Rogers, Video)
At(Store) Sells(Store, Bread)
Buy(Bread)
Rent(Video)
At(Home) Have(Video) Have(Bread)
Finish
47Video Rental - Planning
Start
At(Home) Rents(Rogers, Video) Sells(Store, Bread)
At(Home)
Go(Rogers)
Go(Store)
At(Rogers) Rents(Rogers, Video)
At(Store) Sells(Store, Bread)
Buy(Bread)
Rent(Video)
At(Home) Have(Video) Have(Bread)
Finish
48Video Rental - Planning
Start
49- Introduction
- Simple Planning Agent
- Planning vs. Problem Solving
- Planning Using Situation Calculus
- Basic Representation for Planning
- Planning Examples
- Summary
50Summary
- Planners use formal representations of states,
goals, and actions to allow greater flexibility
in determining paths from the start state to the
finish. - Planners often take one of two approaches to
solving a problem - progressive or regressive
plan building. - Least Commitment is making decisions only when it
is necessary, thus reducing backtracking. - Partial Plans are often a better solution
mechanism than searching as they reduce the
complexity of the method. - Causal links are used to determine and resolve
conflicts when working with partial-order plans.