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 3428.214 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 4.0 msec.}
{analysis information stored in 0.0 msec.}
{NOTE (infercost): Using non-parametric cost analysis}
{preprocessed for lower bounds cost analysis in 0.0 msec.}
{lower bounds cost analysis performed in 4.0 msec.}
{lower bounds cost information stored in 0.0 msec.}
{preprocessed for upper bounds cost analysis in 4.0 msec.}
{upper bounds cost analysis performed in 4.001 msec.}
{upper bounds cost information stored in 0.0 msec.}
{written file /tmp/tmppW5vH9/maximum-ffb_eterms_shfr_nfg_steps_ualb_co.pl}
:- module(_1,[max/3],[assertions,regtypes,nativeprops]).

:- 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)
         : ( native_props: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)), size_ub(A,size(C)+2), size_ub(B,size(C)+1), size_ub(C,size(C)) )
         + ( steps_lb(1), steps_ub(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)
         : ( native_props: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)), size_ub(_1,size(_2)+1), size_ub(_2,size(_2)) )
         + ( steps_lb(0), steps_ub(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).