Skip to content

Instantly share code, notes, and snippets.

@trietptm
Created December 15, 2012 03:49
Show Gist options
  • Save trietptm/4291209 to your computer and use it in GitHub Desktop.
Save trietptm/4291209 to your computer and use it in GitHub Desktop.
Ackermann function (Prolog)
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).
@mwaseronnie
Copy link

Hey Trietptm,
would you render me some assistance with this question?
20190827_124023

@mwaseronnie
Copy link

got it, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment