A New Order-theoretic Characterisation of the Polytime Computable Functions

We propose a new order, the small polynomial path order (sPOP* for short). The order sPOP* provides a characterisation of the class of polynomial time computable function via term rewrite systems. Any polynomial time computable function gives rise to a rewrite system that is compatible with sPOP*. On the other hand any function defined by a rewrite system compatible with sPOP* is polynomial time computable. Technically sPOP* is a tamed recursive path order with product status. Its distinctive feature is the precise control provided. For any rewrite system that is compatible with sPOP* that makes use of recursion up to depth d, the (innermost) runtime complexity is bounded from above by a polynomial of degree d.


Introduction
In this paper we are concerned with the complexity analysis of term rewrite systems (TRSs) and the ramifications of such an analysis in implicit computational complexity.
Term rewriting is a conceptually simple, but powerful abstract model of computation. The foundation of rewriting is equational logic and term rewrite systems (TRSs for short) are conceivable as sets of directed equations. The implicit orientation of equations in TRSs naturally gives rise to computations, where a term is rewritten by successively replacing subterms by equal terms until no further reduction is possible. Such a sequence of rewrite steps is also called a derivation.
A natural way to measure the complexity of a TRS R is to measure the length of computations in R. More precisely the runtime complexity of a TRS relates the maximal lengths of derivations to the size of the initial term. Furthermore the shape of the initial term is suitable restricted. The latter restrictions aims at capturing the complexity of the functions computed by the analysed TRS. Indeed, the runtime complexity of a TRS R forms an invariant cost model. Suppose the runtime complexity of R is polynomially bounded and the function computed by R is implemented on a Turing machine. Then the runtime of this Turing machine is polynomially bounded [3].
We propose a new order, the small polynomial path order (sPOP * for short). The order sPOP * provides a characterisation of the class of polynomial time computable function (polytime computable functions for short) via term rewrite systems. Any polytime computable function gives rise to a rewrite system that is compatible with sPOP * . On the other hand any function defined by a rewrite system compatible with sPOP * is polytime computable. The proposed order embodies the principle of predicative recursion as proposed by Bellantoni and Cook [7]. Our result bridges the subject of (automated) complexity analysis of rewrite systems and the field of implicit computational complexity (ICC for short).
Our results entail a new syntactic criteria to automatically establish polynomial runtime complexity of a given TRS. This criteria extends the state of the art in runtime complexity analysis as it is more precise or more efficient than related techniques. Note that the analysis is automatic as for any given TRS, compatibility with sPOP * can be efficiently checked by a machine. Should this check succeeds we get an asymptotic bound on the runtime complexity directly from the parameters of the order. It should perhaps be emphasised that compatibility of a TRS with sPOP * implies termination and thus our complexity analysis technique do not presuppose termination, instead we use (variations) of termination techniques to induce upper bounds on the complexity.
Our syntactic account of predicative recursion delineates a class of rewrite systems: a rewrite system R is called predicative recursive of degree d if R is compatible with sPOP * and the depth of recursion of all function symbols in R is bounded by d (see Section 4 for the formal definition). Any predicative recursive rewrite system of degree d admits runtime complexity in O(n d ).

Related works
Polynomial runtime complexity analysis is an active research area in rewriting. Interest in this field greatly increased recently. This is partly due to the incorporation of a dedicated category for complexity into the annual termination competition (TERMCOMP). 1 We mention very recent work on matrix interpretations that is readily applicable to runtime complexity analysis by Middeldorp et al. [21] and recent work on the incorporation of the dependency pair method in complexity analysis [13,14,23]. See [22] for an overview on work on complexity analysis in rewriting. The most powerful techniques for runtime complexity analysis currently available, basically employ semantic considerations on the rewrite systems, which are notoriously inefficient.
There are several accounts of predicative analysis of recursion in the (ICC) literature. We mention only those related works which are directly comparable to our work. See [5] for an overview on ICC. Notable the clearest connection of our work is to Marion's light multiset path order (LMPO for short) [18]. This path order forms a strict extension of the here proposed order sPOP * , but lacks the precision of the latter. In Bonfante et. al. [8] restricted classes of polynomial interpretations are studied that can be employed to obtain similar precise polynomial upper bounds on the runtime complexity of TRSs as with sPOP * . Neither of these results is applicable to relate the depth of recursion to the runtime complexity, in the sense mentioned above. We have also drawn motivation from [20] which provides a related fine-grained capturing of the polytime computable functions, but which lacks applicability in the context of runtime complexity analysis.
Above we emphasised that our analysis is automatic and there are other recent approaches for the automated analysis of resource usage in programs. Notable Hoffmann et al. [16] provide an automatic multivariate amortised resource analysis which extends earlier results on an automatic cost analysis using typing. Albert et al. [1] present an automated complexity tool for Java Bytecode programs and Gulwani et al. [11] provide an automated complexity tool for C programs.

Precise Runtime Complexity Analysis
The proposed order sPOP * is a restriction of the polynomial path order (POP * for short) introduced by the second and third author [2]. Crucially sPOP * is a tamed recursive path order with product status [4]. Its distinctive feature is the precise control provided for runtime complexity analysis: for any predicative recursive TRS of degree d its runtime complexity lies in O(n d ) (cf. Theorem 2). Furthermore this bound is tight, that is, we provide a family of TRSs, delineated by sPOP * , whose runtime complexity is bounded from below by Ω(n d ).

Fine-Grained Capture of Polytime Functions
As already mentioned the runtime complexity of a TRS forms an invariant cost model. Hence sPOP * is sound for the class of polytime computable functions: any function f computable by a TRS R, such that R is compatible with sPOP * is polytime computable. On the other hand sPOP * is complete: for any polytime computable function f there exists a TRS R computing f such that R is compatible with sPOP * . However, for runtime complexity, we can obtained a more fine-grained classification. We establish that those TRS that are definable with d nestings of predicative recursion are predicative recursive of degree d (cf. Theorem 13). Conclusively the runtime complexity of these systems lies in O(n d ).
Thereby we obtain a fine-grained characterisation of the polytime computable functions, which may be of interest in implicit computational complexity theory.

Parameter Substitution
We extend upon sPOP * by proposing a generalisation of sPOP * , admitting the same properties as above, that allows to handle more general recursion schemes that make use of parameter substitution (cf. Theorem 22). As a corollary to this and the fact that the runtime complexity of a TRS forms an invariant cost model we conclude a non-trivial closure property of the class B wsc : this class is closed under predicative recursion with parameter substitution.

