Created
December 15, 2012 03:49
-
-
Save trietptm/4291209 to your computer and use it in GitHub Desktop.
Ackermann function (Prolog)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ackermann(0,N,X) :- X is N+1. | |
ackermann(M, 0, X) :- M>0, M1 is M-1, ackermann(M1, 1, X). | |
ackermann(M, N, X) :- M>0, N>0, M1 is M-1, N1 is N-1, ackermann(M, N1, X1), ackermann(M1, X1, X). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey Trietptm,
would you render me some assistance with this question?