<p>As means of clarification, I should note that Foetus is developed by <a href="http://www2.tcs.ifi.lmu.de/~abel/index.html" rel="nofollow">Andreas Abel</a>, who also developed the <a href="http://www2.tcs.ifi.lmu.de/~abel/diplomathesis.pdf" rel="nofollow">original termination checker for Agda</a>, and worked on <a href="http://www2.tcs.ifi.lmu.de/~abel/publications.html#diss" rel="nofollow">more advanced termination techniques</a> since.</p>

<p>The answer to your question might be a bit disappointing: the class of functions from $\mathbb{N}$ to $\mathbb{N}$ is <strong>exactly</strong> the functions that can be defined in system $\mathrm{F}$. The reason for this: the aforementioned class is equal to the provably terminating functions in Second Order Arithmetic ($\mathrm{PA}^2$) which in turn is equal to the functions definable in system $\mathrm F$ (see e.g. <a href="http://www.paultaylor.eu/stable/Proofs+Types.html" rel="nofollow">Proofs and Types</a>, chapter 11). Furthermore, if you remove the polymorphism, then you fall down to functions definable in $\mathrm{PA}$, which happens to coincide with those definable in system $\mathrm{T}$.</p>

<p>Again, the reson for this is that the decrease captured by the "call matrices" is <strong>provably well-founded</strong>, and that proof can be carried out entirely in $\mathrm{PA}$.</p>

<p>However, this doesn't mean that Foetus is not more <strong>useful</strong> than system $\mathrm{T}$! In practice, more complex termination analyses are required to be able to accept certain <strong>presentations</strong> of computable functions. You don't want to have to do a complicated proof in Peano Arithmetic every time you write a unification function, for example. So in this respect, Foetus is very powerful, and allows you to define functions in a way which wouldn't be accepted by either Coq, Agda or any other common proof system.</p>

CC BY-SA 3.0
2014-01-15T00:02:17.677Z
how can a class of functions which are provably terminating (PA^2) be equivalent to the class of functions in system F which are not provable to terminate as far as I know? Also I don't understand how you are answering me question. Are you saying system T has a larger class of computable functions or are you saying that foetus is? I think there was a leap in your logic that expected I had more background than I actually do. Also the link you provided seems to lead to a bad page that does not render correctly.
Jake
CC BY-SA 3.0
2014-01-15T18:12:06.373Z
Functions in system F all terminate. Foetus captures a larger class of computable functions than system T, but "by accident", if you remove polymorphism, then Foetus only captures exactly system T. Can you tell me which link doesn't work for you? (and which browser you are using :)
cody
CC BY-SA 3.0
2014-01-14T19:45:58.913Z
2014-01-14T19:45:58.913Z
cody
<p>If by primitive recursive functionals you mean <a href="http://en.wikipedia.org/wiki/Primitive_recursive_function" rel="nofollow">primitive recursive functions</a> and you know that Foetus contains the Ackermann function then Foetus does not coincide with the class of p.r. functions as the Ackermann function is not primitive recursive.
This was shown by Ackermann and later a simplified proof was given by Rosza Peter in "<a href="http://link.springer.com/article/10.1007%2FBF01472200" rel="nofollow">Konstruktion nichtrekursiver Funktionen</a>" 1935 (unfortunately only in German as far as I know). </p>

<p>If you look for larger classes of recursive functions that are guaranteed to terminate which might coincide with the class of functions captured by Foetus then some other work of Rosza Peter might interest you. </p>

<p>The Ackermann function is contained in the class of multiple recursive functions as defined by Rosza Peter in "<a href="http://link.springer.com/article/10.1007%2FBF01571648" rel="nofollow">Uber die mehrfache Rekursion</a>" 1937. Informally, the idea behind multiple recursion is that you can have multiple recursive variables which can change after a recursive step. For example $f(a,b)$ might call $f(a,b-1)$ or $f(a-1,b)$.</p>

<p>Yet a stronger class is given by the concept of transfinite recursion described in "<a href="http://www.jstor.org/discover/10.2307/2268337?uid=3737864&amp;uid=2&amp;uid=4&amp;sid=21103269656597" rel="nofollow">Zusammenhang der mehrfachen und transfiniten
Rekursion</a>" by Rosza Peter.  For transfinite recursion you have one recursive variable which can call predecessors w.r.t. to a special ordering $&lt;$</p>