Automated Complexity Analysis
We have implemented the order sPOP * in the Tyrolean Complexity Tool T C T, version 1.9, an open source complexity analyser. 2 The experimental evidence obtained indicates the viability of the method.

Motivation
We present the main ideas of the proposed small polynomial path order and provide an informal account of the technical results obtained in the remainder of the paper.
The order sPOP * essentially embodies the predicative analysis of recursion set forth by Bellantoni and Cook. In [7] a recursion-theoretic characterisation B of the class of polytime computable functions is proposed. This analysis is connected to the important principle of tiering introduced by Simmons [24] and Leivant [17]. The essential idea is that the arguments of a function are separated into normal and safe arguments (or correspondingly into arguments of different tiers).
It is a natural idea to seek out term-rewriting characterisations of the polytime computable functions [6]. Indeed, Beckmann and Weiermann successfully apply their characterisation to yield a non-trivial closure property of the class B. Given a TRS R representing a polytime computable function, we seek syntactic criteria on R to verify that the runtime complexity of R lies in O(n d ) for d ∈ N.
Let us make this idea precise. We present a subclass B wsc of B that only induces TRSs compatible with sPOP * . We formulate the class B wsc over the set {0, 1} * of binary words, where we write ǫ to denote the empty sequence and S i (; x) to denote the word xi. We are assuming that the arguments of every function are partitioned in to normal and safe ones. Notationally we write f (t 1 , . . . , t k ; t k+1 , . . . , t k+l ) where argument are separated by a semicolon. Normal arguments are always drawn to the left, and safe arguments to the right of the semicolon. The class B wsc is the smallest class containing certain initial functions and closed under weak safe composition and safe recursion on notation, which are presented in Fig. 1. Due to a variation of a result by Handley and Wainer, we have that B wsc captures the polytime functions [12]. A term-rewriting characterisation of the polytime functions is obtained by orienting the equations in Fig. 1 from left to right.
Suppose the definition of R is based on the equations in B wsc . It seems likely to deduce a precise bound on the runtime complexity of R by measuring the number of nested applications of safe recursion. We establish that such a TRS is predicative recursive of degree d, where d is the maximal nesting of schema (SRN) (cf. Theorem 13). This result is based on a suitable definition of sPOP * : the parameters and order constraints present reflect the operators in the class B wsc .
In order to employ the separation of normal and safe arguments, we fix for each defined symbol a partitioning of argument positions into normal and safe positions. For constructors we fix that all argument positions are safe. Moreover sPOP * restricts recursion to normal argument. Dually only safe argument positions allow the substitution of recursive calls. Via the order constraints we can also guarantee that only normal arguments are substituted for normal argument positions. Hence sPOP * enforces a weak composition schema for function 2 Available at http://cl-informatik.uibk.ac.at/software/tct. . . . composition, as well as a safe recursion schema for recursion. For the latter the comparison of arguments via a product status, rather than via a multiset status is also essential. The formal definition of sPOP * is given in Section 4. We remark on the connection between sPOP * and other path orders. It is clear that an order-theoretic characterisation of predicative recursion is obtained as a restriction of the recursive path order. Predicative recursion stems from a careful analysis of primitive recursion and the recursive path order (with multiset status) characterises the class of primitive recursive functions [15]. The light multiset path order proposed by Marion is based on the separation of normal and safe arguments and adapts function composition suitable to retain the separation of normal and arguments. However, the composition schema goes beyond weak composition. It is shown in [18] that LMPO captures the polytime computable functions, but this result relies on a clever use of memoisation techniques. In particular the aforementioned restrictions are not enough to forbid the treatment of TRSs that induce non-feasible runtime complexity. To recover the situation, POP * additionally requires the absence of multiple recursive calls in a rule. Then it can be shown that in fact compatible TRSs admits feasible runtime complexity [2]. However, for rewrite systems of predicative recursion of degree d, POP * overestimates the runtime complexity.

Initial Functions
To show that sPOP * is correct, we make use of a variety of ingredients. First in Section 4 we propose a family of TRSs that establish the tightness of the obtained bound. Then in Section 5, we define predicative interpretations S that flatten terms to sequences of terms, essentially separating safe from normal arguments. This allows us to analyse a term independent from its safe arguments. In Section 6 we introduce an order ▸ k on sequences of terms, that is simpler compared to > spop * and does not rely on the separation of argument positions. In Section 7 we show that predicative interpretations S embeds innermost rewrite steps into ▸ k as depicted in Fig. 2. As the length of ▸ k descending sequences starting from basic terms can be bound appropriately (cf. Theorem 9), we obtain correctness. Finally, to show that sPOP * is complete, it suffices to show that any B wsc only induces TRSs compatible with sPOP * (cf. Section 8).

