Predicatesfactorial(integer,integer)
Clausesfactorial(0,1).factorial(N,F):-N>0,N1=N-1,factorial(N1,F1),F=N*F1.
Goalfactorial(4,F).
No comments:
Post a Comment