%% fact fa(0,1) . fa(N,X) :- N1 is N -1 , fa(N1,X1),X is X1 * N .