Preliminaries
We assume at least nodding acquaintance with the basics of rewriting cf. [4]. In this section we fix the bare essential of notions and notation, we use in the remainder of the paper.
Throughout the paper, we fix a countably infinite set of variables V and a finite signature F consisting of function symbols f, g, h, . . . . The signature associates with each function symbol f a natural number, its arity. The set of terms is denoted as T (F, V) (or T for short). We write s ⊵ t to indicate that s is a subterm of t and s ⊳ t, if s is a proper subterm. The size of t refers to the number of function symbols and variables it contains. The depth dp(t) of t is 0 if t is a variable or a constant, for t = f (t 1 , . . . , t n ) the depth of t is d + 1 where d is the maximal depth of an argument t 1 , . . . , t n .
A precedence ≽ is a preorder on the set of function symbols F. As usual ≽ induces an equivalence ∼ and a strict proper order ≻. If f ≻ g we say that g is (strictly) below f in the precedence. This will indicate that the definition of f depends on g. In this sense ≽ can be seen as a form of static call graph. The rank rk(f ) = 1 + max{rk(g) f ≻ g} measures the length of ≻ chains starting from the function symbol f . (We employ the convention that the maximum of an empty set equals 0.) The equivalence ∼ is lifted from function symbols to terms by additionally disregarding the order on arguments. Formally s and t are equivalent, in notation s ∼ t, if s = t, or s = f (s 1 , . . . , s n ) and t = g(t 1 , . . . , t n ) where f ∼ g and s i ∼ t π(i) for all arguments and some permutation π.
A rewrite rule is a pair (l, r) of terms, denoted as l → r, where the left-hand side l is not a variable and the right-hand side r mentions only variables from l. A term rewrite system (TRS for short) R (over the signature F) is a finite set of rewrite. The root symbols of lefthand sides are called defined symbols, the remaining function symbols are called constructors. A term that only contains constructors is also called value, and the set of all values is denoted by Val.
Let R denote a TRS. The TRS R induces the rewrite relation → R on terms as follows. Informally, a term s rewrites to t if the left-hand side l of a rewrite rule l → r from R matches some subterm of s, and the term t is obtained from s by replacing the matched subterm with the corresponding instance of the right-hand side r. Formally, s → R t if there exists a context C, substitution σ and rule l → r ∈ R such that s = C[lσ] and t = C[rσ].
Here a context C is a term with exactly one occurrence of a hole ◻, and C[t] denotes the term obtained by replacing the hole ◻ in C by t. A substitution σ is a function that maps variables to terms, and tσ denotes the homomorphic extension of this function to terms.
A term t is called a normal form (with respect to R) if it is irreducible, ie., if there exists no term s with t → R s. Consider the rewrite step s → R t where s = C[lσ] as above. If all arguments of lσ are normal forms, then this step is an innermost rewrite step and denoted by s i → R t. The relation i → R is called the innermost rewrite relation of R. It requires arguments to be evaluated first, and can be seen as the adoption of a call-by-value semantics. In the sequel we will only be concerned with innermost rewriting.
The TRS R is a constructor TRS if arguments of left-hand sides only contain constructors. It is completely defined if values coincide with normal forms, that is, defined symbols do not occur in normal forms. The TRS R is called terminating if → R is well-founded, and R is confluent if all peaks t 1 * R ← s → * R t 2 can be joined: t 1 → * R u * R ← t 2 for some term u. If a TRS is confluent and terminating, then the result t ℓ of a computation of s, s → R t 0 → . . . → R t ℓ where t ℓ is in normal form, is well-defined and unique. Hence this subclass of TRSs forms a model of deterministic computation. Note that the model is independent on the evaluation strategy.
In this paper we are interested in the runtime complexity of such computations, following [13] we measure runtime as the number of rewrite steps in relation to input sizes, and disregard starting terms that do not correspond to function calls: The set of basic terms T b constitutes of all terms f (⃗ v) where f is defined and the arguments ⃗ v are values. The (innermost) runtime complexity of a terminating TRS R is defined as rc t is a basic of size up to n}. Here → denotes → R or i → R respectively, and the derivation height dh(t, →) is the maximal length of a derivation starting in t. As we focus in paper on innermost rewriting, we often drop the qualification innermost, when referring to the runtime complexity of a TRS. No confusion will arise from this.

The Small Polynomial Path Order
We arrive at the definition of sPOP * . To precisely assess the complexity of a TRS, sPOP * allows recursive definitions only on a subset of defined symbols, the so called recursive symbols. Symbols that are not recursive are called compositional.
Let R be a TRS and fix a precedence ≽ on the symbols of R. To assert our understanding that ≽ reflects a call graph indifferent on equivalent symbols, we require that ≽ is admissible: (i) constructors do not depend on defined symbols: f ≻ g implies that f is not a constructor, and (ii) the equivalence ∼ adheres the separation of constructors, recursive and compositional symbols: if f ∼ g then both f and g are either constructors, recursive or compositional symbols. The depth of recursion rd(f ) is defined in correspondence to the rank rk(f ), but only takes recursive symbols into account: sPOP * does not differentiate between equivalent terms in principle, however the equivalence need to respect the separation of normal and safe argument positions. We formalise this in the equivalence relation Here π denotes a permutation on argument positions so that position π(i) is normal if and only if the position i is normal. Let s = f (s 1 , . . . , s k ; s k+1 , . . . , s k+l ) we define the relation ▷ n so that s ▷ n t holds if (i) s i s ∼ t or s i ▷ n t for some argument s i of s, and (ii) if f is defined then the argument position i is normal (i ∈ {1, . . . , k}). In any case s ▷ n t implies that t is equivalent to a subterm of s.
The following definition introduces small polynomial path orders > spop * .
Definition 1. Let s and t be terms such that s = f (s 1 , . . . , s k ; s k+1 , . . . , s k+l ). Then s > spop * t if one of the following alternatives holds.
1. s i ⩾ spop * t for some argument s i of s.

2.
f is a defined symbol, t = g(t 1 , . . . , t m ; t m+1 , . . . , t m+n ) such that g is below f in the precedence and the following conditions hold: a) s ▷ n t j for all normal arguments t j of t; b) s > spop * t j for all safe arguments t j of t; c) at most one argument t j of t contains defined symbols not below f in the precedence.
Here s ⩾ spop * t denotes that either s and t are equivalent or s > spop * t holds. In the last clause we use > spop * also for the product extension of > spop * , where ⟨s 1 , . . . , s n ⟩ ⩾ spop * ⟨t 1 , . . . , t n ⟩ means s i ⩾ spop * t i for all i = 1, . . . , n, and ⟨s 1 , . . . , s n ⟩ > spop * ⟨t 1 , . . . , t n ⟩ indicates that additionally We say that a TRS R is compatible with > spop * if all rules are oriented from left to right: l > spop * r for all rules l → r ∈ R. We use the notation > ⟨i⟩ spop * to refer to the i th case in Definition 1 (a similar notation is employed for the subsequently defined orders).
Some Comments on the Definition Consider a compatible TRS R. By compatibility the left-hand side l is compared to the right-hand side of r and, recursively the arguments of r, for each rule l → r of R. The case > ⟨1⟩ spop * is standard in recursive orders and allows the treatment of functions defined by projection. Consider the more involved cases where the orientation is due to > ⟨2⟩ spop * or > ⟨3⟩ spop * . We use case > ⟨2⟩ spop * to capture function composition, where f is defined in terms of a function g below f in the precedence. The order constraints on normal arguments enforce that safe arguments of f cannot pass to normal arguments of g, and moreover the use of ▷ n disallows composition in normal positions of g. In contrast, safe arguments of the right-hand side can be compared using the full power of > spop * . The only additional restriction imposed states that at most one recursive call can occur below the function symbol g. Finally the case > ⟨3⟩ spop * captures recursion and is employed when l is compared to the recursive call. Here we require that the product of arguments decrease, where we are careful not to mix normal and safe arguments. In addition we require that normal arguments, ie. the recursion parameters, decrease strictly between l and the recursive call in r.
We say a constructor TRS R is predicative recursive of degree d if R is compatible with an instance > spop * and the maximal depth of recursion of a function symbol in R is d. As corollary to Theorem 2 we obtain that > spop * induces polynomial innermost runtime complexity on constructor TRSs.
Consider the constructor TRS R sq , whose rules are given in Fig. 3. The TRS R sq defines squaring of natural numbers build from the constructors 0 and s. Consider the precedence so that sq ≻ × ≻ + ≻ s ∼ 0. Then it can be verified that the TRS R sq is compatible with > spop * . For instance ×(s( ; x), y ; ) > spop * +(y ; ×(x, y ; )) follows by > ⟨2⟩ spop * since y appears as normal argument in the left-hand side and ×(s( ; x), y ; ) > spop * ×(x, y ; ) follows by one application of > ⟨3⟩ spop * . Note that the orientation only requires addition (+) and multiplication (×) to be recursive symbols, but not the square function (sq). Hence the precedence gives a recursion depth of 2 for multiplication and squaring, and a recursion depth of 1 to addition. According to Theorem 2 addition gives rise to linear, and multiplication as well as squaring gives rise to quadratic runtime complexity. Overall, the runtime complexity is quadratic.
We emphasise that Corollary 3 is tight in the sense that for any d ∈ N there exists a predicative recursive TRS of degree d so that the runtime complexity is bounded from below by Ω(n d ).
To see this, define a family of TRSs R i (i ∈ N) inductively as follows: R 0 ∶= {f 0 (x ; ) → a} and R i+1 extends R i by the rules presented in Fig. 4 We show that the runtime complexity of R d is in Ω(n d ): For d = 0 this is immediate. For d > 1, note that g d performs recursion on its first argument, at each step calling f d−1 . Conclusively f d (s n (a)) calls n times the function f d−1 . Inductive reasoning yields that f d (s n (a)) reduces in at least n d steps.

