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 3784.237 msec.}
{preprocessed for plai in 0.0 msec.}
{analyzed by plai using eterms with local-control off in 8.001 msec.}
{preprocessed for plai in 0.0 msec.}
{analyzed by plai using shfr with local-control off in 4.0 msec.}
{preprocessed for nfg in 4.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 108.007 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 76.004 msec.}
{lb bounds cost information stored in 0.0 msec.}
{written file /tmp/tmpOf6iKT/maximum-ffb_eterms_shfr_nfg_resources_co.pl}
:- module(_1,[max/3],[assertions,predefres(res_steps),nativeprops,basicmodes,regtypes]).

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

:- true pred max(A,B,C)
         : ( term(A), term(B), gnd(C) )
        => ( rt17(A), gnd(B), gnd(C) ).

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

:- true pred max(A,B,C)
         : ( term(A), term(B), gnd(C) )
        => ( rt17(A), gnd(B), gnd(C) )
         + ( possibly_fails, covered ).

:- true pred max(A,B,C)
         : ( term(A), term(B), gnd(C) )
        => ( rt17(A), gnd(B), gnd(C), size(lb,A,size(C)), size(lb,B,size(C)), size(lb,C,size(C)) )
         + cost(lb,steps,1).

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

max(X,Y,X) :-
        less(Y,X).
max(X,Y,Y) :-
        less(X,s(Y)).

:- true pred less(_1,_2)
         : ( term(_1), gnd(_2) )
        => ( rt8(_1), rt6(_2) ).

:- true pred less(_1,_2)
         : ( mshare([[_1]]), ground([_2]) )
        => ground([_1,_2]).

:- true pred less(_1,_2)
         : ( term(_1), gnd(_2) )
        => ( rt8(_1), rt6(_2) )
         + ( possibly_fails, not_covered ).

:- true pred less(_1,_2)
         : ( term(_1), gnd(_2) )
        => ( rt8(_1), rt6(_2), size(lb,_1,size(_2)), size(lb,_2,size(_2)) )
         + cost(lb,steps,0).

:- true pred less(_1,_2)
         : ( term(_1), gnd(_2) )
        => ( rt8(_1), rt6(_2), size(ub,_1,size(_2)+1), size(ub,_2,size(_2)) )
         + cost(ub,steps,2*size(_2)).

less(0,s(_1)).
less(s(X),s(Y)) :-
        less(X,Y).


:- regtype rt8/1.

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


:- regtype rt7/1.

rt7(A) :-
        gnd(A).


:- regtype rt6/1.

rt6(s(A)) :-
        rt7(A).


:- regtype rt17/1.

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