Formal Definition of Planning
Source slide: B3 Formal Definition of Planning
The previous chapters introduced planning as search through possible futures. This chapter makes that idea precise. We need a formal task description that says what a state is, when an operator may be used, how the operator changes the state, and what it means for a plan to succeed.
The result is a compact mathematical object, but it should be read operationally: it is a recipe for generating a transition system. A planner does not need the whole transition graph written out in advance. It needs a way to test preconditions, apply effects, and recognize goals.
Why Effect Semantics Come First
Section titled “Why Effect Semantics Come First”Operators are the moving parts of a planning task. An operator has a precondition, which says when it is applicable, and an effect, which says what changes if it is applied. The subtle part is the effect: effects may be conditional, combined by conjunction, or even try to set the same variable in conflicting ways.
For that reason, the formal definition starts with the question:
For a particular atomic effect, under which condition does it actually fire?
An atomic effect is either , meaning that variable becomes true, or , meaning that becomes false. More complex effects are built from atomic effects, conjunctions, and conditional effects of the form , read as “if holds, then apply effect .”
Effect Conditions
Section titled “Effect Conditions”Let be an atomic effect and let be an effect. The formula describes exactly the current-state condition under which is triggered by .
The definition is recursive because effects are recursive objects:
Read these clauses from simple to complex. The empty effect never triggers any atomic effect. An atomic effect triggers itself unconditionally. A conjunction triggers if either side triggers it. A conditional effect triggers only if the condition is true and the nested effect would trigger .
For example, suppose an operator contains the effect:
Then is , while is . In a state where is true, both effects fire: the package becomes delivered and becomes false. In a state where is false, only the delete effect for fires, which leaves false.
Applying an Effect to a State
Section titled “Applying an Effect to a State”A state is an interpretation of the finite variable set : every variable is assigned either true or false. Applying an effect to gives a new state .
For every , the resulting value is:
The first line says that an add effect sets to true. The second line says that a delete effect sets to false, but only if no add effect for also fires. The last line is the frame assumption: variables not affected by the effect keep their old value.
The tie-breaking rule is called add-after-delete semantics. If an effect simultaneously tries to add and delete , the add wins. This convention gives every effect a deterministic meaning, even when the syntax contains a conflict.
A common mistake is to treat the effect as if it were applied step by step from left to right. Planning effects are not interpreted that way here. The firing conditions are evaluated in the old state, and the new values are then assembled into the resulting state.
Operators
Section titled “Operators”An operator packages a condition for use with an effect for change. In this chapter, an operator has at least:
- a precondition ,
- an effect ,
- and, when costs are considered, a cost .
The operator is applicable in state exactly when:
If it is applicable, the resulting state is:
This separation is important. The precondition decides whether the action is allowed. The effect decides how the state changes. A condition inside a conditional effect is not an applicability condition for the whole operator; it only decides whether that particular effect part fires.
Planning Tasks
Section titled “Planning Tasks”We can now define the formal input to a classical planner.
Definition: Propositional planning task
A propositional planning task is a tuple
where is a finite set of propositional state variables, is an interpretation of called the initial state, is a finite set of operators over , and is a formula over called the goal.
The tuple is small, but it represents a potentially enormous graph. If , then there are possible truth assignments. The planner usually explores only a fraction of them, but the semantics define all of them.
The Induced Transition System
Section titled “The Induced Transition System”Every planning task induces a transition system:
The components are obtained directly from the planning task:
- is the set of all states over .
- , because operators label transitions.
- .
- .
- is the set of goal states.
- contains exactly the transitions produced by applicable operators:
This is the bridge from compact syntax to search. The task file describes variables and operators; the transition system is the graph that search algorithms conceptually traverse.
A sequence of operators is a plan for when it is a solution path in from to some state in .
Satisficing and Optimal Planning
Section titled “Satisficing and Optimal Planning”There are two standard solution requirements.
Definition: Satisficing planning
Given a planning task , find any plan for , or report that is unsolvable.
Definition: Optimal planning
Given a planning task , find a plan for with minimum cost among all plans, or report that is unsolvable.
Satisficing planning asks for reachability. Optimal planning asks for the cheapest reachable goal path. The same task semantics support both, but algorithms often differ sharply because “some path” and “best path” require different guarantees.
Positive Normal Form
Section titled “Positive Normal Form”Planning algorithms are easier to state when the input has a regular shape. One useful regularization is positive normal form.
First, an effect is simple if it is atomic or has the form , where is atomic. An effect is flat if it is a conjunction of zero or more simple effects and no two simple effects mention the same atomic effect. An operator is flat when its effect is flat.
Definition: Positive normal form
A propositional planning task is in positive normal form when it is positive and all operator effects are flat. Positive means that no negation symbols occur in preconditions, effect conditions, or the goal.
At first this may look like a major restriction. It is mainly a syntactic convenience. A negated condition such as can be represented by introducing a complementary variable . The new variable is initialized to the opposite truth value of , occurrences of in conditions are replaced by , and effects on are mirrored by complementary effects on .
The point is not that the world has no negative facts. The point is that algorithms can often work with a cleaner input language if negative tests have been compiled away into positive variables.
STRIPS
Section titled “STRIPS”STRIPS is an even simpler formalism. It is historically important and still useful because many planning algorithms are easiest to introduce in STRIPS form.
Definition: STRIPS operator
An operator is a STRIPS operator if its precondition is a conjunction of state variables and its effect is a conflict-free conjunction of atomic effects.
Definition: STRIPS planning task
A planning task is a STRIPS task if all operators in are STRIPS operators and is a conjunction of state variables.
A STRIPS operator can be read as three finite sets:
- : atoms that must already be true,
- : atoms made true by the operator,
- : atoms made false by the operator.
For a small example, an operator load-truck might require and , add , and delete . The operator is applicable only in states satisfying both preconditions. After applying it, the package is in the truck and no longer at the depot, while unrelated variables are unchanged.
STRIPS is restricted but not weak in the sense relevant here: the slides use it as a simple common language, and general planning tasks can be compiled into related restricted forms with controlled growth. Later chapters use STRIPS because it keeps the mechanics of progression, regression, and heuristics visible.
What Can Go Wrong
Section titled “What Can Go Wrong”Three confusions are worth catching early.
First, preconditions and conditional-effect conditions play different roles. Preconditions decide whether the whole operator may be applied; conditional-effect conditions decide which parts of the effect fire.
Second, applying an effect is not a sequential program. All firing conditions are evaluated in the original state, and add-after-delete semantics resolves simultaneous add/delete conflicts.
Third, a planning task is not the same object as its transition system. The task is the compact description. The transition system is the explicit graph induced by that description.
Chapter Summary
Section titled “Chapter Summary”A propositional planning task describes variables, an initial state, operators, and a goal. Operator semantics are defined through preconditions and effects; effects are interpreted using recursive effect conditions and add-after-delete tie-breaking. The task induces a transition system whose paths correspond to plans. Satisficing planning asks for any plan, while optimal planning asks for a minimum-cost plan. Positive normal form and STRIPS are restricted syntactic forms that make later algorithms easier to state.
Check Your Understanding
Section titled “Check Your Understanding”- What question does answer?
- Why are effect conditions evaluated in the old state rather than updated one at a time?
- How does a planning task induce a transition system?
- What changes when a problem is solved as optimal planning rather than satisficing planning?
- What information is stored in the precondition, add, and delete sets of a STRIPS operator?