Predicative Interpretations
In the following, let R denote a constructor TRS that is compatible with > spop * . To simplify matters, we suppose for now that R is also completely defined. Consider a rewrite rule f (⃗ u ; ⃗ v) → r ∈ R that triggers an innermost rewrite step Since normal forms and values coincide, the rule is only triggered if all arguments ⃗ uσ, ⃗ vσ of the redex are values. Due to the limitations imposed by > ⟨2⟩ spop * and > ⟨3⟩ spop * , it is not difficult to see that if rσ is not a value itself, then at least all normal arguments are values. We capture this observation in the set T → b , defined as the least extension of values closed under F operations containing only values at normal argument positions: This set is closed under rewriting.
The Lemma follows by a straight forward inductive argument on Definition 1.
Since T → b contains in particular all basic terms, it follows that the runtime complexity function rc i R depends only on terms from T → b . The predicative interpretation S maps terms from T → b to sequences of normalised terms by separating normal from safe arguments. Here a term is normalised if it is a term where arities of defined symbols correspond to the number of normal argument positions. We write f n for the symbol f if it occurs in a normalised term. To denote sequences of terms, we use a fresh variadic function symbol ○. Here variadic means that the arity of ○ is finite but otherwise arbitrary. We always write [a 1 ⋯ a n ] for ○(a 1 , . . . , a n ), in particular if we write f (a 1 , . . . , a n ) then f = ○. We denote by T * the set of sequences [t 1 ⋯ t n ] of normalised terms t 1 , . . . , t n . Abusing set-notation, we denote by s ∈ [s 1 ⋯ s n ] that s = s i for some i ∈ {1, . . . , n}.
The predicative interpretation S is defined on T → b as follows: If t is a value, then Here the concatenation operator ⌢ is defined on sequences such that [ We extend concatenation to terms by identifying terms t with the singleton sequences [ t ], for instance s ⌢t = [ s t ].
In Fig. 5 we exemplify the predicative interpretation S on a rewrite step of the R sq depicted in Fig. 3.

The Small Polynomial Path Order on Sequences
We define the small polynomial path order on sequences T * . As these serve a purely technical reason, it suffices to represent the order via finite approximations ▸ k . The parameter k ∈ N controls the width of terms and sequences. We lift terms equivalence to sequences by disregarding order of elements: Here a ▸ k b denotes that either a and b are equivalent or a ▸ k b holds, and ⟨s 1 , . . . , s k ⟩ ⊳ ∼ ⟨t i , . . . , t k ⟩ denotes that the term t i is equivalent to a subterm of s i for all i = 1, . . . , n, and at least one t i 0 is equivalent to a proper subterm of s i 0 (i 0 ∈ {1, . . . , n}).

Figure 6: Predicative interpretation revisited
Proof. We focus on Property 3, the other facts either follow by definition, or by a straight forward inductive argument. In proof of Property 3 we perform case analysis on the last rule that concludes a ▸ k b.
or c is the term u 1 and l = 1. We conclude the lemma using ▸ ⟨4⟩ k , employing the inequalities a ▸ k b and u i ▸ k u i for all i ∈ {1, . . . , l}.
Suppose a ▸ ⟨3⟩ k b. Then a = f (s 1 , . . . , s n ) and b = [t 1 ⋯ t m ]. We conclude a⌢ c ▸ k b⌢c similar to above.
Suppose a▸ ⟨4⟩ k b. In this case a = [s 1 ⋯ s n ] and b is equivalent to b 1 ⌢⋯⌢ b n such that s i ▸ k b i for all i = 1, . . . , n and s i 0 ▸ k b i 0 for at least one i 0 ∈ {1, . . . , n}. Then a⌢c = [ s 1 ⋯ s n u 1 ⋯ u l ] and b⌢ c is equivalent to b 1 ⌢ ⋯⌢ b n ⌢u 1 ⌢⋯⌢ u l . One application of ▸ ⟨4⟩ k proves the lemma. The length of ▸ k descending sequences is expressed by the function G k , given by Here a ranges over (normalised) terms and sequences. As intermediate result we obtain that sequences act purely as containers with respect to G k .
Proof. Let a = [s 1 ⋯ s n ] be a sequence and observe G k (a 1 ⌢ a 2 ) ⩾ G k (a 1 ) + G k (a 2 ). This is a consequence of Lemma 6 (3). Hence in particular To prove the inverse direction, we show that a▸ k b implies G k (b) < ∑ n i=1 G k (s i ) by induction on G k (a). The base case G k (a) = 0 follows trivially as the assumption a ▸ k b is not satisfied. For the inductive step, observe that a ▸ k b follows due to ▸ ⟨4⟩ k . Hence b is equivalent to . . , n}, induction hypothesis is applicable to b and all b i (i ∈ {1, . . . , n}). It follows that Let r and d be natural number. We recursively define: Below the argument r will be instantiated by the rank and d by the depth of recursion of a function symbol f . The next lemma is a technical lemma to ease the presentation of the proof of Theorem 9.
Further suppose that ∑ m i=1 dp(t i ) < ∑ n i=1 dp(s i ) implies Proof. We consider the first point of the proposition. By assumption f (s 1 , . . . , s n ) ▸ ⟨1⟩ k g(t 1 , . . . , t m ). Consider a term t j where j ∈ {1, . . . , m}. By definition, t j is equivalent to a proper subterms of f (s 1 , . . . , s n ) and it follows that dp(t j ) ⩽ ∑ n i=1 dp(s i ) =∶ u. Hence ∑ m i=1 dp(t i ) ⩽ k ⋅ u since m ⩽ k by definition. As g is below f in the precedence, we have rk(g) < r and rd(g) ⩽ d. We conclude by monotonicity of c and assumption G k (g(t 1 , . . . , t m )) ⩽ c(rk(g), rd(g)) ⋅ (2 + k ⋅ u) rd(g) For the second point of the proposition, observe that by assumption f (s 1 , . . . , s n ) ▸ ⟨2⟩ k g(t 1 , . . . , t m ). Hence m = n and the order constraints on arguments give ∑ n i=1 dp(t i ) < ∑ n i=1 dp(s i ) =∶ u. Using rk(g) = r and rd(g) = d, the assumptions yield: Theorem 9. Let f be a defined symbol of recursion depth d. Then G k (f (s 1 , . . . , s n )) ⩽ c ⋅ ∑ n i=1 dp(s i ) d for all values s 1 , . . . , s n . Here the constant c ∈ N depends only on f and k.
Proof. Let k be fixed. To show the theorem, we show for all terms f (s 1 , . . . , s n ), whose arguments are constructor terms, that f (s 1 , . . . , s n ) ▸ k b implies: In proof we employ induction on rk(f ) and side induction on ∑ n i=1 dp(s i ). Consider g(t 1 , . . . , t m ) with f ≽ g. We state the induction hypothesis (IH) and side induction hypothesis (SIH). IH states that if g is below f in the precedence then G k (g(t 1 , . . . , t m )) ⩽ c(rk(g), rd(g)) ⋅ (2 + m i=1 dp(t i )) rd(g) , while SIH states that if f and g are equivalent in the precedence but ∑ m i=1 dp(t i ) < ∑ n i=1 dp(s i ) then G k (g(t 1 , . . . , t m )) ⩽ c(rk(g), rd(g)) ⋅ (2 + m i=1 dp(t i )) rd(g) .
Set u ∶= ∑ n i=1 dp(s i ), r ∶= rk(f ) and d ∶= rd(f ) and assume f (s 1 , . . . , s n ) ▸ k b. We prove In the base case r = 1 of the main induction, either f (s 1 , . . . , s n ) ▸ ⟨2⟩ k b or f (s 1 , . . . , s n ) ▸ ⟨3⟩ k b as f is minimal in the precedence. For the base case u = 0 of the side induction we see that b = [ ], hence G k (b) = 0 and the theorem follows. For the inductive step of the side induction let u > 0. If f is compositional, the assumptions give f (s 1 , . . . , s n ) ▸ ⟨3⟩ k b, hence b is a sequence, in particular b = [ ] and the theorem follows. For the remaining case that f is recursive, we consider two sub-cases: (i) b is a term, and (ii) b is a sequence. In the former sub-case, f (s 1 , . . . , s n ) ▸ ⟨2⟩ k b where b = g(t 1 , . . . , t n ) and g is equivalent to f in the precedence. The order constraints on arguments give ∑ n i=1 dp(t i ) < u. Employing rd(g) = d and rk(g) = r, we conclude the sub-case by SIH: In the second sub-case b is a sequence [t 1 ⋯ t m ] where f (s 1 , . . . , s n ) ▸ ⟨3⟩ k b. In particular, minimality of f in the precedence gives m ⩽ 1. Then the theorem follows trivially for m = 0, for m = 1 we conclude by the sub-case (i), additionally employing Lemma 7. Now, we consider the step case of the main induction, let r > 2. If b = g(t 1 , . . . , t m ), then obviously f ≽ g and we conclude by Lemma 8. Note that IH (SIH) yield the assumptions of the lemmas.
On the other hand suppose b = [t 1 ⋯ t m ] and thus f (a 1 , . . . , a n ) ▸ k b follows by ▸ ⟨3⟩ k . Then m ⩽ k and f (a 1 , . . . , a n )▸ k t j for all j = 1, . . . , m. Additionally at most one t j 0 (j 0 ∈ {1, . . . , m}) contains defined symbols not below f in the precedence. We analyse two sub-cases: either (i) f is recursive or (ii) f is compositional. We consider the first sub-case. In this case, f ≻ g implies d > rd(g) ⩾ 0. Lemma 8 yields: Here ( †) holds if j = j 0 . Recall m ⩽ k and c(r − 1, d) ⋅ k d+1 < c(r, d). We conclude with Lemma 7: On the other hand, consider the second sub-case that f is compositional. Conclusively  f (a 1 , . . . , a n ) ▸ k t j can be strengthened to f (a 1 , . . . , a n ) ▸ ⟨1⟩ k t j . Employing that d ⩾ rd(g) for all symbols g below f in the precedence, using Lemma 7 and Lemma 8 we see The theorem follows.

