Basic definitions for the STRIPS formalism #
We define some basic definitions of the STRIPS formalism for automated planning. More specifically, this file implements:
- Basic definitions of states, actions, planning tasks, etc.,
- Definition of paths in the search space and various lemmas to work with them,
- Definition of reachability, plans and unsolvability,
- Progression and regression, and various lemmas to work with them.
States and sets of states #
A state is a set of variables, containing all variables that are true.
Equations
- STRIPS.State n = Set (Fin n)
Instances For
Actions and sets of actions #
Equations
- One or more equations did not get rendered due to their size.
Equations
- STRIPS.instToStringAction = { toString := fun (a : STRIPS.Action n) => (Std.format a).pretty }
Applicability and successor states #
An action is applicable in a state if all its preconditions are true in the state.
Equations
- STRIPS.Applicable s a = (↑a.pre ⊆ s)
Instances For
STRIPS planning problems #
A planning problem in the STRIPS formalism. The variables of the planning task are all elements of
Fin n. Note that most fields have two version:
- an primed version which uses a representation that is efficient at run-time, and
- an unprimed version which is more suited for theoretical results
The names of the variables.
The actions of the planning task. See
PlanningTask.actionsfor the version usingActions.- init' : VarSet n
The initial state of the planning task. See
PlanningTask.initfor the version usingState. - goal' : VarSet n
The goal of the planning task, indicating which variables need to be true in a goal state. See also
PlanningTask.GoalStateandPlanningTask.goalStates.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Equations
- STRIPS.PlanningTask.instToString = { toString := fun (pt : STRIPS.PlanningTask n) => (Std.format pt).pretty }
The set of actions of the planning task.
Instances For
The initial state of the planning task.
Instances For
A state is a goal state if it contains all goal variables.
Instances For
The set of all goal states of the given planning task.
Equations
- pt.goalStates = {s : STRIPS.State n | pt.GoalState s}
Instances For
Path #
Given a STRIPS planning task pt, Path s1 s2 is a path form the state s1 to the state s2
in the state space of pt.
- empty
{n : ℕ}
{pt : PlanningTask n}
(s : State n)
: pt.Path s s
The empty path consisting of a single node
s. - cons
{n : ℕ}
{pt : PlanningTask n}
(a : Action n)
{s1 : State n}
(s2 : State n)
{s3 : State n}
(ha : a ∈ pt.actions)
(succ : Successor a s1 s2)
(π : pt.Path s2 s3)
: pt.Path s1 s3
The path consisting of the node
s, and the pathπ, wheres[a]is the first node ofπ.
Instances For
snoc #
In Path.cons, paths are expanded by adding states at the front of the path
(leaving the last state unchanged). Path.snoc allows to extend the path at the back,
leaving the first state unchanged. The name snoc comes from reading cons in reverse order.
Equations
- STRIPS.PlanningTask.Path.snoc a s2 ha (STRIPS.PlanningTask.Path.empty s2) succ = STRIPS.PlanningTask.Path.cons a s3 ha succ (STRIPS.PlanningTask.Path.empty s3)
- STRIPS.PlanningTask.Path.snoc a s2 ha (STRIPS.PlanningTask.Path.cons a' s4 ha' succ' π') succ = STRIPS.PlanningTask.Path.cons a' s4 ha' succ' (STRIPS.PlanningTask.Path.snoc a s2 ha π' succ)
Instances For
The length of a path.
Equations
- (STRIPS.PlanningTask.Path.empty s).length = 0
- (STRIPS.PlanningTask.Path.cons a s2 ha succ π).length = π.length + 1
Instances For
Convert Path.cons, where we have access to the first action and the second state of the path,
to Path.snoc, where we have access to the last action and the second to last state of the path.
Allows to perform cases with Path.empty and Path.snoc instead of Path.empty and Path.cons.
Mem #
A state s is a member of a path π if π traverses through s.
Equations
- STRIPS.PlanningTask.Path.Mem s (STRIPS.PlanningTask.Path.empty s2) = (s = s2)
- STRIPS.PlanningTask.Path.Mem s (STRIPS.PlanningTask.Path.cons a s2_3 ha succ π) = (s = s1 ∨ STRIPS.PlanningTask.Path.Mem s π)
Instances For
Equations
- STRIPS.PlanningTask.Path.instMembershipState = { mem := fun (π : pt.Path s1 s2) (s : STRIPS.State n) => STRIPS.PlanningTask.Path.Mem s π }
append #
Given a path form a s1 to s2 and a path from s2 to s3, we obtain a path from s1 to s3.
Equations
- (STRIPS.PlanningTask.Path.empty s2).append x✝ = x✝
- (STRIPS.PlanningTask.Path.cons a s2' ha succ π').append x✝ = STRIPS.PlanningTask.Path.cons a s2' ha succ (π'.append x✝)
Instances For
Equations
split #
Reachablility, Plans and Unsolvability #
A state is unsolvable if there is no plan for that state.
Equations
- pt.UnsolvableState s = IsEmpty (pt.Plan s)
Instances For
A planning task is unsolvable if the initial state is unsolvable.
Equations
- pt.Unsolvable = pt.UnsolvableState pt.init
Instances For
progression and regression #
The progression of a set of states S by an action a.
Equations
- STRIPS.progression' S a = {s : STRIPS.State n | ∃ (s' : STRIPS.State n), s' ∈ S ∧ STRIPS.Successor a s' s}
Instances For
The progression of a set of states S by a set of actions A.
Equations
- STRIPS.progression S A = {s : STRIPS.State n | ∃ (a : STRIPS.Action n), a ∈ A ∧ s ∈ STRIPS.progression' S a}
Instances For
The regression of a set of states S by an action a.
Equations
- STRIPS.regression' S a = {s : STRIPS.State n | ∃ (s' : STRIPS.State n), s' ∈ S ∧ STRIPS.Successor a s s'}
Instances For
The regression of a set of states S by a set of actions A.
Equations
- STRIPS.regression S A = {s : STRIPS.State n | ∃ (a : STRIPS.Action n), a ∈ A ∧ s ∈ STRIPS.regression' S a}