CPSC 322 - Lecture 34 - November 26, 2004

CPSC 322 - Lecture 34

Planning Using Constraint Posting


I.  Means-ends analysis

In our planning examples, at the bottom of some slides
you'll see "reduce difference between goal and current
state", but we haven't said much about that.  Reducing
those differences is at the heart of a search strategy
called means-ends analysis.  The planning examples
in your textbook talk about reducing differences between
states, but doesn't mention means-ends analysis by name.
Here's a nice description from another textbook 
("Artificial Intelligence" by Elaine Rich and Kevin Knight):

"So far, we have presented a collection of search strategies
that can reason either forward or backward, but for a given
problem, one direction or another must be chosen.  Often,
however, a mixture of the two directions is appropriate.
Such a mixed strategy would make it possible to solve the
major parts of a problem first and then go back and solve 
the small problems that arise in "gluing" the big pieces
together.  A technique known as means-ends analysis allows
us to do that.

"The means-ends analysis process centers around the 
detection of differences between the current state and the
goal state.  Once such a difference is isolated, an operator
that can reduce the difference must be found.  But perhaps
that operator cannot be applied to the current state.  So
we set up a subproblem of getting to a state in which it
can be applied.  The kind of backward chaining in which
operators are selected and then subgoals are set up to 
establish the preconditions of the operators is called
operator subgoaling.  But maybe the operator does not
produce exactly the goal state we want.  The we have a 
second subproblem of getting from the state it does produce
to the goal.  But if the difference was chosen correctly and
if the operator is really effective at reducing the 
difference, then the two subproblems should be easier to
solve than the original problem.  The means-ends analysis
process can then be applied recursively.  In order to focus
the system's attention on the big problems first, the 
differences can be assigned priority levels.  Difference of
higher priority can then be considered before lower priority
ones."


II.  Planning with constraints

The previous lecture left us with the question of what to
do when our planner can't resolve the conflict caused by
putting block A on top of block B before trying to 
satisfy the goal of putting B on top of C.  The solution
is to take advantage of knowledge about our chosen domain
to provide constraints on what can and can't happen, so 
that the planner can figure out the correct sequence of
actions...specifically,  that B needs to go on top of 
C before A goes on top of B.  But how can it do that?

Here's a very high-level, handwavy explanation.  Given
possibly conflicting goals on(A,B) and on(B,C), the
planner can hypothesize a plan for each goal.  Respectively,
they are pickup(A) followed by stack(A,B), and pickup(B) 
followed immediately by stack(B,C).  So the planner now
has these two constraints that help reduce the number of
ways the actions can be ordered:

  pickup(A)          pickup(B)
  stack(A,B)         stack(B,C)

are ok, but

  pickup(A)          pickup(B)
  stack(A,B)         stack(B,C)

these orderings, for example, are not.

But the planner, with a little programming help from you,
could also see that the postcondition for stack(A,B),
namely ~clear(B), conflicts with the clear(B) precondition
for stack(B,C).  That tells us there's another constraint:
stack(A,B) can't be followed immediately by pickup(B).
The planner could propose that putting more actions 
between stack(A,B) and pickup(B) is a possible solution,
but let's keep things simple.  Let's just assume that
you've given your planner a heuristic that says if 
action2 can't immediately follow action1, try putting
action1 before action2.  Now your constraints tell you
that the following orderings should hold:

  pickup(A)          pickup(B)          pickup(B)
  stack(A,B)         stack(B,C)         stack(A,B)

There are lots of possibilities from here, and the slides
show one way of arriving at a solution, which depends on
a one specific set of heuristics being available and
being applied in a specific order.  Different heuristics
and different priorities will lead to the same plan but
will get there through different reasoning.  What's
important for you to bring away from this example is
not the specific solution, but the fact that a combination
of the right knowledge representation and the right 
heuristics can constrain the search for a plan such that the 
planner doesn't have to generate all possible orderings of 
the actions and execute each resulting plan just to find out
if one of them works.

When one goal or subproblem can interfere with another
goal or subproblem, the planner has to work on the 
subproblems simultaneously, which is what this example
is intended to show.  When the plans to solve conflicting
subproblems must be combined just the right way to get
a final working plan, the planning is called nonlinear
planning.  In this particular case, we've been talking
about nonlinear planning using constraint posting,
but only in the most informal way.  But this isn't
enough to allow you to write a program to do this.  If
you want to get to that level, read Chapter 8.3, and
focus in particular on the section called Partial-Order
Planning.

Last revised: December 7, 2004