% From the book % PROLOG PROGRAMMING IN DEPTH % by Michael A. Covington, Donald Nute, and Andre Vellino % (Prentice Hall, 1997). % Copyright 1997 Prentice-Hall, Inc. % For educational use only % File FACTORIA.PL % Given an integer, finds its factorial. factorial(0,1) :- !. factorial(N,FactN) :- N > 0, M is N-1, factorial(M,FactM), FactN is N*FactM.