:- module(_, [fac/2], [assertions,regtypes,nativeprops]).

:- entry fac(X,Y) : num * term.
:- pred fac(X,Y) : num * term.

fac(X, Y) :-
	fac_(X, Y).

:- pred fac_(X,Y) : num * term => num * num.
fac_(0, 1) :- !.
fac_(X, Y) :-
	% X > 0,
        X0 is X - 1,
        fac_(X0, Y0),
        Y is X * Y0.