<p>For example, you can interpret an integer as a pair of integers and use the ordering
$$ (a,b) &lt; (c,d) \iff ( a &lt; c \wedge b \leq d ) \vee ( a \leq c \wedge b &lt; d )$$ 
This can be generalized for triples of integers and so on. Peter calls these orderings $\omega^2, \omega^3$ and so on. 
You can go one step further and interpret an integer as an arbitrary number of integers. Let $p_i$ be the $i$-th prime number. Then we can consider $z = p_1^{n} \cdot p_2^{x_1} \cdot p_3^{x_2} \cdot \dots$ where $n$ denotes the number of integers encoded in $z$ and the $x_i$'s contain the resp. value. She denotes an ordering for such a list of integers as $\omega^\omega$ and shows by diagonalization that this kind of recursion is stronger than multiple recursion. However, I'm not sure if there is a syntactical characterization of this class. </p>

<p>[edit] Primitive recursive functions are not the same as primtive recursive functionals as noted in the comment below. Yet I think one could transfer the concept of transfinite recursion to functionals. However, it isn't clear whether it still is more powerful w.r.t. a functional setting.</p>

CC BY-SA 3.0
2014-01-14T23:54:58.970Z
the class of primitive recursive functionals of finite type is more general than the class of primitive recursive functions. It can express the Ackermann function for instance and can be seen in Godel's system T.
Jake
CC BY-SA 3.0
2014-01-14T12:39:38.183Z
2014-01-15T11:05:38.310Z
2014-01-15T11:05:38.310Z
John D.
<p>Yes, the Foetus checker can typecheck everything in Goedel's T. You can show this by using the checker to show that the iteration operator in T is terminating. For example, the following definition will work:</p>

<p>$$
\begin{array}{lcl}
\mathit{iter}  &amp; : &amp;  A \to (A \to A) \to \mathbb{N} \to A \\
\mathit{iter} \;i \;f \;0 &amp; = &amp; i \\
\mathit{iter} \;i \;f \;(n+1) &amp; = &amp; f\;(\mathit{iter} \;i \;f \;n)  
\end{array}
$$</p>

<p>This is very easy for the Foetus checker (or most any other termination checker) to check, because it is an obviously structurally recursive definition.</p>

<p>Agda and Coq both permit proving termination of functions that go far beyond what is provably total in first-order arithmetic. The feature which enables this is that they permit defining types by recursion on data, which is called "large elimination". (In ZF set theory, the <a href="http://en.wikipedia.org/wiki/Axiom_schema_of_replacement">axiom scheme of replacement</a> serves roughly the same purpose.) </p>

<p>An easy example of something that goes beyond T is the consistency of Goedel's T itself! We can give the syntax as a datatype:</p>

<pre><code>data T : Set where 
   N : T 
   _⇒_ : T → T → T

data Term : T → Set where 
   zero : Term N
   succ : Term (N ⇒ N)
   k    : {A B : T} → Term (A ⇒ B ⇒ A)
   s    : {A B C : T} → Term ((A ⇒ B ⇒ C) ⇒ (A ⇒ B) ⇒ A ⇒ C)
   r    : {A : T} → Term (A ⇒ (A ⇒ A) ⇒ N ⇒ A)
   _·_  : {A B : T} → Term (A ⇒ B) → Term A → Term B
</code></pre>

<p>Note that the type dependency permits us to define a datatype of terms containing only the well-typed terms of T. We can then give an interpretation function for the types:</p>

<pre><code>interp-T : T → Set 
interp-T N       = Nat 
interp-T (A ⇒ B) = (interp-T A) → (interp-T B)
</code></pre>

<p>This says that <code>N</code> should be the Agda natural numbers, and T's arrow should be interpreted as the Agda function space. This is a "large" elimination, because we define a <em>set</em> by recursion on the structure of the datatype T. </p>

<p>We can then define an interpretation function, showing that every term of Goedel's T can be interpreted by an Agda term:</p>

<pre><code>interp-term : {A : T} → Term A → interp-T A
interp-term zero    = 0 
interp-term succ    = \n → n + 1
interp-term k       = \x y → x
interp-term s       = \x y z → x z (y z)
interp-term r       = Data.Nat.fold 
interp-term (f · t) = (interp-term f) (interp-term t)
</code></pre>

<p>(I don't have Agda on this machine, so there are doubtless some missing imports, fixity declarations, and typos. Fixing that is an exercise for the reader, who can also be an editor, if they like.)</p>

<p>I don't know what the consistency strength of Agda is, but Benjamin Werner has shown that the Calculus of Inductive Constructions (Coq's kernel calculus) is equiconsistent with ZFC plus countably many inaccessible cardinals. </p>

