I\'m having trouble understanding the following factorial program
fact1(0,Result) :- Result is 1. fact1(N,Result) :- N > 0, N1 is N-1, fac
non-tailer recursion :
fact(0,1):-!. fact(X,Y):- Z=X-1, fact(Z,NZ),Y=NZ*X.
tailer recursion:
fact(X,F):- X>=0,fact_aux(X,F,1). fact_aux(0,F,F):-!. fact_aux(X,F,Acc):- NAcc=Acc*X, NX=X-1, fact_aux(NX,F,NAcc).