Search NKS | Online
1 - 1 of 1 for Slot
Primitive recursive functions are defined to deal with non-negative integers and to be set up by combining the basic functions z = 0 & (zero), s = # + 1 & (successor) and p[i_] := Slot[i] & (projection) using the operations of composition and primitive recursion
f[0, y___Integer] := g[y]
f[x_Integer, y___Integer] := h[f[x - 1, y], x - 1, y]
Plus and Times can then for example be defined as
plus[0, y_] = y; plus[x_, y_] := s[plus[x - 1, y]]
times[0, y_] = 0; times[x_, y_] := plus[times[x - 1, y], y]
Most familiar integer mathematical functions also turn out to be primitive recursive—examples being Power , Mod , Binomial , GCD and Prime .