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/tmpqrDzEk/query.pl
}
{loaded in 3392.212 msec.}
{preprocessed for plai in 0.0 msec.}
{analyzed by plai using eterms with local-control off in 92.005 msec.}
{preprocessed for plai in 0.0 msec.}
{analyzed by plai using shfr with local-control off in 8.0 msec.}
{preprocessed for nfg in 152.009 msec.}
{analyzed by nfg in 188.012 msec.}
{analysis information stored in 0.0 msec.}
{NOTE (infercost): Using non-parametric cost analysis}
{preprocessed for lower bounds cost analysis in 4.0 msec.}
{lower bounds cost analysis performed in 8.001 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 8.0 msec.}
{upper bounds cost information stored in 0.0 msec.}
{written file /tmp/tmpqrDzEk/query_eterms_shfr_nfg_steps_ualb_co.pl}
:- module(_1,[query/1],[assertions,regtypes,nativeprops]).

:- entry query(A)
         : ground(A).

:- true pred query(A)
         : gnd(A)
        => rt196(A).

:- true pred query(A)
         : ground([A])
        => ground([A]).

:- true pred query(A)
         : gnd(A)
        => rt196(A)
         + ( possibly_fails, not_covered ).

:- true pred query(A)
         : gnd(A)
        => ( rt196(A), size_lb(A,length(A)), size_ub(A,length(A)) )
         + ( steps_lb(0), steps_ub(7) ).

query([C1,D1,C2,D2]) :-
        density(C1,D1),
        density(C2,D2),
        D1>D2,
        T1 is 20*D1,
        T2 is 21*D2,
        T1 ( rt96(C), num(D) ).

:- true pred density(C,D)
         : ground([C,D])
        => ground([C,D]).

:- true pred density(C,D)
         : ( gnd(C), gnd(D) )
        => ( rt96(C), num(D) )
         + ( possibly_fails, covered ).

:- true pred density(C,D)
         : ( gnd(C), gnd(D) )
        => ( rt96(C), num(D), size_lb(C,size(C)), size_lb(D,int(D)), size_ub(C,size(C)), size_ub(D,int(D)) )
         + ( steps_lb(1), steps_ub(3) ).

density(C,D) :-
        pop(C,P),
        area(C,A),
        D is P*100/A.

:- true pred pop(_1,_2)
         : ( gnd(_1), term(_2) )
        => ( rt96(_1), rt97(_2) ).

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

:- true pred pop(_1,_2)
         : ( gnd(_1), var(_2) )
        => ( rt96(_1), rt97(_2) )
         + ( possibly_fails, not_covered ).

:- true pred pop(_1,_2)
         : ( gnd(_1), var(_2) )
        => ( rt96(_1), rt97(_2), size_lb(_1,size(_1)), size_lb(_2,251), size_ub(_1,size(_1)), size_ub(_2,8250) )
         + ( steps_lb(0), steps_ub(1) ).

pop(china,8250).
pop(india,5863).
pop(ussr,2521).
pop(usa,2119).
pop(indonesia,1276).
pop(japan,1097).
pop(brazil,1042).
pop(bangladesh,750).
pop(pakistan,682).
pop(w_germany,620).
pop(nigeria,613).
pop(mexico,581).
pop(uk,559).
pop(italy,554).
pop(france,525).
pop(phillipines,415).
pop(thailand,410).
pop(turkey,383).
pop(egypt,364).
pop(spain,352).
pop(poland,337).
pop(s_korea,335).
pop(iran,320).
pop(ethiopia,272).
pop(argentina,251).

:- true pred area(_1,_2)
         : ( rt96(_1), term(_2) )
        => ( rt96(_1), rt195(_2) ).

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

:- true pred area(_1,_2)
         : ( rt96(_1), var(_2) )
        => ( rt96(_1), rt195(_2) )
         + ( not_fails, covered ).

:- true pred area(_1,_2)
         : ( rt96(_1), var(_2) )
        => ( rt96(_1), rt195(_2), size_lb(_1,size(_1)), size_lb(_2,37), size_ub(_1,size(_1)), size_ub(_2,8708) )
         + ( steps_lb(1), steps_ub(1) ).

area(china,3380).
area(india,1139).
area(ussr,8708).
area(usa,3609).
area(indonesia,570).
area(japan,148).
area(brazil,3288).
area(bangladesh,55).
area(pakistan,311).
area(w_germany,96).
area(nigeria,373).
area(mexico,764).
area(uk,86).
area(italy,116).
area(france,213).
area(phillipines,90).
area(thailand,200).
area(turkey,296).
area(egypt,386).
area(spain,190).
area(poland,121).
area(s_korea,37).
area(iran,628).
area(ethiopia,350).
area(argentina,1080).


:- regtype rt96/1.

rt96(argentina).
rt96(bangladesh).
rt96(brazil).
rt96(china).
rt96(egypt).
rt96(ethiopia).
rt96(france).
rt96(india).
rt96(indonesia).
rt96(iran).
rt96(italy).
rt96(japan).
rt96(mexico).
rt96(nigeria).
rt96(pakistan).
rt96(phillipines).
rt96(poland).
rt96(s_korea).
rt96(spain).
rt96(thailand).
rt96(turkey).
rt96(uk).
rt96(usa).
rt96(ussr).
rt96(w_germany).


:- regtype rt195/1.

rt195(37).
rt195(55).
rt195(86).
rt195(90).
rt195(96).
rt195(116).
rt195(121).
rt195(148).
rt195(190).
rt195(200).
rt195(213).
rt195(296).
rt195(311).
rt195(350).
rt195(373).
rt195(386).
rt195(570).
rt195(628).
rt195(764).
rt195(1080).
rt195(1139).
rt195(3288).
rt195(3380).
rt195(3609).
rt195(8708).


:- regtype rt97/1.

rt97(251).
rt97(272).
rt97(320).
rt97(335).
rt97(337).
rt97(352).
rt97(364).
rt97(383).
rt97(410).
rt97(415).
rt97(525).
rt97(554).
rt97(559).
rt97(581).
rt97(613).
rt97(620).
rt97(682).
rt97(750).
rt97(1042).
rt97(1097).
rt97(1276).
rt97(2119).
rt97(2521).
rt97(5863).
rt97(8250).


:- regtype rt196/1.

rt196([A,B,C,D]) :-
        rt96(A),
        num(B),
        rt96(C),
        num(D).