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/tmpXocM1W/query.pl
}
{loaded in 3804.238 msec.}
{preprocessed for plai in 0.0 msec.}
{analyzed by plai using eterms with local-control off in 92.006 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 148.01 msec.}
{analyzed by nfg in 184.01 msec.}
{analysis information stored in 0.0 msec.}
{preprocessed for ub bounds cost analysis in 0.0 msec.}
{ub bounds cost analysis performed in 328.021 msec.}
{ub bounds cost information stored in 4.0 msec.}
{preprocessed for lb bounds cost analysis in 0.0 msec.}
{lb bounds cost analysis performed in 188.012 msec.}
{lb bounds cost information stored in 0.0 msec.}
{written file /tmp/tmpXocM1W/query_eterms_shfr_nfg_resources_co.pl}
:- module(_1,[query/1],[assertions,predefres(res_steps),nativeprops,basicmodes,regtypes]).

:- 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)) )
         + cost(lb,steps,0).

:- true pred query(A)
         : gnd(A)
        => ( rt196(A), size(ub,A,length(A)) )
         + cost(ub,steps,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)) )
         + cost(lb,steps,1).

:- true pred density(C,D)
         : ( gnd(C), gnd(D) )
        => ( rt96(C), num(D), size(ub,C,size(C)), size(ub,D,int(D)) )
         + cost(ub,steps,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)
         : ( 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) )
         + cost(lb,steps,0).

:- true pred pop(_1,_2)
         : ( gnd(_1), var(_2) )
        => ( rt96(_1), rt97(_2), size(ub,_1,size(_1)), size(ub,_2,8250) )
         + cost(ub,steps,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)
         : ( 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) )
         + cost(lb,steps,1).

:- true pred area(_1,_2)
         : ( rt96(_1), var(_2) )
        => ( rt96(_1), rt195(_2), size(ub,_1,size(_1)), size(ub,_2,8708) )
         + cost(ub,steps,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).