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.

{loaded in 3400.213 msec.}
{preprocessed for plai in 0.0 msec.}
{analyzed by plai using det with local-control off in 4.0 msec.}
{written file /tmp/tmpGptlYG/pplus_det_co.pl}
:- module(_1,[plus/3],[assertions]).

:- true pred p(s(_1),X)
         : ( native_props:mshare([[X]]), var(X), ground([_1]), term(X), gnd(_1) )
        => ( ground([X,_1]), gnd(X), gnd(_1) )
         + ( is_det, mut_exclusive ).

p(s(X),X).

:- entry plus(A,B,C)
         : ground(A).

:- true pred plus(A,B,C)
         : ( native_props:mshare([[B],[B,C],[C]]), ground([A]), gnd(A), term(B), term(C) )
        => ( native_props:mshare([[B,C]]), ground([A]), rt4(A), term(B), term(C) )
         + ( is_det, mut_exclusive ).

plus(0,Y,Y).
plus(s(X),Y,s(Z)) :-
        p(s(X),U),
        plus(U,Y,Z).


:- regtype rt5/1.

rt5(0).
rt5(A) :-
        gnd(A).
rt5(s(A)) :-
        rt5(A).


:- regtype rt4/1.

rt4(0).
rt4(s(A)) :-
        rt5(A).