Third edition of Artificial Intelligence: foundations of computational agents, Cambridge University Press, 2023 is now available (including the full text).

8.1.2 Feature-Based Representation of Actions

A feature-based representation of actions models

  • which actions are possible in a state, in terms of the values of the features of the state, and
  • how the feature values in the next state are affected by the feature values of the current state and the action.

The precondition of an action is a proposition that must be true before the action can be carried out. In terms of constraints, the robot is constrained to only be able to choose an action for which the precondition is true.

Example 8.3: In Example 8.1, the action of Rob to pick up coffee (puc) has precondition cs ∧ ¬rhc. That is, Rob must be at the coffee shop (cs), not carrying coffee ( ¬rhc). As a constraint, this means that puc is not available for any other location or when rhc is true.

The action move clockwise is always possible. Its precondition is true.

The feature-based representation of actions uses rules to specify the value of each variable in the state resulting from an action. The bodies of these rules can include the action carried out and the values of features in the previous state.

The rules have two forms:

  • A causal rule specifies when a feature gets a new value.
  • A frame rule specifies when a feature keeps its value.

It is useful to think of these as two separate cases: what makes the feature change its value, and what makes it keep its value.

Example 8.4: In Example 8.1, Rob's location depends on its previous location and where it moved. Let RLoc' be the variable that specifies the location in the resulting state. The following rules specify the conditions under which Rob is at the coffee shop:
RLoc'=cs ←RLoc=off ∧Act=mcc.
RLoc'=cs ←RLoc=mr ∧Act=mc.
RLoc'=cs ←RLoc=cs ∧Act≠mcc ∧Act≠mc.

The first two rules are causal rules and the last rule is a frame rule.

Whether the robot has coffee in the resulting state depends on whether it has coffee in the previous state and its action:

rhc' ←rhc ∧Act ≠dc.
rhc' ←Act=puc.

The first of these is a frame rule that specifies that the robot having coffee persists unless the robot delivers the coffee. The rule implicitly implies that the robot cannot drop the coffee or lose it, or it cannot be stolen. The second is the causal rule specifying that picking up the coffee causes the robot to have coffee in the next time step.

Causal rules and frame rules do not specify when an action is possible. What is possible is defined by the precondition of the actions.