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 3780.236 msec.}
{preprocessed for plai in 0.0 msec.}
{analyzed by plai using eterms with local-control off in 4.0 msec.}
{preprocessed for plai in 0.0 msec.}
{analyzed by plai using shfr with local-control off in 0.0 msec.}
{preprocessed for nfg in 0.0 msec.}
{analyzed by nfg in 0.0 msec.}
{analysis information stored in 0.0 msec.}
{preprocessed for ub bounds cost analysis in 0.0 msec.}
{ub bounds cost analysis performed in 40.003 msec.}
{ub bounds cost information stored in 0.0 msec.}
{preprocessed for lb bounds cost analysis in 0.0 msec.}
{lb bounds cost analysis performed in 32.002 msec.}
{lb bounds cost information stored in 0.0 msec.}
{written file /tmp/tmppzpHu4/sum-ffb_eterms_shfr_nfg_resources_co.pl}
:- module(_1,[sum/3],[assertions,predefres(res_steps),nativeprops,basicmodes,regtypes]).

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

:- true pred sum(A,B,C)
         : ( term(A), term(B), gnd(C) )
        => ( gnd(A), rt4(B), gnd(C) ).

:- true pred sum(A,B,C)
         : ( mshare([[A],[A,B],[B]]), ground([C]) )
        => ground([A,B,C]).

:- true pred sum(A,B,C)
         : ( term(A), term(B), gnd(C) )
        => ( gnd(A), rt4(B), gnd(C) )
         + ( possibly_fails, not_covered ).

:- true pred sum(A,B,C)
         : ( term(A), term(B), gnd(C) )
        => ( gnd(A), rt4(B), gnd(C), size(lb,A,size(C)), size(lb,B,size(C)), size(lb,C,size(C)) )
         + cost(lb,steps,0).

:- true pred sum(A,B,C)
         : ( term(A), term(B), gnd(C) )
        => ( gnd(A), rt4(B), gnd(C), size(ub,A,size(C)), size(ub,B,size(C)+1), size(ub,C,size(C)) )
         + cost(ub,steps,2*size(C)).

sum(X,0,X).
sum(X,s(Y),s(Z)) :-
        sum(X,Y,Z).


:- regtype rt4/1.

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