Display program code

tak.pl : Takeuchi function
The TAK function is devised by I. Takeuchi in 1978 (cf. http://mathworld.wolfram.com/TAKFunction.html):
For integers X, Y, and Z, and a function h, it is
tak(h,X,Y,Z) =
h(X,Y,Z) for X=<Y
tak(h, tak(h,X-1,Y,Z), tak(h,Y-1,Z,X), tak(h,Z-1,X,Y)) for X>Y

How to use:
Calculates the result R of the TAK function for h(X,Y,Z)=Z: tak(X,Y,Z, R).

Program: Change the code, then submit!

Console: Enter query or select example from below, then submit and wait for answer!

Select example query: 

WebCHR help - CHR Website - (c) Copyrights Martin Kaeser Uni Ulm 2007