New Complexity Results for Structurally Restricted Numeric Planning
Abstract
Numeric planning is known to be undecidable even under severe restrictions.
Prior work investigated the decidability boundaries by restricting the expressiveness of the planning formalism in terms of the numeric functions allowed in conditions and effects.
In this work, we ﬁx one speciﬁc such for- malism, simple numeric planning ( SNP ), which, while only allowing linear conditions and action effects to add constants, is still undecidable.
We analyse the complexity of SNP by (1) restricting the number of numeric variables, and (2) restrict- ing the causal structure.
First, we concentrate on numeric planning with exactly one (numeric) variable.
We present a pseudo-polynomial algorithm to solve such tasks, and show
NP -hardness and PSPACE -membership for the correspond- ing decision problem.
Second, we restrict the interaction between variables in terms of the causal graph.
As our main result, we show that SNP with an arbitrary number of numeric causal-graph leaf variables is decidable, and lies in PSPACE if the propositional state space has ﬁxed size.
Introduction
In recent years, signiﬁcant progress has been made towards the development of methods that solve planning tasks with numeric variables (Hoffmann 2002; Shin and Davis 2005;
Gerevini, Saetti and Serina 2008; Eyerich, Mattm ¨ uller, and
R ¨ oger 2009; Coles et al.
2013; Scala et al.
Illanes and
McIlraith 2017; Li et al. 2018; Scala, Haslum, and Thi ´ ebaux 2016; Scala et al. 2017; Aldinger and Nebel 2017; Piacentini et al. 2018a,b; Kuroiwa et al. 2021).
From a theoretical perspective, the success of these methods raises a conundrum, since even the most simple forms of numeric planning are known to be undecidable (Helmert 2002).
Undecidability has been proven using planning instances with an arbitrary number of numeric variables and arbitrary causal dependencies between variables.
What happens if we bound the number of numeric variables by a constant?
What inﬂuence do causal dependencies have?
We consider this a very interesting setting and make a step towards a better understanding of restricted sub-classes of numeric planning in this work.
We focus on the simple numeric planning ( SNP ) formalism (Hoffmann 2003; Scala et al. 2016).
While it only allows linear expressions in the goal and action conditions, and action effects to add constants, it is still undecidable.
Our starting point is a simple numeric task ( SNT ) with a single numeric variable x , which provides a platform to analyze more interesting structures.
We remark that even this simple problem is non-trivial, namely NP -hard (Thm. 4).
The basis of our investigation is a normal form, similar to the domain simpliﬁcation of Helmert (2002), which abstracts from irrelevant details.
Our main tool for proving complexity results is Thm. 1, which concerns the structure of the state space of one-variable numeric tasks: for every solvable task Π x one can compute a bounded interval I such that there exists a plan π that stays inside I during execution.
To solve Π x , it is thus sufﬁcient to explore a ﬁnite part of the underlying inﬁnite state space, which makes the planning problem decidable.
Moreover, we prove a pseudo-polynomiality result that can be used for isolating polynomial-time solvable fragments, which is possible even for optimal planning.
We prove PSPACE -membership of the corresponding planning problem, showing that, computationally, it is no harder than the classical planning problem.
In addition, we show that it is
NP -hard even for tasks where actions have no preconditions, in contrast to classical planning, where empty preconditions imply polynomial-time solvability.
on Thm.1, we look into a restricted form of SNT with a propositional variable v and a numeric variable x such that x depends on v , but not vice versa.
As we can enumerate all simple paths traversing the domain of v , we can compute a bounded interval I of x for each of them, which implies a ﬁnite overall state space.
We generalize this by showing that SNP with an arbitrary number of numeric leaf variables is decidable, and lies in PSPACE if the state space induced by the propositional variables has a ﬁxed size.
The already mentioned work by Helmert (2002) lays important foundations for our analysis.
We discuss the connections in a dedicated related work section.
We conclude the paper by discussing our ﬁndings and indicating directions for future research.
In particular, we believe that our results can be utilized by techniques known from classical planning that require bounded domain sizes, such as abstraction heuristics based on projections onto a subset of variables (Culberson and Schaeffer 1998; Edelkamp 2001), or decoupled search, which decomposes planning tasks and requires bounded state spaces for the leaf components (Gnad and Hoffmann 2018).
Numeric Planning
We consider simple numeric planning ( SNP ) as introduced by Hoffmann (2003) and reﬁned by Scala et al.
SNP was originally deﬁned in the S TRIPS formalism (Fikes and
Nilsson 1971)
but we present it (in a more general way) as an extension of the ﬁnite-domain planning (FDR) formalism (B¨ackstr¨om and Nebel 1995; Helmert 2009).
A simple numeric task ( SNT ) is a 4-tuple Π
=
(cid:104)V , A , s 0 , G (cid:105) , where V = V n ∪ V p is a ﬁnite sets of numeric and propositional variables , A is the set of actions , s 0 is the initial state , and G is the set of goal conditions .
Numeric variables V n have domain Q ; each propositional variable v ∈ V p has a ﬁnite domain D ( v ) .
The set of states of Π is S :
=
Ś v ∈V p D ( v ) ×
Ś v ∈V n Q , i.e., a state is a full assignment over all variables V .
We refer to a state s ∈ S as a set of numeric and propositional facts s = s p ∪ s n , where s p = {∀ v ∈ V p ∃ !
d ∈ D ( v ) : (cid:104) v, d (cid:105)} , and similarly s n = {∀ v ∈ V n ∃ !
q ∈ Q : (cid:104) v, q (cid:105)} .
We say that s | =
( v = f ) iff (cid:104) v, f (cid:105) ∈ s , and write s [ v ] = f , i.e., s [ v ] indicates the value of v ∈ V in state s .
We say that s (cid:48) is a partial state if there is a state s ∈ S such that s (cid:48)
⊂ s .
Conditions can be either propositional or numeric.
Propositional conditions are partial propositional states, i.e., ψ is a propositional condition if there is s ∈ S
such that ψ ⊆
s p .
A linear numeric condition over the numeric variables
V ⊆ V n is written as ψ : (cid:80) v ∈ V w v v (cid:68) w 0 where (cid:68) ∈ {≥ , > } , w v , w 0 ∈ Q .
It is satisﬁed by s , denoted s | = ψ , if (cid:80) v ∈ V w v s [ v ] (cid:68) w 0 .
We extend this to sets of conditions Ψ by s | =
Ψ .
An action a ∈ A is a tuple (cid:104) pre ( a ) , eﬀ ( a ) (cid:105) , where pre ( a ) are the preconditions , and eﬀ ( a ) the effects of a .
Preconditions are deﬁned as pre ( a ) :
= pre p ( a ) ∪ pre n ( a ) , with propositional and linear numeric conditions, respectively.
Effects eﬀ ( a ) :
= eﬀ p ( a ) ∪ eﬀ n ( a ) are similarly deﬁned as sets of propositional and numeric effects.
For SNT , numeric effects have the form ( v += c ) , where v ∈ V n and c ∈ Q \ { 0 } .
Actions have at most one effect on each numeric variable.
We say that action a is applicable in state s if s | = pre ( a ) .
The result of applying a in s is denoted by s (cid:74) a (cid:75) :
= s (cid:48)
p ∪ s (cid:48) n , with s (cid:48) p [ v ]
=
d if (cid:104) v, d (cid:105) ∈
eﬀ p ( a ) , s (cid:48) n [ v ] = s n [ v ] + c if ( v += c ) ∈ eﬀ n ( a ) , and s (cid:48) n [ v ] = s n [ v ] otherwise.
The goal condition G = G p ∪ G n denotes propositional and numeric conditions, respectively.
We say that s ∗ is a goal state if s ∗ | =
G .
An s -plan is an action sequence π that can be applied successively in s and results in a goal state s ∗ | =
G .
A plan for Π is an s 0 -plan.
The set of all numeric conditions appearing in Π is denoted by Ψ(Π) ; by Ψ( v, Π) we denote all numeric conditions where the variable v ∈ V n appears.
If Π is obvious from the context, we simply write Ψ( v ) .
(cid:107) Π (cid:107) is the number of bits needed for representing Π .
A restricted task ( RT ) is a variant of SNT where all numeric conditions are of the form: ψ : v (cid:46)(cid:47) w 0 , with w 0 ∈ Q , v ∈ V n , and (cid:46)(cid:47) ∈ { >, ≥ , <, ≤} .
Similar to SNT , actions can only increase or decrease variables by constant quantities (Hoffmann 2003; Scala, Haslum, and Thi´ebaux 2016).
An
SNT can be reduced to an RT with a simple translation.
Translating SNT to RT .
Given a SNT Π = (cid:104)V , A , s 0 , G (cid:105) , we deﬁne a transformed task Π RT =
(cid:104)V RT , A RT , s RT 0 , G RT (cid:105) constructed as follows.
For every numeric condition ψ : (cid:80) v ∈ V w v v (cid:68) w 0 in Ψ(Π) , we introduce a new numeric variable v ψ ∈ V RT n , with s
[ v ψ ] = (cid:80) v ∈ V w v s
[ v ] .
Each ψ is then replaced by v ψ (cid:46)(cid:47) w 0 and, for every action a with an effect v += c av on a v ∈ V , a numeric effect on v ψ must be added, with the form v ψ += (cid:80) v ∈ V c av .
This translation is polynomial in the number of numeric conditions.
In what follows, unless stated otherwise, we assume all tasks to be in RT form.
Integer Restricted Tasks
In this section we present integer RT tasks, a normal form which simpliﬁes the forthcoming proofs.
The transformation is very similar to the “domain simpliﬁcation” of Helmert (2002), but additionally normalises initial state values toand conditions to be integer for all numeric variables.
We redeﬁne the transformation here in our terms, since we heavily rely on it for our results.
We also prove the correspondence to the original task formally, which was not done in detail by
Helmert (2002).
Suppose we have an RT Π
= (cid:104)V , A , s 0 , G (cid:105) .
In this task, any condition can be seen as a check whether x ∈ V n belongs to a given rational interval (which is not necessarily bounded).
We let (cid:74) l − , l + (cid:75) denote any closed, open, or half- open interval, where l − ∈ {−∞} ∪ Q , l + ∈ Q ∪ { + ∞} , and l − ≤ l + .
The precondition of each action a has the form pre ( a ) = { x ∈ (cid:74) l − , l + (cid:75) | x ∈ V n } .
Note that (1) x ∈ (cid:74) l − , l + (cid:75) is a semantic notation meaning s | = x ∈ (cid:74) l − , l + (cid:75)
iff s [ x ] ∈ (cid:74) l − , l + (cid:75) , and (2) we deﬁne conditions on all numeric variables replacing empty conditions with x ∈ ( −∞ , ∞ ) .
The numeric goal conditions G n have the same form.
By
W ( x ) we denote the set of numbers that appear in the numeric conditions on x , W ( x ) :
= { l − , l + | ( x ∈ (cid:74) l − , l + (cid:75) )
∈ Ψ( x ) } .
Note that W ( x ) is a ﬁnite set of rationals.
Each action a has numeric effects of the form x += c with c (cid:54) = 0 .
We let C ( x ) :
= { c | x += c ∈ eﬀ n ( a ) , a ∈ A} ⊆ Q denote the set of additive constants affecting x .
We say that an RT ¯Π is integer if for each x ∈ V n the conditions P1–P3 hold.
P
[Equation] x ) ∪ W ( x ) ⊆
Z , P2.
s
[ x ] = 0 , and P3.
if ( x ∈ (cid:74) l − , l + (cid:75) ) ∈ G n , then (cid:74) l − , l + (cid:75) ∩ Z ⊆ N .
We will show that every restricted task Π has a corresponding integer instance ¯Π that is solvable iff Π is.
Furthermore, ¯Π can be computed in polynomial time.
We start by showing that restricted numeric tasks are well-behaved under linear transformations.
Assume C ∈ Q \{ 0 } and B ∈ Q .
We deﬁne the map ( C · x + B )(Π) on Π and an x ∈ V n as follows: each condition of the form x ∈ (cid:74) a, b (cid:75) in Π is replaced with x ∈ (cid:74) C · a + B, C · b + B (cid:75) , and the effect x += c is replaced with x += C · c .
The initial state s
[ x ] = x 0 is replaced with s
[ x ] = C · x 0 + B .
Lemma 1.
Any plan for Π is also a plan for ( C · x + B )(Π) , where C ∈ Q \ { 0 } and B ∈ Q , and
vice-versa.
Proof.
Let π = (cid:104) a 1 , . .
. , a n (cid:105) be a plan for Π .
By s k we denote the state that corresponds to the subsequent application of the ﬁrst k actions of π , starting at the state s 0 .
Suppose that x += c k is the effect of action a k on x .
Here we allow c k = 0 , so that each action has an effect on x .
Thus, s k [ x ] = s
[ x ] + (cid:80) ki =1 c i .
Since each a k is applicable in s k − 1 , it holds that s k − 1 [ x ] = s
[ x ] + (cid:80) [Equation] (cid:74) a [Equation]
, b [Equation] (cid:75) , where ( x ∈ (cid:74) a k , b k (cid:75) )
∈ pre ( a k ) , and s n [ x ] ∈ (cid:74) a g , b g (cid:75) , where ( x ∈ (cid:74) a g , b g (cid:75) )
∈ G n .
We need to show that π is also a plan for ( C · x + B )(Π) .
The proof is by induction, suppose that the actions were applied up to some k − 1 .
Let s (cid:48)
k be the resulting state, then
[Equation]
The claim s (cid:48) n | = G is proved exactly in the same fashion.
Note that all other conditions and affects were left unchanged, and the map affects only the variable x , thus π is also a plan for ( C · x + B )(Π) .
To prove that any plan for ( C · x + B )(Π) is a plan for Π , all we need is to recall that if C (cid:54) = 0 , then the linear transformation is invertible, i.e., ( C · x + B )(Π) is transformed into Π using the linear transformation x (cid:55)→ 1 C x − BC .
We ﬁnish by applying the previous claim to this linear function.
Let LCD ( X ) denote the least common denominator of a ﬁnite set X of rational numbers, i.e., LCD ( X ) is the smallest number such that LCD ( X ) · x is an integer for every x ∈ X .
Corollary 1.
For each RT Π , there exists an integer RT ¯Π such that ¯Π is solvable if and only if Π is solvable.
Proof.
Consider the instance Π x = ( C · x + B )(Π) .
If
C = LCD ( C ( x ) ∪ W ( x )) , then P1 holds for x in Π x , and choosing B = − C · s 0 [ x ] guarantees P2.
We need to see to that the goal condition is positive.
Let x ∈ (cid:74) l − , l + (cid:75) be the goal condition of Π x .
If s 0 [ x ] ∈ (cid:74) l − , l + (cid:75) the task is trivial, thus replace the goal condition with x = s 0 [ x ] .
Otherwise, either s
[ x ] ≤ l − or s 0 [ x ] ≥ l + .
In the second case we multiply C and B by − 1 , and we do nothing in the ﬁrst case.
We ﬁnalize that claim by repeating this process for each x ∈ V n .
This is can be done, since each map affects x independently of all other numeric variables.
Using Col. 1 we estimate the size of the integer RT we got.
Finding the least common multiple of a ﬁnite set N ⊆ N can be done in log 2 max N steps, i.e., it is linear in the number of bits representing N .
Thus, we can compute the least common denominator of a set of rational numbers in linear time which leads to the following result.
Lemma 2.
Let Π be an RT .
Then, an integer RT ¯Π can be computed in polynomial time, (cid:107) ¯Π (cid:107) ∈
O ( n 2 ) , and the size of each number in ¯Π is at most n bits.
Proof.
If (cid:107) Π (cid:107) = n , then no number in Π uses more than n bits.
The task ¯Π can be computed in polynomial time since, by Cor. 1, the needed arithmetic operations can be performed in polynomial time.
If two m -bit numbers are multiplied, then the result can be written down using at most 2 m bits so each number in ¯Π has at most n bits since the sum of their bits does not exceed n .
Moreover, ¯Π may contain at most n numbers, since each number needs at least one bit so (cid:107) ¯Π
(cid:107) =
O ( n 2 ) .
In addition, we would like to show that in some speciﬁc tasks we can bound the numeric goal conditions to a closed interval.
This will be helpful later on.
Lemma 3.
Let Π be an integer RT , where ( x ≥ g ) ∈ G n , and each action that affects the numeric variable x ∈ V n affects no other variables.
Then, there is a g (cid:48) ≥ g such that each plan that solves Π contains a sub-sequence of actions that solves Π (cid:48) .
Proof.
Let C + = max c ∈C ( x ) c .
Let π be a plan for Π , and let s ∗ | =
G be the state where π terminates.
Let g (cid:48)
=
g + C + .
If s ∗ [ x ] ∈ [ g, g (cid:48) ] we are done, otherwise, assume s ∗ [ x ] ≥ g (cid:48) .
Since we start at s 0 [ x ] = 0 and each action adds to x at most
C + there is at least one state alongside the execution of π that lies inside [ g, g + C + ] .
Thus, π has a preﬁx that achieves x ∈ [ g, g (cid:48) ] .
Since all actions that affect x do not affect any other variable, we can ignore all actions that affect x after the ﬁrst one that achieves the goal condition on x .
If the conditions of Lemma 3 hold for x ∈ V n , we replace the goal condition x ≥ g with x ∈ [ g, g + C + ] .
In what follows, we consider integer RT s with bounded numeric goal intervals.
We start with the most basic case of a single numeric variable.
Single Numeric Variable
Suppose we have a planning task with a Single Numeric
Variable (SVNT), Π x = (cid:104)V , A , s 0 , G (cid:105) , where V = V n = { x } .
In this section we analyse the computational complexity of the plan existence problem for SVNTs.
We denote this problem by PESVNT.
We ﬁrst prove that PESVNT always can be solved by search in a ﬁnite subset of the state space; this is not clear a priori from the problem formulation.
This is the basis for our forthcoming complexity results.
Finite Search Space
Since a SVNT has exactly one numeric variable, it is an RT by deﬁnition.
By Cor. 1 and Lem.
3 we have that Π x can be transformed into an integer RT with a bounded goal condition, and by Lem.
2 it can be done in polynomial time.
We aim to show that every solvable task Π x has the following property: one can compute a bounded interval I from Π x and if there exists a plan π for Π x , then there exists a reordering of π such that x stays inside I during its execution.
In other words, one only needs to consider a ﬁnite part of the inﬁnite state space, hence PESVNT is a decidable problem.
Lemma 4.
Let C ⊆
Z be a ﬁnite set of integers, and let
C max = max c ∈C | c | .
Let a, b ∈
Z be such that | a − b | ≤ 2 C max , and let { c i } ni =1 be a sequence of numbers such that ∀ i ∈
[ n ] : c i ∈ C and a + n (cid:88)
i =
c i =
b.
Then, for each y ∈ R such that a, b ∈
[ y, y + 2 C max ] there is a permutation σ : [ n ] → [ n ] such that for each k ∈ [ n ] it holds that a + (cid:80) ki =1 c σ ( i ) ∈
[ y, y + 2 C max ] .
Proof.
The proof is by induction.
Suppose that for k − 1 it holds that a k − 1 := a + (cid:80) k − 1 i =1 c σ ( i ) ∈
[ y, y + 2 C max ] .
For the element of the index σ ( k ) we need to chose one of the indices from the set [ n ] \ σ ([ k − 1]) .
We have three cases:
Case 1.
There is i ∈ [ n ] \ σ ([ k − 1]) such that c
i = 0 .
Then, set σ ( k ) :
= i , and a k − 1 = a k .
Case 2.
All elements with indices in [ n ] \ σ ([ k − 1]) are of the same sign.
In this case, for each i ∈ [ n ] \ σ ([ k − 1]) the sum a k − 1 + c
i lies on the interval between a k − 1 and b , which is contained in [ y, y + 2 C max ] , since a k − 1 belongs to this interval by induction, and b by deﬁnition.
Thus, we can set σ ( k ) :
= i for any i ∈ [ n ] \ σ ([ k − 1]) .
Case 3.
There are two indices i, j ∈ [ n ] \ σ ([ k − 1]) } such that c
i and c j are of different sign.
By deﬁnition, it holds that | c i | , | c j | ≤ C max .
Note that since a k − 1 ∈ [ y, y + 2 C max ] , it either holds that a k − 1 − y ≤ C max or that y + 2 C max − a k − 1 ≤ C max , i.e., the distance from a k − 1 to one of the endpoints of the interval exceeds C max .
Thus, either a k − 1 + c i or a k − 1 + c j lies in the interval [ y, y + 2 C max ] .
Without loss of generality, assume that a k − 1 + c j ∈ [ y, y + 2 C max ] .
Then, we set σ ( k ) :
= j , and repeat the process.
Given an SVNT Π x and a bounded interval I , we let Π Ix denote Π x where each precondition pre ( a ) = { x ∈ (cid:74) l − , l + (cid:75) } of each action a ∈ A is replaced with the pre- condition pre ( a ) = { x ∈ (cid:74) l − , l + (cid:75) ∩ I } .
Theorem 1.
Let Π x be an SVNT.
Then there exists a bounded interval I =
[ M − − 2 C max , M + + 2 C max ] such that each plan π for Π x can be reordered into a plan π (cid:48) for Π Ix .
The constants are C max = max c ∈C ( x ) | c | , M − =
min( W ( x ) ∪ { 0 } ) − 1 , and M + = max( W ( x ) ∪ { 0 } )
+ 1 .
Proof.
Let π be a plan for Π x , and (cid:104) s 0 , . . .
, s n (cid:105) be the sequence of states traversed by π .
Intuitively, we would like to reorder not the whole plan π , but only the parts of the plan that exceed M + from above and M − from below.
Let us look at the following state \ action sequence s 0 , a 1 , s 1 , a 2 , . . .
s k 1 , a k 1 +1 , s k 1 +1 , . . . , a k 2 , s k 2 +1 , . .
. , a k 3 , . .
, a k 4 , . . . , a k 5 , . . . , a k 6 , . . .
, s n | = G.
We say that an action exceeds M + if both the start and the end state of this action exceed M + from above.
The deﬁnition for exceeding M − is the same, but the states should exceed M − from below.
Suppose that the red sub-sequences in the plan are the ones that exceed M + and the blue ones exceed M − .
Note that, since M − < M + , between each red and blue sub-sequence, there must be at least one black action.
The ﬁrst and the last actions in the sequence are also black, since, by deﬁnition, both s
[ x ] = 0 and the interval [ g 1 , g 2 ] lie inside the interval [ M − , M + ] ,
where G = { x ∈ [ g 1 , g 2 ] } .
Let I =
[ L − , L + ] .
First, we obtain the L − bound.
Let
A −∞ := { a ∈ A | ∀ s [ x ] ≤ M − : s | = pre ( a ) } .
So A −∞ is the set of all actions that have as precondition either x ∈ Q (no preconditions) or x ≤ b for some b ∈ Q , i.e., the actions that can be applied with an arbitrarily small x .
If no state in (cid:104) s 0 , . .
, s n (cid:105) achieves a value below M − , there is no need for reordering.
Otherwise, let s k 1 be the ﬁrst state below M − , and let π k 1 → k 2 :
= { a k 1 + i } k 2 − k 1 i
= be the longest sub-sequence of π that starts in s k 1 such that all actions in π k 1 → k 2 exceed M − .
Let s k 2 be the last state along the application of π k 1 → k 2 .
Note that it may hap- pen that s k
=
s k 2 , in this case π k 1 → k 2 = ∅ .
By deﬁni- tion, s k 1 (cid:54) =
s 0 and s k 2 (cid:54)| = G .
Since each action cannot increase or decrease the value of x by more than C max , it holds that s k 1 [ x ] , s k 2 [ x ] ∈
[ M − − C max , M − ] .
Thus, | s k 1 [ x ] − s k 2 [ x ] | ≤ C max .
Moreover, since π k 1 → k 2 is a sequence of action applications:
[Equation]
where c j is the effect of applying the action a j in the state s j − 1 .
By construction, all actions in π k 1 → k 2 belong to A −∞ , and thus can be applied within the interval ( −∞ , M − ] .
By
Lem.
4, there exists a permutation σ of indices of π k 1 → ksuch that
[Equation]
Set L − := M − − 2 C max .
We remark that there is a ﬁnite number of such disjoint preﬁxes, and each preﬁx can be reordered in such a way that for each state s along the reordered plan, it holds that s [ x ] ≥ L − .
The reordering that bounds the value of x along π from above is obtained in the same way, taking the upper bound
L + := M + + 2 C max instead.
Complexity Results
Armed with Thm.
1, we are ready to prove concrete complexity results.
We begin with a pseudopolynomiality result.
Theorem 2.
The problem PESVNT can be solved in pseudopolynomial-time O ( |A| ( C max + W max )) , where
C max and W max are the maximums over the absolute values of the sets C ( x ) and W ( x ) , respectively.
Proof.
Let Π x be an instance of PESVNT.
Let ¯Π x be the normalised version of Π x via Lem.
By Thm. 1, we can construct a bounded-interval SVNT ¯ Π I x such that for each plan for ¯Π x there is a plan for ¯Π Ix .
By construction of the interval I we have that | I ∩ Z | ≤ 4 C max +2 W max .
Note that x in the task ¯Π
Ix can take only integer values since s 0 [ x ] =and all additive constants are integers.
Thus, to ﬁnd a plan for ¯Π
Ix we can use dynamic programming, breaking down the problem into sub-problems of ﬁnding the shortest path from x = 0 to any of the integers in the interval I .
Hence, the complexity is O ( |A| ( C max + W max )) .
If X is a set of SVNTs with bounded C max and W max , then the corresponding planning problem can be solved in polynomial time by Thm. 2.
We additionally note that the dynamic programming approach can be used for ﬁnding an optimal plan; recall that the plan obtained by Thm.
1 has at most the length (and cost) as the original plan.
We continue by proving that if the parameters are not bounded, then the problem becomes NP -hard.
We also present a positive result:
PESVNT is in PSPACE so it is not computationally harder than the FDR planning problem.
To prove membership in PSPACE we need the following famous result by Savitch (1970).
We remind that
NSPACE ( f ( n )) is the class of all decision problems that can be solved by nondeterministic algorithms using space
O ( f ( n )) , while DSPACE ( f ( n )) is deﬁned the same but for deterministic algorithms.
Theorem 3.
Suppose that f ( n ) can be computed in
O ( f ( n )) time.
Then, NSPACE ( f ( n )) ⊆
DSPACE ( f ( n ) 2 ) .
We use this theorem to prove the following result.
Theorem 4.
The problem PESVNT is in PSPACE , and it is NP -hard even if all preconditions are empty.
Proof.
Membership in PSPACE : Let Π x be an SVNT with (cid:107) Π x (cid:107) = n .
By Lem.
2, (cid:107) ¯Π x (cid:107) ∈
O ( n 2 ) and C max , W max use at most 2 n bits.
By Thm.
1 there is an interval I =
[ − W max − 2 C max , W max +2 C max ] such that ¯ Π x is solvable iff ¯Π Ix is.
By the proof of Thm. 2, the size of the search space of ¯Π
Ix is bounded by the size of the interval I , i.e., 4 C max + 2 W max , which is, in turn, at most 4 · 2 2 n + 2 · 2 2 n ≤ 2 2 n +3 .
Thus, any solution of length 2 2 n +3 or larger has cycles.
Such cycles can be removed, resulting in a solution of length less than 2 2 n +3 .
We can guess a plan one action at a time and verify it step by step using only polynomial space.
No more than 2 2 n +3 non-deterministic choices are required so this non-deterministic algorithm uses only polynomial space.
By Savitch’s theorem (1970), it holds that
NPSPACE =
PSPACE so PESVNT is in PSPACE .
NP - hardness.
The basis for our proof is the feasibility version of the change-making problem (F EAS -CMP) (Martello and Toth 1990, Sec. 5).
An instance is an n -vector ( c 1 , . . .
, c n ) of non-negative integers and a non-negative integer b .
The question is if there are non-negative integers x 1 , . . .
, x n such that (cid:80) ni =1 c i · x i = b ?
The NP -hardness of this problem was originally proved by Lueker (1975).
We present a polynomial-time reduction from F EASCMP to PESVNT.
Let (¯ c, b ) denote an arbitrary instance of this problem with ¯ c = ( c 1 , . .
. , c n ) .
We construct a planning task Π x as follows: introduce a variable x and actions a i , i ∈ [ n ] , with empty preconditions and effects x
+= c i .
The initial state is x =
and the goal state is x = b .
The task Π x can be constructed in polynomial time and (¯ c, b ) has a solution iff Π x is solvable.
We note that FDR planning is strongly NP-hard even in severely restricted cases (see Figure 3 in (B¨ackstr¨om and
Nebel 1995)).
Thus, pseudopolynomial algorithms for FDR are ruled out under standard assumptions.
This is a quite noticeable difference between FDR planning and PESVNT (that are closely related by both being in PSPACE ).
Numeric Causal-Graph Leaf Variables
Planning tasks are typically structurally complex, and causal graphs are a common means to study this structure (e.g.,
Knoblock 1994; Bacchus and Yang 1994; Domshlak and
Brafman 2002).
In this paper we use the compact deﬁnition by Helmert (2004): the causal graph (CG) of a classical planning task Π
= (cid:104)V , A , I, G (cid:105) is a digraph CG (Π) =
(cid:104)V , E(cid:105) , where ( u, v ) ∈
E if u (cid:54) = v
and there exists a ∈ A , s.t. u ∈ vars ( pre ( a )) ∪ vars ( eﬀ ( a )) and v ∈ vars ( eﬀ ( a )) , where vars ( s ) denotes the set of variables deﬁned in the (partial) state s .
Intuitively, the CG contains an edge from a variable v to a variable v (cid:48) , if changing the value of v (cid:48) might require v to change its value, too, so v (cid:48) depends on v .
For general numeric planning, it is not immediately clear how to adopt this deﬁnition.
We start with the more obvious case of an RT .
As every precondition and effect of an action a ∈ A of an RT touches at most one numeric variable, the inﬂuence of a on the CG of the task is the same as one of an action with propositional effects.
Thus, we can treat numeric variables exactly as propositional ones for CG construction.
The case of linear conditions ψ : (cid:80) x ∈
V w x s [ x ] (cid:68) w 0 ∈ pre n ( a ) in SNT is somewhat more intricate.
If numeric variables x 1 and x 2 both appear in V , they are co-dependent in terms of ψ .
Note that the case x 1 + x 2 ≥ w 0 differs from the case when x 1 ≥ w 1 and x 2 ≥ w 2 .
This co-dependency is also shown by the fact that the translation to RT , which introduces a new variable v ψ , introduces cycles in the causal graph between x 1 , x 2 , and v ψ .
How to deﬁne a CG in this cases remains an open question.
In this work we consider only the case of RT .
Moreover, we concentrate on numeric variables that are leaves in the causal graph, i. e., they might depend on other variables via action preconditions, but no other variable depends on their value and there are no co-effects.
We call numeric variables that are leaves in the causal graph numeric leaves .
In what follows, all numeric variables are numeric leaves.
We further say that a CG has a fork structure , or simply is a fork , if there exists a variable v such that all edges in the causal graph are of the form v → x , and there is an edge for each x ∈
V n .
The notion of forks was introduce in classical planning by Katz and Domshlak (2008).
To our best knowledge this work is the ﬁrst work that uses causal graphs in the setting of numeric planning.
Forks have a Finite Search Space
We start with a claim that constitutes a basic building block to the complexity results below, when there exists only a single numeric leaf variable that depends on a single propositional variable.
Lemma 5.
Let Π v,x be an RT with two variables
V
= { v, x } , where v ∈ V p is a propositional variable, and x ∈ V n is a numeric variable.
Assume further that the causal graph of the task has exactly one edge ( v, x ) .
Then, the plan existence problem for Π v,x is decidable.
Proof.
We assume that Π v,x is an integer task with bounded numeric goal condition, since by Cor.
1, Lem. 2, and Lem.
Π v,x can be transformed to this form in quadratic time.
We start with the observation that each action a can not affect both v and x due to the CG structure of the task.
Hence, if an action affects the propositional variable v it has the form pre ( a ) = {(cid:104) v, u (cid:105)} and eﬀ ( a ) = {(cid:104) v, u (cid:48) (cid:105)} , where u, u (cid:48)
∈ D ( v ) .
Thus, all actions affecting v are inner actions .
We can view the values of v as a directed graph where the nodes are values of v , and each action with precondition pre ( a ) = {(cid:104) v, u (cid:105)} and effect eﬀ ( a )
= {(cid:104) v, u (cid:48)
(cid:105)} corresponds to a directed edge ( u, u (cid:48) ) .
We denote the k ∈ N strongly connected components (SCC) of this graph by {C j } kj =1 .
Recall, that the SCCs of a graph induce a DAG.
For each fact (cid:104) v, u (cid:105) that belongs to an SCC C j we write u ∈ C j .
We denote the constants C max x
[Equation]
[Equation]
min( W ( x ) ∪ { 0 } ) − 1 , and M + = max( W ( x ) ∪ { 0 } ) + 1 .
Our goal for the proof is to compute an interval [ L x − , L x + ] s.t. for each plan π there exist a plan π (cid:48) where for all states s traversed by π (cid:48)
it holds that s [ x ] ∈
[ L x − , L x + ] .
Intuitively, we would like to reconstruct not the whole, but only the parts of the plan, where the value of x exceeds M + from above or
M − from below.
Let π be a plan for Π v,x , and (cid:104) s 0 , . . .
, s n (cid:105) be the sequence of states traversed by π .
Consider the following state/action sequence: s 0 , a 1 , s 1 , a 2 , . . .
s k 1 , a k 1 +1 , s k 1 +1 , . .
. , a k 2 , s k 2 +1 , . . . , a k 3 , . . , a k 4 , . . . , a k 5 , . . . , a k 6 , . . . , s n | = G.
We say that an action exceeds M + if both in the start and the end state of this action the value of x exceeds M + from above.
The deﬁnition for exceeding M − is the same, but the states should exceed M − from below.
If no state in (cid:104) s 0 , . .
, s n (cid:105) achieves a value below M − , there is no need for reconstruction.
Otherwise, let s k 1 be the ﬁrst state below M − , and let π k 1 → k 2 :
= { a k 1 + i } k 2 − k 1 i
= be the longest sub-sequence of π that starts in s k 1 such that all actions in π k 1 → k 2 exceed M − .
Let s k 2 be the last state along the application of π k 1 → k 2 .
Note that it may happen that s k
= s k 2 , in this case we set π k 1 → k 2 = ∅ .
Otherwise, by deﬁnition, s k 1 (cid:54) =
s 0 and s k 2 (cid:54)| = G .
By construction of the sub-sequence it holds that s k 1 − 1 [ x ] , s k 2 +1 [ x ] < M − , thus s k 1 [ x ] , s k 2 [ x ] ∈
[ M − − C max x , M − ] .
Deﬁne a :=
s k 1 [ x ] and b :=
s k 2 [ x ] .
The actions in π k 1 → k 2 traverse the values of v in some order over its SCCs, assume this order to be (cid:126) C : C 1 → C 2 → · · · → C m .
We next show how to compute a bound M (cid:126) C ,a,b − for all possible value pairs a, b ∈ [ M − − C max x , M − ] ∩ N and all possible
SCC-chains (cid:126) C .
Thus, for each sub-sequence π k 1 → k 2 of the plan π that exceeds M − from below there will be a bound
L x − = min (cid:126) C ; a,b ∈ [ M − − C max x ,M − ] M (cid:126) C ,a,b − that bounds a reconstructed plan from below.
We can compute L x − by iteratively solving an appropriate minimization problem, which we explain next.
We need to check if there exists an action sequence that drives x from a to b without exceeding M − .
We iterate over all possible sequences of SCCs.
Let (cid:126) C be such a sequence.
Deﬁne for each i ∈ [ m ] the following sets of actions:
A x i =
A x 0 ∪ { a ∈ A | pre ( a ) = {(cid:104) v, u (cid:105) , x ∈ ( −∞ , w a ] } , M − ≤ w a , u ∈ C i } , where
A x 0 = { a ∈ A | pre ( a ) = { x ∈ ( −∞ , w a ] } , M − ≤ w a } .
Note that all actions in A xi can be applied interchangeably.
Deﬁne the following minimization problem on the number of times n ja an action a with additive effect c a is applied while v has a value in C j as follows:
[Equation]
It is important to note that we can apply the actions in A xi in any order we want (modulo the applications of inner actions of v ).
Thus, by Lemma 4 if the minimization problem has a solution, there is a sequence of actions that leads from a :=
s k 1 [ x ] to b :=
s k 2 [ x ] , where for each state along the application of this sequence the value of x does not exceed
M − .
Note that we want to maximize f ( n ) since all considered c a are negative, so we attempt to get as close to 0 as possible.
Let n ∗ be the optimal solution for the optimisation problem.
By construction, any ordering of action applications can reach a point that is less that f ( n ∗ ) , thus we set
M (cid:126) C ,a,b − := f ( n ∗ ) .
By solving this problem for all possible (cid:126) C , a , and b , we can obtain the lower bound L − x .
The number of optimization problems we need to solve to obtain L − x is then 2 N ( C max x ) 2 , where N is the number of SCCs in the domain of v .
The solution for L + x is almost the same but we replace < with > and max with min in the optimisation problems.
This result brings us an important step forward into analyzing more general numeric planning tasks.
In the next section, we generalize the result to tasks with multiple numeric leaves.
PSPACE Membership of Forks
Let Π v,x 1 ,...,x n be an RT with a propositional variable v and numeric leaf variables x i .
Note that we can transform Π v,x 1 ,...,x n into an integer RT with bounded numeric goal conditions in polynomial time.
We consider such transformed tasks in the following and denote them by FRT.
The plan existence problem for FRT is denoted by PEFRT.
We show that deciding if the modiﬁed task Π v,x 1 ,...,x n is solvable lies in PSPACE .
To show this, we need the following result by Papadimitriou (1981, Lemma 4).
We assume that the coefﬁcients in integer linear programs (ILP) always are integers.
Lemma 6.
If the following ILP program is feasible and bounded, then for its optimal solution z ∗ holds that | z ∗ | ≤
M · (cid:80) ti =1 | c i | . min c (cid:48) x s.t. Ax ≤ b, x ∈ N ,
Here, M = t 2 ( ma 2 ) 2 m +3 , where m × t is the size of the integer program, and a = max i ∈ [ t ] ,j ∈ [ m ] {| a i,j | , | b i |} is a bound on the sizes of numbers in the program.
Theorem 5.
PEFRT lies in PSPACE .
Proof.
Let Π v,x 1 ,...,x n = n be an FRT of a size n , implying |D
( v ) | ≤ n .
Let further (cid:126) C : C 1 → C 2 → · · · → C m be a path through the SCCs in the domain of v .
To show the claim we iterate over all possible such paths, of which there are at most 2 n , ﬁx one (cid:126) C at a time, bound the problem, and check for solvability.
Note that if Π v,x 1 ,...,x n has a solution, it must traverse a (cid:126) C .
Such a plan π needs to respect (cid:126) C , so (cid:104) v, u (cid:105) ∈
s
0 ∩ C 1 , and, if (cid:104) v, u (cid:48)
(cid:105) ∈ G , we also require (cid:104) v, u (cid:48)
(cid:105) ∈
C m .
Note that for a given (cid:126) C we can ignore actions with preconditions and effects in v that do not obey (cid:126) C .
With a ﬁxed (cid:126) C , we can use Lemma 5 to individually bound the domains of { x i } ni =1 .
For each x ∈ { x i } ni =1 the bound from below for an (cid:126) C is given by a solution of ( C max x ) 2 ILPs, and constitutes
[Equation]
a,b −
We have that C max x ≤ 2 n since it is part of the input.
Iterating over all possible a and b we solve the ILP optimization problem given in the proof of Lemma 5.
Note that all constants except b − a in the ILP come from the deﬁnition of the problem, and | b − a | ≤ C max x ≤ 2 n .
The solution of the problem is bounded from above by 0 ( c a < 0 and n a ≥ 0 ), thus if the program is feasible it has an optimal solution, which we denote by z ∗ .
Now, we apply Lemma 6.
The number of constraints in this program (see ♥ ) equals the number of SCCs traversed by (cid:126) C , so is bounded by n ; the number of variables is | (cid:126) C|·|A| , since some actions can appear in all connected components.
We can bound the number of variables by n 2 .
Hence, by Lemma 6 we have
[Equation]
Thus, we can bound | z ∗ | by 2 4 n 2 +8 n for sufﬁciently large n .
To obtain an upper bound on the values taken by x , we compute L x,(cid:126) C
+ in the same fashion.
Hence, the domain of the numeric variable x under the path (cid:126) C is of the size 2 4 n 2 +8 n +1 .
The whole state space given the path (cid:126) C can be bounded by
[Equation]
Finally, to account for the choice of (cid:126) C and get the whole search space we need to multiply by the number of directed paths (cid:126) C , which also cannot exceed 2 n .
Hence, the whole state space can not exceed 2 5 n 3 for sufﬁciently large n .
Thus, by Savitch’s theorem, we can guess a solution of the task Π v,x 1 ,...,x n in polynomial space.
Thm. 5 is a major step forward in our analysis, showing tasks with fork causal graph that may have an arbitrary number of numeric variables to be computationally no harder than classical planning.
General Causal Graphs with Numeric Leaves
In this section, we further generalize the previous result to tasks with multiple propositional variables, where all numeric variables are causal-graph leaves.
Let Π be such an RT task.
Note that since all numeric variables of Π are leaves in the CG, we can transform the RT into its integer form with bounded goal conditions for all numeric variables.
We denote such tasks by NLRT and the corresponding plan existance problem by PENLRT.
Theorem 6.
PENLRT is decidable.
Proof.
Recall that by Thm. 5, checking plan existence for an RT with a with a fork-structured CG with numeric leaves is in PSPACE , so decidable.
Here, we show that we can transform an NLRT to an FRT using exponential space.
While this transformation does not preserve membership in
PSPACE , it is sufﬁcient to show that PENLRT is decidable.
Let us look at all partial propositional states of the task Π ,
S
( V p ) :=
Ś v ∈V p D ( v ) .
We can replace all propositional variables in Π with a single variable s s.t. D ( s )
=
S ( V p ) .
Each action that affects a v ∈ V p is transformed to an inner action of s .
The transformation may produce an exponential number of actions, since S ( V p ) is a projection of the state transition graph on V p , and thus may have exponential number of partial states and inner actions in the size of |V p | .
The actions that affect any variable x ∈ V n do not affect any other variable v ∈ V , because this was already the case in the original task.
Hence we know that the transformed task has one propositional CG-root variable s with a potentially exponential-size domain, and numeric variables x 1 , . . .
, x n that may depend on s .
Hence, each x ∈ V n is either a CG-leaf, or constitutes a singleton.
Since separated components of a CG can be solved separately, we invoke
Thm. 5 to check for the decidability of the fork, and Thm.to check for the decidability of singletons.
Our last result shows PSPACE -membership if we ﬁx the number of propositional variables.
We denote by k -PENLRT
the plan existence problem for NLRT with a ﬁxed number k of propositional variables.
Corollary 2.
k -PENLRT is in PSPACE .
Proof.
Let Π be an NLRT where (cid:107) Π (cid:107) = n and |V p | = k .
Let S ( V p ) be the domain of the new CG-root variable as introduced in the proof of Thm. 6.
Note that since the domains of our propositional variables are not bounded we have that |S ( V p )
| ∈
O ( n k ) .
This is due to the fact that for each v ∈ V p we have |D ( v ) | ≤ n .
The number of actions in the new task is O
( | A |· n k )
=
O ( n k +1 ) , since every new action may have at most one precondition in S ( V p ) .
By plugging this number into the last part of the proof of Thm. 5, we have that the state space of the transformed task is 2 O ( n k + c ) for some small universal constant c ∈ N .
The overall state space of the bounded numeric RT is bounded by |S ( V p ) | · max i ∈ [ n ] |D ( x i ) | n so we need to bound |D ( x i ) | for x i ∈ V n .
As before, we apply
Lem.
6 to the ILP ♥ from the proof of Lem.
In our case, the number of constraints is equal to the number of SCCs of S ( V p ) , m := n k .
The number of variables is the number of actions in the new task times the number of SCCs, that is t := n 2 k +1 .
The maximal constant of the problem is a := 2 n .
Thus, the size of the state space is bounded by
[Equation]
The multiplication by 2 takes into account that we solve two
ILPSs: one for the positive bound and one for the negative bound.
Take this bound to the power of n so that we cover all numeric variables and we see that the universal constant c = 2 , since (2 O ( n k +1 ) )
n = 2 nO ( n k +1 )
= 2 O ( n k +2 ) .
Thus, by
Savitch’s theorem (1970), k -PENLRT is in PSPACE .
The generalization to multiple propositional variables has important practical implications, since it allows to augment arbitrary classical planning tasks with many numeric leaf variables, without affecting the computational complexity.
Related Work
We are only aware of one important piece of related work, the complexity analysis by Helmert (2002).
As indicated before, that work focused on investigating the decidability boundaries of general numeric planning as deﬁned by the “level 2” of PDDL2.1 (Fox and Long 2003).
In their analysis, Helmert (2002) consider different levels of expressiveness of the mathematical formulas allowed in conditions and effects.
The simple numeric planning formalism considered in our work corresponds to their class ( C c , C c , E ± c ) , i. e., the class of tasks where numeric variables can be compared to constants in preconditions and the goal, and effects can only add constants.
This was proved to be undecidable.
In our work, we introduced a normal form for SNP tasks that is similar to the domain simpliﬁcation of Helmert (2002).
We outlined the differences between the two in the section on Integer Restricted Tasks.
Besides this, there is a weak connection between the constructions in some of our proofs and their Algorithm 22.
Both approaches rely on guessing action sequences, and both employ an ILP that encodes the number of times certain actions are applied.
The details of how these approaches are used differ signiﬁcantly, though.
While Helmert (2002) only requires the number of guesses to be bounded to show decidability, we derive a bound that shows PSPACE -membership.
Discussion
Our results are a major step forward in the complexity analysis of simple numeric planning.
Prior results by Helmert (2002) show that numeric planning is undecidable even for highly restricted instances, but that work focused on the expressive power of the mathematical expressions that are used in conditions and effects.
In this work, we analyzed the impact of the number of numeric variables and the causal structure of planning tasks.
We investigated the case of a single numeric variable as a basis for our more advanced results, showing that it is NP -hard in general.
With this, we proved that SNP is decidable as long as the numeric variables are leaf nodes in the causal graph.
The decision problem even lies in PSPACE for a ﬁxed number of propositional variables, so it stays in the class of classical planning.
Beyond the theoretical insights, we believe that our results can have a relevant practical impact.
Many techniques known from classical planning rely on ﬁnite domain sizes, so are not directly applicable to unbounded numeric variables.
With our ﬁndings, we can provide exactly these bounds.
Hence, techniques such pattern database heuristics (Culberson and Schaeffer 1998; Edelkamp 2001), which project onto a subset of the variables, and decoupled search (Gnad and Hoffmann 2018), which requires bounded leaf components, can probably be adopted to numeric planning.
For the future we intend to further continue both “branches” of our analysis.
The complexity of SNP tasks with two numeric variables is still unknown (the case for three or more variables is undecidable, which follows from a result of Helmert 2002).
Moreover, looking into different causal structures is obviously highly interesting.
Acknowledgements
The work of Alexander Shleyfman is partially supported by the Israel Academy of Sciences and Humanities program for Israeli postdoctoral researchers.
Daniel Gnad was partially supported by the Wallenberg AI, Autonomous Systems and Software Program (WASP) funded by the Knut and
Alice Wallenberg Foundation and by TAILOR, a project funded by the EU Horizon 2020 research and innovation programme under grant agreement no. 952215.
Peter Jonsson is partially supported by the Swedish Research Council (VR) under grant 2021-04371.