CC BY-SA 3.0
2014-01-14T16:46:07.930Z
Note that you haven't used large elimination in your example. Large elimination doesn't actually add computational power. Impredicativity does: system F doesn't have the former, but can express functions not expressible in system T.
cody
CC BY-SA 3.0
2014-01-14T20:37:27.423Z
@cody: The interp-T function computes a set from a term, which looks like a large elimination to me! It is definitely the case that large eliminations add power: Martin-Loef type theory can't even derive inconsistency from 0=1 without a large elimination. (To see this, note that without universes/large eliminations you can erase all dependencies and get a simply typed term: this is what Harper and Pfenning did in their adequacy proof for LF.)
Neel Krishnaswami
CC BY-SA 3.0
2014-01-14T22:01:18.777Z
I'm sorry: yes the interp-T function does indeed use large elimination. I also agree that proving 0 != 1 does indeed require it. However, *defining computable functions* is not the same thing as *proving mathematical statements*. My answer clarifies this a bit. The pure Calculus of Constructions, for example, cannot prove 0 != 1. It can, however, define the Ackermann function with relative ease.
cody
CC BY-SA 3.0
2014-01-14T23:51:43.377Z
This shows that Agda is more general sense it can write an interpreter for system T but does it does not show weather or not Foetus, a language which is not dependently typed, is more general. Can Foetus do this? Would Agda still be able to do this if not for "large elimination"?
Jake
CC BY-SA 3.0
2014-01-15T09:55:50.417Z
Agda's documentation says its termination checker uses the Foetus algorithm. If you took T, and extended it with pattern matching and recursive definitions checked by Foetus, you would not be able to write an interpreter for T in it. In fact, you would not change the functions computable by T at all -- all of the termination orders Foetus computes are provably well-founded in Peano arithmetic. (See cody's answer.) The Foetus algorithm lets you write more *definitions*, without changing the set of *functions* you can compute. Agda's large eliminations actually increase the set of functions.
Neel Krishnaswami
CC BY-SA 3.0
2014-01-15T18:10:02.820Z
I'm still not convinced large elimination is the culprit here: Term is secretly of type $\mathrm{Set}_1$ rather than $\mathrm{Set}_0$, and I think this is what you are really using.
cody
CC BY-SA 3.0
2014-01-15T20:19:28.240Z
Neel: perfect! that answers my question! Foetus allows the same set of commutable functions! Thanks! That is exactly what I wanted to know. Also that large elimination expands the set of functions which may be of further use. Thanks!
Jake
CC BY-SA 3.0
2014-01-14T10:54:49.160Z
2014-01-14T10:54:49.160Z
Neel Krishnaswami
<p>Foetus, if you have not heard of it, can be read up on <a href="http://www2.tcs.ifi.lmu.de/~abel/foetus/">here</a>. It uses a system of 'call matrices' and 'call graphs' to find all 'recursion behaviors' of recursive calls in a function. To show that a function terminates it shows that all the recursion behaviors of recursive calls made to a function obey a certain 'lexicographic ordering'. It's termination checker allows all primitive recursive functions and functions such the Ackermann function. Basically it allows multi-argument primitive recursion. This is also basically the the termination checker of Agda; I believe that Coq has some similar facilities as well though perhaps more general.</p>

<p>From reading the paper <a href="http://www.jucs.org/jucs_10_7/total_functional_programming/jucs_10_07_0751_0768_turner.pdf">"Total Functional Programming" by D.A. Turner</a>. He explains that his proposed language would be able to express all "primitive recursive functionals" as seen in System T studied by Godel. He goes on to say that this system is "known to include every recursive function whose totality can be proved in first order logic".</p>

<p>Dose Foetus allow all primitive recursive functionals? If so does it allow functions which are not primitive recursive functionals? Can a citation be provided for the answer to this? (this is not actually necessary as I'm just interested; it's just that some reading marital on the matter would be nice)</p>

<p>Bonus question:
Primitive recursive functionals have a very concise definition in terms of combinators: typed S and K (that can't express the fixed point combinators), zero, the successor function, and the iteration function; that's it. Are there other more general such languages which have such a concise definition and in which all expressions terminate?</p>

CC BY-SA 3.0
2014-01-14T13:50:42.943Z
On Agda vs Coq: I always read Agda's termination checker to be more advanced and accepts more functions, yours is the first claim to the contrary (this is a good rule of thumb when comparing Agda to Coq, except for Agda's lack of tactics: Agda is more researchy and open to extensions whose stability is less established).
Andreas Abel has been working on even more advanced termination checkers based on sized types, see his work on MiniAgda and also [this paper](http://www2.tcs.ifi.lmu.de/~abel/publications.html#icfp13).
Blaisorblade
CC BY-SA 3.0
2014-01-14T19:30:17.967Z
There is "accept more function definitions" and "have a larger class of computable functions". The two are incomparable. Agda wins on the first count, but Coq clearly wins on the second.
cody
CC BY-SA 3.0
2014-01-15T00:04:26.200Z
I should clarify that I have not used Coq at all and Agda only a little. It seemed that from what little I read Coq was capable of defining a wider class of computable functions but I did not know so I said "I believe that Coq has some similar facilities as well though perhaps more general"; "belive" and "perhaps" were used to convey that I did not know.
Jake
<lo.logic><computability><functional-programming>
Is the class of primitive recursion functionals equivalent to the class of functions which Foetus proves to terminate?
Jake
# Is the class of primitive recursion functionals equivalent to the class of functions which Foetus proves to terminate?

(Asked by: username_0 on 2014-01-14)

Foetus, if you have not heard of it, can be read up on [here](http://www2.tcs.ifi.lmu.de/~abel/foetus/). It uses a system of 'call matrices' and 'call graphs' to find all 'recursion behaviors' of recursive calls in a function. To show that a function terminates it shows that all the recursion behaviors of recursive calls made to a function obey a certain 'lexicographic ordering'. It's termination checker allows all primitive recursive functions and functions such the Ackermann function. Basically it allows multi-argument primitive recursion. This is also basically the the termination checker of Agda; I believe that Coq has some similar facilities as well though perhaps more general.

From reading the paper ["Total Functional Programming" by D.A. Turner](http://www.jucs.org/jucs_10_7/total_functional_programming/jucs_10_07_0751_0768_turner.pdf). He explains that his proposed language would be able to express all "primitive recursive functionals" as seen in System T studied by Godel. He goes on to say that this system is "known to include every recursive function whose totality can be proved in first order logic".

Dose Foetus allow all primitive recursive functionals? If so does it allow functions which are not primitive recursive functionals? Can a citation be provided for the answer to this? (this is not actually necessary as I'm just interested; it's just that some reading marital on the matter would be nice)

Bonus question:
Primitive recursive functionals have a very concise definition in terms of combinators: typed S and K (that can't express the fixed point combinators), zero, the successor function, and the iteration function; that's it. Are there other more general such languages which have such a concise definition and in which all expressions terminate?

**Tags:** lo.logic, computability, functional-programming

> **Comments:**
> **username_1**: On Agda vs Coq: I always read Agda's termination checker to be more advanced and accepts more functions, yours is the first claim to the contrary (this is a good rule of thumb when comparing Agda to Coq, except for Agda's lack of tactics: Agda is more researchy and open to extensions whose stability is less established). Andreas Abel has been working on even more advanced termination checkers based on sized types, see his work on MiniAgda and also [this paper](http://www2.tcs.ifi.lmu.de/~abel/publications.html#icfp13).  
> **username_2**: There is "accept more function definitions" and "have a larger class of computable functions". The two are incomparable. Agda wins on the first count, but Coq clearly wins on the second.  
> **username_0**: I should clarify that I have not used Coq at all and Agda only a little. It seemed that from what little I read Coq was capable of defining a wider class of computable functions but I did not know so I said "I believe that Coq has some similar facilities as well though perhaps more general"; "belive" and "perhaps" were used to convey that I did not know.  

---

## 3 answers

### Answer by username_4 on 2014-01-14. Score: 7 | Accepted answer

Yes, the Foetus checker can typecheck everything in Goedel's T. You can show this by using the checker to show that the iteration operator in T is terminating. For example, the following definition will work:
$$
\begin{array}{lcl}
\mathit{iter}  & : &  A \to (A \to A) \to \mathbb{N} \to A \\
\mathit{iter} \;i \;f \;0 & = & i \\
\mathit{iter} \;i \;f \;(n+1) & = & f\;(\mathit{iter} \;i \;f \;n)  
\end{array}
$$
This is very easy for the Foetus checker (or most any other termination checker) to check, because it is an obviously structurally recursive definition.
Agda and Coq both permit proving termination of functions that go far beyond what is provably total in first-order arithmetic. The feature which enables this is that they permit defining types by recursion on data, which is called "large elimination". (In ZF set theory, the axiom scheme of replacement serves roughly the same purpose.) 
An easy example of something that goes beyond T is the consistency of Goedel's T itself! We can give the syntax as a datatype:
data T : Set where 
   N : T 
   _⇒_ : T → T → T

data Term : T → Set where 
   zero : Term N
   succ : Term (N ⇒ N)
   k    : {A B : T} → Term (A ⇒ B ⇒ A)
   s    : {A B C : T} → Term ((A ⇒ B ⇒ C) ⇒ (A ⇒ B) ⇒ A ⇒ C)
   r    : {A : T} → Term (A ⇒ (A ⇒ A) ⇒ N ⇒ A)
   _·_  : {A B : T} → Term (A ⇒ B) → Term A → Term B

Note that the type dependency permits us to define a datatype of terms containing only the well-typed terms of T. We can then give an interpretation function for the types:
interp-T : T → Set 
interp-T N       = Nat 
interp-T (A ⇒ B) = (interp-T A) → (interp-T B)

This says that N should be the Agda natural numbers, and T's arrow should be interpreted as the Agda function space. This is a "large" elimination, because we define a set by recursion on the structure of the datatype T. 
We can then define an interpretation function, showing that every term of Goedel's T can be interpreted by an Agda term:
interp-term : {A : T} → Term A → interp-T A
interp-term zero    = 0 
interp-term succ    = \n → n + 1
interp-term k       = \x y → x
interp-term s       = \x y z → x z (y z)
interp-term r       = Data.Nat.fold 
interp-term (f · t) = (interp-term f) (interp-term t)

(I don't have Agda on this machine, so there are doubtless some missing imports, fixity declarations, and typos. Fixing that is an exercise for the reader, who can also be an editor, if they like.)
I don't know what the consistency strength of Agda is, but Benjamin Werner has shown that the Calculus of Inductive Constructions (Coq's kernel calculus) is equiconsistent with ZFC plus countably many inaccessible cardinals.

> **Comments:**
> **username_2**: Note that you haven't used large elimination in your example. Large elimination doesn't actually add computational power. Impredicativity does: system F doesn't have the former, but can express functions not expressible in system T.  
> **username_4**: @username_2: The interp-T function computes a set from a term, which looks like a large elimination to me! It is definitely the case that large eliminations add power: Martin-Loef type theory can't even derive inconsistency from 0=1 without a large elimination. (To see this, note that without universes/large eliminations you can erase all dependencies and get a simply typed term: this is what Harper and Pfenning did in their adequacy proof for LF.)  
> **username_2**: I'm sorry: yes the interp-T function does indeed use large elimination. I also agree that proving 0 != 1 does indeed require it. However, *defining computable functions* is not the same thing as *proving mathematical statements*. My answer clarifies this a bit. The pure Calculus of Constructions, for example, cannot prove 0 != 1. It can, however, define the Ackermann function with relative ease.  
> **username_0**: This shows that Agda is more general sense it can write an interpreter for system T but does it does not show weather or not Foetus, a language which is not dependently typed, is more general. Can Foetus do this? Would Agda still be able to do this if not for "large elimination"?  
> **username_4**: Agda's documentation says its termination checker uses the Foetus algorithm. If you took T, and extended it with pattern matching and recursive definitions checked by Foetus, you would not be able to write an interpreter for T in it. In fact, you would not change the functions computable by T at all -- all of the termination orders Foetus computes are provably well-founded in Peano arithmetic. (See username_2's answer.) The Foetus algorithm lets you write more *definitions*, without changing the set of *functions* you can compute. Agda's large eliminations actually increase the set of functions.  
> **username_2**: I'm still not convinced large elimination is the culprit here: Term is secretly of type $\mathrm{Set}_1$ rather than $\mathrm{Set}_0$, and I think this is what you are really using.  
> **username_0**: Neel: perfect! that answers my question! Foetus allows the same set of commutable functions! Thanks! That is exactly what I wanted to know. Also that large elimination expands the set of functions which may be of further use. Thanks!  

---

### Answer by username_2 on 2014-01-14. Score: 3

As means of clarification, I should note that Foetus is developed by [Andreas Abel](http://www2.tcs.ifi.lmu.de/~abel/index.html), who also developed the [original termination checker for Agda](http://www2.tcs.ifi.lmu.de/~abel/diplomathesis.pdf), and worked on [more advanced termination techniques](http://www2.tcs.ifi.lmu.de/~abel/publications.html#diss) since.

The answer to your question might be a bit disappointing: the class of functions from $\mathbb{N}$ to $\mathbb{N}$ is **exactly** the functions that can be defined in system $\mathrm{F}$. The reason for this: the aforementioned class is equal to the provably terminating functions in Second Order Arithmetic ($\mathrm{PA}^2$) which in turn is equal to the functions definable in system $\mathrm F$ (see e.g. [Proofs and Types](http://www.paultaylor.eu/stable/Proofs+Types.html), chapter 11). Furthermore, if you remove the polymorphism, then you fall down to functions definable in $\mathrm{PA}$, which happens to coincide with those definable in system $\mathrm{T}$.

Again, the reson for this is that the decrease captured by the "call matrices" is **provably well-founded**, and that proof can be carried out entirely in $\mathrm{PA}$.

However, this doesn't mean that Foetus is not more **useful** than system $\mathrm{T}$! In practice, more complex termination analyses are required to be able to accept certain **presentations** of computable functions. You don't want to have to do a complicated proof in Peano Arithmetic every time you write a unification function, for example. So in this respect, Foetus is very powerful, and allows you to define functions in a way which wouldn't be accepted by either Coq, Agda or any other common proof system.

> **Comments:**
> **username_0**: how can a class of functions which are provably terminating (PA^2) be equivalent to the class of functions in system F which are not provable to terminate as far as I know? Also I don't understand how you are answering me question. Are you saying system T has a larger class of computable functions or are you saying that foetus is? I think there was a leap in your logic that expected I had more background than I actually do. Also the link you provided seems to lead to a bad page that does not render correctly.  
> **username_2**: Functions in system F all terminate. Foetus captures a larger class of computable functions than system T, but "by accident", if you remove polymorphism, then Foetus only captures exactly system T. Can you tell me which link doesn't work for you? (and which browser you are using :)  

---

### Answer by username_3 on 2014-01-14. Score: 1

If by primitive recursive functionals you mean [primitive recursive functions](http://en.wikipedia.org/wiki/Primitive_recursive_function) and you know that Foetus contains the Ackermann function then Foetus does not coincide with the class of p.r. functions as the Ackermann function is not primitive recursive.
This was shown by Ackermann and later a simplified proof was given by Rosza Peter in "[Konstruktion nichtrekursiver Funktionen](http://link.springer.com/article/10.1007%2FBF01472200)" 1935 (unfortunately only in German as far as I know).

If you look for larger classes of recursive functions that are guaranteed to terminate which might coincide with the class of functions captured by Foetus then some other work of Rosza Peter might interest you.

The Ackermann function is contained in the class of multiple recursive functions as defined by Rosza Peter in "[Uber die mehrfache Rekursion](http://link.springer.com/article/10.1007%2FBF01571648)" 1937. Informally, the idea behind multiple recursion is that you can have multiple recursive variables which can change after a recursive step. For example $f(a,b)$ might call $f(a,b-1)$ or $f(a-1,b)$.

Yet a stronger class is given by the concept of transfinite recursion described in "[Zusammenhang der mehrfachen und transfiniten
Rekursion](http://www.jstor.org/discover/10.2307/2268337?uid=3737864&uid=2&uid=4&sid=21103269656597)" by Rosza Peter. For transfinite recursion you have one recursive variable which can call predecessors w.r.t. to a special ordering $<$

For example, you can interpret an integer as a pair of integers and use the ordering
$$ (a,b) < (c,d) \iff ( a < c \wedge b \leq d ) \vee ( a \leq c \wedge b < d )$$
This can be generalized for triples of integers and so on. Peter calls these orderings $\omega^2, \omega^3$ and so on.
You can go one step further and interpret an integer as an arbitrary number of integers. Let $p\_i$ be the $i$-th prime number. Then we can consider $z = p\_1^{n} \cdot p\_2^{x\_1} \cdot p\_3^{x\_2} \cdot \dots$ where $n$ denotes the number of integers encoded in $z$ and the $x\_i$'s contain the resp. value. She denotes an ordering for such a list of integers as $\omega^\omega$ and shows by diagonalization that this kind of recursion is stronger than multiple recursion. However, I'm not sure if there is a syntactical characterization of this class.

[edit] Primitive recursive functions are not the same as primtive recursive functionals as noted in the comment below. Yet I think one could transfer the concept of transfinite recursion to functionals. However, it isn't clear whether it still is more powerful w.r.t. a functional setting.

> **Comments:**
> **username_0**: the class of primitive recursive functionals of finite type is more general than the class of primitive recursive functions. It can express the Ackermann function for instance and can be seen in Godel's system T.  

---

