Consider a hierarchy with total plans,
subplans for each
non-primitive plan, and depth
, starting with zero at the root, as shown in Figure
18.
The procedure for deriving summary conditions
works by basically propagating the conditions from the primitives up
the hierarchy to the most abstract plans. Because the conditions of
any non-primitive plan depend only on those of its immediate subplans,
deriving summary conditions can be done quickly
if the number of subplans is not large.
The derivation algorithm mainly involves checking for achieve,
clobber, and undo interactions among subplans for all possible total orderings of the subplans (as described in Section
3.4).
Checking for one of these relations for one
summary condition of one subplan is
for
subplans, each
with
summary conditions (as discussed in Section
3.3).
Since there are
conditions that must
be checked in the set of subplans, deriving the summary conditions of
one plan from its subplans is
.
However, the maximum number of summary conditions for a subplan grows exponentially up the hierarchy since, in the worst case, no summary conditions merge during summarization. This happens when the conditions of each subplan are on completely different propositions/variables than those of any sibling subplan. In this case, a separate summary condition will be generated for each summary condition of each subplan. If the children share conditions on the same variable, this information is collapsed into a single summary condition in the parent plan.
As shown in
the third column of the table in Figure 18, a plan at the
lowest level has
summary conditions derived from its
pre-,
in-, and postconditions. A plan at level
derives
summary conditions
from its own conditions and
from each of its
subplans giving
summary conditions, or
. So, in this worst
case
for a plan at level
in a hierarchy for which
each plan has
(non-summary) conditions. Thus, the complexity of
summarizing a plan at level
(with subplans at level
) is
. There are
plans at
level
(second column in the figure), so the complexity of
summarizing the set of plans at level
is
as shown in the fourth column in the
figure. Thus, the complexity of summarizing the entire hierarchy of
plans would be
. In this
summation
dominates, so the complexity can be
simplified to
. If there are
plans in the
hierarchy, we can write this simply as
, which is the
square of the size of the hierarchy.
In the best case where all conditions are on the same variable, each
plan will have summary conditions. Thus, the complexity for
summarizing the hierarchy will be
,
which simplifies to
. In any case, the
summarization of conditions is tractable, and as we discussed in
Section 3.5.2, the summarization of resources is also
tractable.