-Q. You claimed that the Ackerman function couldn't be implemented
-using our primitive recursion techniques (such as the techniques that
-allow us to define addition and multiplication). But you haven't
-shown that it is possible to define the Ackerman function using full
-recursion.
-
-A. OK:
-
-<pre>
-A(m,n) =
- | when m == 0 -> n + 1
- | else when n == 0 -> A(m-1,1)
- | else -> A(m-1, A(m,n-1))
-
-let A = Y (\A m n. isZero m (succ n) (isZero n (A (pred m) 1) (A (pred m) (A m (pred n))))) in
-</pre>
-
-For instance,
-
- A 1 2
- = A 0 (A 1 1)
- = A 0 (A 0 (A 1 0))
- = A 0 (A 0 (A 0 1))
- = A 0 (A 0 2)
- = A 0 3
- = 4
-
-A 1 x is to A 0 x as addition is to the successor function;
-A 2 x is to A 1 x as multiplication is to addition;
-A 3 x is to A 2 x as exponentiation is to multiplication---
-so A 4 x is to A 3 x as super-exponentiation is to exponentiation...
-