I'm reading Recursive Functions at Stanford Encyclopedia of Philosophy (section 1.4). The following paragraph defines function β which is then used to define variant of Ackermann-Péter function:
What exactly is the type of Iter? The base case Iter(ϕ, 0) suggests it's (N → N) → N → (N → N), but the inductive step has type (N → N) → N → N.
Assuming it's the former and Iter just composes ϕ with itself, the next paragraph doesn't make sense to me because Iter should have return type N → N, while β should be N → (N → N), so you cannot compose β with itself.
What am I misunderstanding? Thanks.
Update: I've checked the Wikipedia's article on Ackermann function and it turns out that the correct defintion is as follows:
$$β(0) = S$$ $$β(x + 1) = Iter(β(x))$$
where:
$$Iter(ϕ)(0) = ϕ(1)$$ $$Iter(ϕ)(x + 1) = ϕ(Iter(ϕ)(n))$$