Predicative Embedding
In this section we prove that for some constant k ∈ N depending only on the considered TRS R, each innermost rewrite step gives rise to a ▸ k descent under predicative interpretation S. To ease the presentation, we provide the following auxiliary lemma.

Lemma 10.
Let s = f (s 1 , . . . , s l ; ⃗ s) be a basic term, let t be a term of size up to ℓ ∈ N and let σ be a substitution that maps variables to values. If s > spop * t then (i) f n (s 1 σ, . . . , s l σ) ▸ ℓ u for all u ∈ S(tσ) and further, (ii) at most one u ∈ S(tσ) contains a defined symbols not below f in the precedence.
Proof. We prove Property (i) by induction on > spop * and case analysis on the last rule concluding s > spop * t. Consider the case s > ⟨1⟩ spop * t where s i ⩾ spop * t holds for some argument s i of s. Since only case > ⟨1⟩ spop * applies on values, we see that t is equivalent to subterm of s i , in particular tσ is a value and S(tσ) = [ ]. Trivially the lemma follows.
By the ordering constraints imposed by > ⟨2⟩ spop * , the defined symbol g is below the defined symbol f in the precedence, and s ▷ n t j for all normal arguments t j of t. The latter reveals that the instances t j σ are equivalent to proper subterms of the normalised term f n (s 1 σ, . . . , s l σ). As trivially k is bounded by the size of t, one application of ▸ ⟨1⟩ k concludes ( ‡).
For Property (ii) a straight forward induction reveals that t contains at most one defined symbol not below f in the precedence. Here we make essential use of Condition (iii) in > ⟨2⟩ spop * . Then we conclude by the shape of σ and definition of predicative interpretations.
Lemma 11. Let R be a completely defined TRS compatible with > spop * . Let denote the maximal size of a right-hand side in R. If s ∈ T → b and s i → R t then S(s) ▸ ℓ S(t).
Proof. Let s ∈ T → b and consider an innermost rewrite step s i → R t. We prove the lemma by induction on the rewrite context. In the base case, the context is empty, i.e., s = lσ and t = rσ for some rule l → r ∈ R where l = f (l 1 , . . . , l m ; ⃗ l) is a basic term. Since R is a completely defined TRS, all arguments of lσ are values. Further compatibility gives l > spop * r, and hence all preconditions of Lemma 10 met. We conclude f n (l 1 σ, . . . , l m σ) ▸ ℓ u for all terms u ∈ S(rσ), where at most one u is not constructed from defined symbols below f n in the precedence. Exploiting that S erases values, hence in particular images of σ, it is not difficult to prove that the length of the sequence S(rσ) is bounded by r ⩽ ℓ. In total we obtain S(s) = [ f n (l 1 σ, . . . , l m σ) ] ▸ ℓ S(t) by one application of ▸ ⟨3⟩ k followed by one application of ▸ ⟨4⟩ k .
Consider now the stepping case Here we use that since s ∈ T b all normal arguments ⃗ v are values and cannot be rewritten. By induction hypothesis S(s i ) ▸ ℓ S(t i ). Using Lemma 6 we see Putting things together, we arrive at the proof of the main theorem.
Proof. Let R denote a predicative recursive TRS of degree d. We prove the existence of constant c ∈ N such that for all values ⃗ u, ⃗ v, the derivation height of the start term f (⃗ u ; ⃗ v) with respect to i → R is bounded by c⋅n k where n is the sum of the depths of normal arguments ⃗ u.
Without loss of generality we can assume that R is completely defined. Otherwise we add sufficient rules to R that make it completely defined. For this we suppose, without loss of generality, that the signature F contains a constructor such that f ≽ for all f ∈ D. Note that if we add such a symbol, then still the precedence underlying > spop * is admissible and the depth of recursion d does not increase. Call a normal form s garbage the root of s is defined. We extend R by adding the garbage rules rules s → for all normal forms s which are garbage. Clearly s > spop * by one application of > ⟨2⟩ spop * , conclusively R is compatible with > spop * too. Denote by s the result of replacing garbage in a term s by , that is s is the unique normal form of s with respect to the garbage rules. Since garbage rules do not overlap with the constructor TRS R, a straight forward inductive argument reveals that if s i → R t then also s i → + R t . Conclusively it suffices to estimate the number of rewrite steps induced by the completely defined TRS R .
Set ℓ to denote the maximal size of a right-hand side of a rule in R , and observe that ℓ is well defined. Consider a maximal derivation . . , n − 1}. By Lemma 4 it follow that t i ∈ T → b , and consequently S(t i ) ▸ ℓ S(t i+i ) due to Lemma 11. So in particular the length n is bounded by the length of ▸ ℓ descending sequences starting from S(f (⃗ u ; ⃗ v)) = [ f n (⃗ u) ]. Additionally using Lemma 7, Theorem 9 gives the constant c ∈ N as desired.

