Skip to content

Instantly share code, notes, and snippets.

View Geobm's full-sized avatar
🎯
Focusing

Geovani Benita Geobm

🎯
Focusing
  • Singapore University of Technology and Design
  • Singapore
  • X @GeovaniBenita
View GitHub Profile
@trietptm
trietptm / gist:4291209
Created December 15, 2012 03:49
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).