foundations of computational agents
Regression planning involves searching backwards from a goal, asking the question: what does the agent need to do to achieve this goal, and what needs to hold to enable this action to solve the goal? What needs to hold before the action becomes a subgoal, which either holds initially or becomes a new goal to solve.
If the goal is for the robot to hold coffee, and the robot isn’t already holding coffee, then the action that achieves this is to pick up coffee. This action requires the robot to be in the coffee shop, which becomes a new subgoal.
If the goal, instead, is for the robot to be holding coffee in the office, then the actions to achieve that involve moving to the office from a neighboring location, while holding coffee. This results in the subgoal of being in a neighboring location holding coffee. Picking up coffee cannot achieve the goal of holding coffee in the office, because picking up coffee can only be done in the coffee shop, and so the result of picking up coffee is that the robot is in the coffee shop, not the office.
Regression planning is searching in the graph defined by the following:
The nodes are subgoals, where a subgoal is an assignment to some of the features.
The arcs correspond to actions. In particular, an arc from node to , labeled with action , means
is the last action that is carried out before subgoal is achieved
node is a subgoal that must be true immediately before so that is true immediately after .
The start node is the planning goal to be achieved.
The goal condition for the search, , is true if is true of the initial state.
Given a node that represents subgoal , a neighbor of exists for every action such that:
is possible, it is possible for to be carried out and for to be true immediately after
is useful, achieves part of .
Consider the subgoal . In terms of the STRIPS representation, is useful for solving if, for some , is an effect of action . Immediately before , the preconditions of , as well as any not achieved by , must hold. Thus, the neighbor of subgoal on the arc labeled is the subgoal , as long as is possible. Action is possible if:
for each in , there is no effect of where
does not include two different assignments to any feature.
Suppose the goal is to ensure that Sam does not want coffee, which is . Therefore, the start node is . If this is true in the initial state, the planner stops. If not, it chooses an action that achieves . In this case, there is only one such action: (deliver coffee). The precondition of is . Thus, there is one arc:
Consider the node . There are two actions that can achieve , namely from and from . There is one action that can achieve , namely . However, has as precondition , but and are inconsistent (because they involve different assignments to the variable ). Therefore, is not a possible last action; it is not possible that, immediately after , the condition holds.
Figure 6.3 shows the first three levels of the search space (without cycle pruning or multiple-path pruning). Note that the search space is the same no matter what the initial state is. The starting state has two roles: to serve as a stopping criterion and as a source of heuristics.
If a subgoal contains a number of assignments, regression can often determine which of the assignments to achieve last, as in the following example.
Suppose the goal is for Sam to not want coffee and for the robot to have coffee: . The last action cannot be to achieve , because this achieves . The only last action must be to achieve . Thus, the resulting subgoal is . Again, the last action before this subgoal cannot be to achieve because this has as a precondition , which is inconsistent with . Therefore, the second-to-last action must be a move action to achieve .
In terms of the feature-based representation of actions, an action is useful if there is a causal rule that achieves for some , using action . The neighbor of this node along the arc labeled with action is the proposition
where is the set of assignments of variables in the body of a rule that specifies when is true immediately after . There is no such neighbor if there is no corresponding rule for some , or if the proposition is inconsistent (i.e., assigns different values to a variable). Note that, if multiple rules are applicable for the same action, there will be multiple neighbors.
Search algorithms such as and branch and bound can make use of heuristic knowledge. For a regression planner, the heuristic value of a node is an estimate of the cost to achieve the subgoal represented by the node from the initial state. This form of heuristic as an estimate of the cost of achieving a subgoal from a state is the same as used in a forward planner. So, for example, the heuristic of Example 6.10 could also be used for a regression planner. However, an effective heuristic for a regression planner may not be very useful for a forward planner, and vice versa (see Exercise 6.4).
One problem that arises in regression planning is that a subgoal may not be achievable. Deciding whether a subgoal is achievable is often difficult to infer from the definitions of the actions. For example, consider the restriction that an object cannot be at two different places at the same time; sometimes this is not explicitly represented and is only implicit in the effects of an action, and the fact that the object is only in one position initially. It is possible to have domain knowledge to prune nodes that can be shown to be inconsistent.
Cycle pruning and multiple-path pruning may be incorporated into a regression planner. The regression planner does not have to visit exactly the same node to prune the search. If the subgoal represented by a node is a superset of a subgoal on the path to , node can be pruned. Similarly for multiple-path pruning, see Exercise 6.9.