Completeness Results
In this section we show that the small polynomial path order sPOP * is complete. Indeed we can even show something stronger. Let R be a TRS that makes only use of d nestings of safe recursion, then R is predicative recursive of degree d. Due to the weak form of safe composition we have the inclusion that B wsc ⊆ B. Concerning the converse inclusion, the following lemma states that the class B wsc is large enough to capture all the polytime computable functions.
Lemma 12. Every polynomial time computable function belongs to ⋃ k∈N B k,0 wsc .
One can show this fact by following the proof of Theorem 3.7 in [12], where the unary variant of B wsc is defined and the inclusion corresponding to Lemma 12 is shown. We give the proof of Lemma 12 in detail below, but first assume the lemma in order to succinctly state our completeness result. The completeness of sPOP * for the polytime computable functions is an immediate consequence of Lemma 12 and Theorem 13. The witnessing TRS R f for f ∈ B wsc in Theorem 13 is obtained via a term rewriting characterisation of the class B wsc . The term rewriting characterisation expresses the definition of B wsc as an infinite TRS R Bwsc where the equations in Fig. 1 are oriented from left to right. Here binary words are formed from the constructor symbols ε, s 0 and s 1 .
We define a one-to-one correspondence between the class B wsc of functions and the set of function symbols for R Bwsc as follows. The function symbols O k,l , I k,l j , P, C correspond respectively to the initial functions O k,l , I k,l j , P, C of B wsc . The symbol SUB[h, i 1 , . . . , i k , ⃗ g] is used to denote the function obtained by composing functions h and ⃗ g according to the schema of (WSC) Finally, the function symbol SRN[g, h 0 , h 1 ] corresponds to the function defined by safe recursion on notation from g, h 0 and h 1 in accordance to the schema (SRN). It is easy to see that R Bwsc is a constructor TRS. Further R Bwsc is a orthogonal TRS, thus confluent.
Proof. Let f be an arbitrary function from B wsc . By induction according to the definition of f in B wsc we show the existence of a TRS R f and a precedence ≽ f such that 1. R f is a finite restriction of R Bwsc , 2. R f contains the rule(s) that defines the function symbol f corresponding to f , 3. R f is compatible with the sPOP * induced by ≽ f , 4. f is maximal in the precedence ≽ f , and 5. the maximal depth of recursion of the function symbols, i.e., rd(f), equals the maximal number of nested application of (SRN) in the definition of f in B wsc .
To exemplify the construction we consider the step case that f is defined from some functions g, h 0 , h 1 ∈ B wsc by the schema (SRN). By induction hypothesis we can find witnessing TRSs R g , R h 0 , R h 1 and witnessing precedences ≽ g , ≽ h 0 , ≽ h 1 respectively for g, h 0 , h 1 . Extend the set of function symbols by the recursive symbol f ∶≡ SRN[g, h 0 , h 1 ]. Let R f be the TRS consisting of R g , R h 0 , R h 1 and the following three rules: Let > spop * be the sPOP * induced by ≽ f . Then it is easy to check that R f enjoys Condition 1) and 2). In order to show Condition 3), it suffices to orient the three new rules by > spop * . For the rule in 1), f(ε, ⃗ x; ⃗ y) > ⟨2⟩ spop * g(⃗ x; ⃗ y) holds by the definition of ≽ f . For the remaining two rules in 2) we only orient the case i = 0. It is clear that f(s 0 (; z), ⃗ x; ⃗ y) > ⟨1⟩ spop * u holds for any u from z, ⃗ x, ⃗ y. In particular s 0 (; z) > ⟨1⟩ spop * z holds. Hence f(s 0 (; z), ⃗ x; ⃗ y) > ⟨3⟩ spop * f(z, ⃗ x; ⃗ y) holds. This together with the definition of the precedence ≽ f allows us to conclude Consider Condition 4). For each g ′ ∈ {g, h 0 , h 1 }, g ′ is maximal in the precedence ≽ g ′ by induction hypothesis for g ′ . Hence by the definition of ≽ f , f is maximal in ≽ f . It remains to show Condition 5). Since f is a recursive symbol rd(f) = 1 + max{rd(g), rd(h 0 ), rd(h 1 )}. Without loss of generality let us suppose rd(g) = max{rd(g), rd(h 0 ), rd(h 1 )}. Then by induction hypothesis for g, rd(g) equals the maximal number of nested application of (SRN)in the definition of g in B wsc . Hence rd(f) = 1 + rd(g) equals the one in the definition of f in B wsc .
In the sequel of this section, we provide the (technical) proof of Lemma 12. In what follows we totally follow presentations by W.G. Handley and S.S. Wainer in [12, Section 3]. We start with defining the k-th iteration f (k) ∈ B wsc of f ∈ B wsc by By the definition it is easy to see that f (k) (⃗ x; ⃗ y, f (l) (⃗ x; ⃗ y, z)) = f (k+l) (⃗ x; ⃗ y, z) holds.

