Ciao Preprocessor (integrated Alpha version)
| This is an alpha distribution, meant only for testing. Please do let us
| know at ciaopp-bugclip.dia.fi.upm.es any problems you may have.
{Reading /tmp/tmpd_piBF/nat.pl
}
{loaded in 3396.213 msec.}
{preprocessed for plai in 0.0 msec.}
{analyzed by plai using det with local-control off in 16.001 msec.}
{written file /tmp/tmpd_piBF/nat_det_co.pl}
:- module(_1,[factorial/2],[assertions]).
isNat(s(X)) :-
isNat(X).
isNat(0).
notEq(s(X),s(Y)) :-
notEq(X,Y).
notEq(s(X),0).
notEq(0,s(X)).
lt(s(X),s(Y)) :-
lt(X,Y).
lt(0,s(Y)).
gt(s(X),s(Y)) :-
gt(X,Y).
gt(s(X),0).
le(s(X),s(Y)) :-
le(X,Y).
le(0,s(Y)).
le(0,0).
even(s(X)) :-
odd(X).
even(0).
odd(s(X)) :-
even(X).
odd(s(0)).
:- true pred add(_1,Y,X)
: ( native_props:mshare([[X]]), ground([_1,Y]), rt29(_1), rt31(Y), term(X) )
=> ( ground([_1,Y,X]), rt42(_1), rt33(Y), rt43(X) )
+ ( is_det, mut_exclusive ).
:- true pred add(_1,Y,X)
: ( native_props:mshare([[X]]), ground([_1,Y]), rt35(_1), rt33(Y), term(X) )
=> ( ground([_1,Y,X]), rt40(_1), rt33(Y), rt33(X) )
+ ( is_det, mut_exclusive ).
:- true pred add(_1,Y,X)
: ( native_props:mshare([[X]]), var(X), ground([_1,Y]), rt3(_1), rt5(Y), term(X) )
=> ( ground([_1,Y,X]), rt8(_1), rt5(Y), rt9(X) )
+ ( is_det, mut_exclusive ).
:- true pred add(_1,Y,X)
: ( native_props:mshare([[X]]), var(X), ground([_1,Y]), rt6(_1), rt5(Y), term(X) )
=> ( ground([_1,Y,X]), rt7(_1), rt5(Y), rt5(X) )
+ ( is_det, mut_exclusive ).
add(s(X),Y,s(Z)) :-
add(X,Y,Z).
add(0,X,X).
:- true pred mult(s(_1),Y,R)
: ( native_props:mshare([[R]]), ground([Y,_1]), rt9(Y), term(R), rt14(_1) )
=> ( ground([Y,R,_1]), rt42(Y), rt43(R), rt25(_1) )
+ ( is_det, mut_exclusive ).
:- true pred mult(_1,Y,R)
: ( native_props:mshare([[R]]), var(R), ground([_1,Y]), rt16(_1), rt9(Y), term(R) )
=> ( ground([_1,Y,R]), rt25(_1), rt23(Y), rt27(R) )
+ ( is_det, mut_exclusive ).
:- true pred mult(s(_1),Y,R)
: ( native_props:mshare([[R]]), var(R), ground([Y,_1]), rt3(Y), term(R), rt2(_1) )
=> ( ground([Y,R,_1]), rt8(Y), rt9(R), rt4(_1) )
+ ( is_det, mut_exclusive ).
:- true pred mult(_1,Y,R)
: ( native_props:mshare([[R]]), var(R), ground([_1,Y]), rt2(_1), rt3(Y), term(R) )
=> ( ground([_1,Y,R]), rt4(_1), rt3(Y), rt5(R) )
+ ( is_det, mut_exclusive ).
mult(s(X),Y,R) :-
mult(X,Y,Z),
add(Y,Z,R).
mult(0,Y,0).
:- entry factorial(A,B)
: ground(A).
:- true pred factorial(A,B)
: ( native_props:mshare([[B]]), ground([A]), gnd(A), term(B) )
=> ( ground([A,B]), rt46(A), rt49(B) )
+ ( is_det, mut_exclusive ).
:- true pred factorial(A,B)
: ( native_props:mshare([[B]]), var(B), ground([A]), gnd(A), term(B) )
=> ( ground([A,B]), rt12(A), rt9(B) )
+ ( is_det, mut_exclusive ).
factorial(s(X),R) :-
factorial(X,Y),
mult(s(X),Y,R).
factorial(0,s(0)).
:- regtype rt48/1.
rt48(0).
rt48(s(A)) :-
rt48(A).
:- regtype rt47/1.
rt47(0).
rt47(s(A)) :-
rt48(A).
:- regtype rt46/1.
rt46(0).
rt46(s(A)) :-
rt47(A).
:- regtype rt50/1.
rt50(0).
rt50(s(A)) :-
rt50(A).
:- regtype rt49/1.
rt49(s(A)) :-
rt50(A).
:- regtype rt9/1.
rt9(s(A)) :-
rt5(A).
:- regtype rt15/1.
rt15(0).
rt15(s(A)) :-
rt15(A).
:- regtype rt14/1.
rt14(0).
rt14(s(A)) :-
rt15(A).
:- regtype rt42/1.
rt42(s(A)) :-
rt40(A).
:- regtype rt43/1.
rt43(s(A)) :-
rt33(A).
:- regtype rt26/1.
rt26(0).
rt26(s(A)) :-
rt26(A).
:- regtype rt25/1.
rt25(0).
rt25(s(A)) :-
rt26(A).
:- regtype rt30/1.
rt30(0).
rt30(s(A)) :-
rt30(A).
:- regtype rt29/1.
rt29(s(A)) :-
rt30(A).
:- regtype rt32/1.
rt32(0).
rt32(s(A)) :-
rt32(A).
:- regtype rt31/1.
rt31(0).
rt31(s(A)) :-
rt32(A).
:- regtype rt34/1.
rt34(0).
rt34(s(A)) :-
rt34(A).
:- regtype rt33/1.
rt33(0).
rt33(s(A)) :-
rt34(A).
:- regtype rt35/1.
rt35(0).
rt35(s(A)) :-
rt35(A).
:- regtype rt41/1.
rt41(0).
rt41(s(A)) :-
rt41(A).
:- regtype rt40/1.
rt40(0).
rt40(s(A)) :-
rt41(A).
:- regtype rt17/1.
rt17(0).
rt17(s(A)) :-
rt17(A).
:- regtype rt16/1.
rt16(0).
rt16(s(A)) :-
rt17(A).
:- regtype rt24/1.
rt24(0).
rt24(s(A)) :-
rt24(A).
:- regtype rt23/1.
rt23(s(A)) :-
rt24(A).
:- regtype rt28/1.
rt28(0).
rt28(s(A)) :-
rt28(A).
:- regtype rt27/1.
rt27(0).
rt27(s(A)) :-
rt28(A).
:- regtype rt3/1.
rt3(s(0)).
:- regtype rt5/1.
rt5(0).
:- regtype rt8/1.
rt8(s(A)) :-
rt7(A).
:- regtype rt13/1.
rt13(0).
rt13(s(A)) :-
rt13(A).
:- regtype rt12/1.
rt12(0).
rt12(s(A)) :-
rt13(A).
:- regtype rt2/1.
rt2(0).
:- regtype rt4/1.
rt4(0).
:- regtype rt6/1.
rt6(0).
:- regtype rt7/1.
rt7(0).