% base case fact(0, 1). % we specify the form of the answer only fact(N, R) :- fact(N1, R1), N is N1 + 1, R is R1*N.