Lemma 14. (Cf. [12, Lemma 3.3])
Let p be an n-ary polynomial with non-negative coefficients. If f (x 1 , . . . , x n ; ⃗ y, z) ∈ B wsc , then there exists a function iter[p, f ] ∈ B wsc such that Proof. We define a witnessing function iter[p, f ] by induction over the construction of the polynomial p. In case that p is a trivial polynomial, i.e., p(⃗ x) = 0 or p(⃗ x) = 1, the choice of . . n} and for some polynomial q(⃗ x): In this case we define an auxiliary function loop[q, f ] ∈ B wsc by We write y ⊕x to denote the sequence y followed by x 0's. Namely the operator ⊕ satisfies the equations y ⊕ ǫ = y and y ⊕ (x0) = y ⊕ (x1) = (y ⊕ x)0. We will write y ⊕ then f also enjoys the condition Let p be a polynomial with non-negative coefficients. Let us define two functions ⊕ p and ⊖ p by ⊕ p (⃗ x; y) = iter[p, S 0 ](⃗ x; y) and ⊖ p (⃗ x; y) = iter[p, P ](⃗ x; y) for the predecessor function P . Then ⊕ p , ⊖ p ∈ B wsc by Lemma 14. By definition ⊕ p (⃗ x; y) denotes the sequence y followed by p( ⃗ x ) 0's and ⊖ p (⃗ x; y) denotes the sequence consisting of the first y − p( ⃗ x ) symbols of y (if p( ⃗ x ) ⩽ y ). In the following we use the operator "min" in a modified sense that min(x, y) = x if x < y , or otherwise min(x, y) = y.
Then the function f [p] is as required since by the modified definition of min, min(a, 0) = ǫ if a = ǫ, or otherwise min(a, 0) = 0. Case. p(⃗ x) = q(⃗ x) + r(⃗ x) for some polynomials q and r: In this case a function f [p] is defined by In this case ⊖ r (⃗ x; a) = ǫ. Hence the following equality holds: Here the last equality follows as min(a, ⊕ r (⃗ x; ǫ)) = a = min(a, ⊕ p (⃗ x; ǫ)).
In this case ⊖ r (⃗ x; a) = a − r( ⃗ x ) > 0 and further min(⊖ r (⃗ x; a), ⊕ q (⃗ x; ǫ)) = ⊖ r (⃗ x; a) hold. Hence the following equality holds: The last equality holds since the assumption on f . This allows us to conclude be given. Then by IH for g 1 , . . . , g l ′ for each j = 1, . . . , l ′ there exists a witnessing function {g j , p} ∈ B wsc . Let p 1 , . . . , p l ′ be polynomials with non-negative coefficients such that g j ( ⃗ b) ⩽ p j ( ⃗ b ) for each j = 1, . . . , l ′ . It is well known that there exists such a lengthbounding polynomial for any polynomial time function. Define another polynomial q by q(⃗ x) = ∑ l ′ j=1 p j (p(⃗ x), . . . , p(⃗ x)). Clearly the polynomial q has only non-negative coefficients. By IH for h there exists a witnessing function {h, q}. We define a function {f, p} ∈ B wsc by holds. Then for each j = 1, . . . , l ′ we have Hence the following equality holds: Case. f is defined by polynomially length-bounded recursion on notation from some polynomial time functions g, h 0 , h 1 and some length-bounding polynomial p f by Let an arbitrary polynomial p with non-negative coefficients be given. By IH for g there exists a witnessing function {g, p} ∈ B wsc . Define a polynomial q by q(⃗ x) = p(⃗ x)+p f (p(⃗ x), . . . , p(⃗ x)). By IH for h 0 , h 1 there exist witnessing functions {h i , q} ∈ B wsc for each i = 0, 1. In order to define a witnessing function {f, p} ∈ B wsc we define auxiliary functions ⟨h 0 , q⟩ and ⟨h 1 , q⟩ by ⟨h i , q⟩(⃗ x, a, ⃗ b, c) = {h i , q}(⃗ x; a, ⃗ b, c) (i = 0, 1). Further we define another auxiliary function ⟨f, p⟩ by In the induction case max( a , ⃗ b ) ⩽ p( ⃗ x ) holds since we are assuming that max( a + 1, ⃗ b ) ⩽ p( ⃗ x ) holds. Hence the following equality holds: This completes the case and hence the proof of the lemma.
Proof. Let f be a k-ary polynomial-time computable function. Define a k-ary polynomial p with non-negative coefficients by p(⃗ x) = x 1 + ⋯ + x k . Then there exists a function {f, p} ∈ B wsc which witnesses Lemma 18. By the definition of the polynomial p, max ⃗ x ⩽ p( ⃗ x ) holds. Hence by Lemma 18 the equality {f, p}(⃗ x; ⃗ x) = f (⃗ x) holds. This implies that f ∈ ⋃ k∈N B k,0 wsc .

A Non-Trivial Closure Property of the Polytime Functions
In this section we introduce small polynomial path order with parameter substitution (sPOP * PS for short), that extends clause > ⟨2⟩ spop * to account for parameter substitution.
Definition 19. Let s and t be terms such that s = f (s 1 , . . . , s k ; s k+1 , . . . , s k+l ). Then s > spop * ps t if one of the following alternatives holds.
1. s i ⩾ spop * ps t for some argument s i of s.
2. f is a defined symbol, t = g(t 1 , . . . , t m ; t m+1 , . . . , t m+n ) such that g is below f in the precedence and the following conditions hold: a) s ▷ n t j for all normal arguments t j of t; b) s > spop * ps t j for all for all normal arguments t j of t; c) except for one argument t j 0 , all arguments t j (j = j 0 ) contain only function symbols below f in the precedence.
3. f is recursive and t = g(t 1 , . . . , t k ; t k+1 , . . . , t k+m ) such that g is equivalent to f in the precedence and the following conditions hold: a) ⟨s 1 , . . . , s k ⟩ > spop * ps ⟨t π(k) , . . . , t π(k) ⟩ for some permutation π on normal argument positions; b) s > spop * ps t j for all safe arguments t j ; c) all safe arguments t j contain only function symbols below f in the precedence.
Here s ⩾ spop * ps t denotes that either s and t are equivalent or s > spop * ps t. In the last clause, we use > spop * ps also for the product extension of > spop * ps (modulo permutation). As evident from our experiments, parameter substitution extends the analytical power of sPOP * significantly. In particular, sPOP * can handle tail recursion as in the TRS R rev whose rules are depicted in Fig. 7. Whereas R rev cannot be handled by sPOP * , it is compatible with > spop * ps as induced by the precedence rev ≻ rev tl ≻ ∶ where only rev tl is recursive. Still sPOP * PS induces polynomially bounded runtime complexity in the sense of Theorem 2. We emphasise that the proof requires only minor modification. First, we verify that the set T → b is closed under rewriting in the sense of Lemma 4.
Proof. The Lemma follows by a straight forward inductive argument on Definition 19.
Further, innermost rewrite step embed into ▸ k in accordance to Lemma 11.
Lemma 21. Let R be a completely defined TRS compatible with > spop * ps . Let ℓ ⩾ max{ r l → r ∈ R}. If s ∈ T → b and s i → R t then S(s) ▸ ℓ S(t).
Exactly as in Lemma 10 we verify ( ‡). Unlike for the case > ⟨2⟩ spop * , we cannot reason that the safe arguments t j of t (j = k + 1, . . . , k + n) are values. Instead, we use the induction hypothesis on t j to conclude f n (l 1 σ, . . . , l m σ) ▸ ℓ u for all u ∈ S(t j σ). Proof. The proof goes in accordance to the proof of Theorem 2, where we replace the application of Lemma 11 and Lemma 4 by the corresponding Lemma 21 and Lemma 20 respectively.
The order sPOP * PS is complete for the class of polytime computable functions. However, in order to state a stronger completeness result, we introduce an extension of the class B wsc according to the definition of sPOP * PS . Let B wsc+ps denote the smallest class containing B wsc and closed under weak safe composition (WSC) and safe recursion on notation with parameter substitution (SRN PS ) which is presented in Fig. 8. Then sPOP * PS is complete for B wsc+ps in the same sense as Theorem 13. Here we adapt the notion of predicative recursive TRS of degree d to sPOP * PS in the obvious way.
Theorem 23. For any B wsc+ps -function f there exists a confluent TRS R f that that is predicative recursive of degree d, where d equals the maximal number of nested application of (SRN PS ) in the definition of f .
Proof. The proof goes in accordance to the proof of Theorem 13. One will extend the TRS R Bwsc for B wsc to a TRS R Bwsc+ps for B wsc+ps by adding rules corresponding to the schema of (SRN PS ). Clearly this schema is a syntactic extension of the schema of (SRN). Hence we can replace the case of (SRN) by (SRN PS ) and application of Definition 1.3 by application of Definition 19.3.

Experimental Results
The complexity analyser T C T features a fully automatic implementation of sPOP * and sPOP * PS . To facilitate an efficient synthesis of a concrete order, we make use of the state-ofthe-art SAT-solver MiniSAT [10]. The experiments were conducted on a laptop with 4Gb of RAM and Intel ® Core ™ i7-2620M CPU (2.7GHz).
In Table 1 we contrast the different orders on our testbed. The testbed is a subset of 757 examples from the termination problem database, version 8.0 3 . This subset was obtained by restricting the runtime complexity problem set to constructor TRSs, additionally removing TRSs that are not wellformed. 4 .
The rows of Table 1 reflect the assessed bounds on the innermost runtime complexity. Additionally we annotate for each method the number of systems that were proven in total (row yes), and the number of systems were a proof was not obtained (row maybe). Since recursive path orders (with multiset status) (MPO for short) encompass LMPO as well as (small) polynomial path orders, we also included MPO for comparison. This reveals that predicative recursion limits the power of our techniques by roughly one fourth on our testbed. Comparing POP * with sPOP * we see an increase in precision accompanied with only minor decrease in power. Of the four systems that can be handled by POP * but not by sPOP * , two fail to be oriented because sPOP * weakens the multiset status to product status, and two fail to be oriented because of the weakening of the composition scheme. Compared to LMPO, polynomial path orders loose in power as they cannot deal with multiple recursive calls. Note that not all systems proven by LMPO admit polynomial (innermost) runtime complexity. The last two columns of Table 1 demonstrate that parameter substitution almost closes the gap in power to LMPO. Whether this extension is also possible for LMPO remains currently unknown.

Conclusion
We propose a new order, the small polynomial path order sPOP * . Based on sPOP * , we delineate a class of rewrite systems, dubbed systems of predicative recursion of degree d, such that for rewrite systems in this class we obtain that the runtime complexity lies in O(n d ). This is a tight characterisation in the sense that we can provide a family of systems of predicative recursion of depth d, such that their runtime complexity is bounded from below by Ω(n d ).
In future work we want to integrate sPOP * with the weak dependency pair framework that lifts the dependency pair method to the runtime complexity analysis. Furthermore, we aim to clarify the question whether the class of predicative recursive TRS of degree d exactly characterise those functions definable with d nested applications of safe recursion. We conjecture that the answer is yes, but further research in this direction is required. In [19] a type system for a simple imperative programming language is proposed that induces polytime computability. The definition of this type system is closely connected to predicative recursion. We want to investigate whether a similar type system can be crafted on the basis of the class B wsc studied in this paper. Perhaps such a study allows to certify more precise time bounds in the spirit of the class of predicative recursive TRSs of degree d.