Fri Feb 18 21:28:25 2011 run on win32
load_package redlog;


rlset pasf;


*** turned on switch rlsusi 

{}

off rlverbose;



% Information Flow Control
sec := (a < b and cong(a+b,0,2) and 2*n = a+b and
      (a < b and b-a = n or a >= b and a-b = n)) or
   (a < b and ncong(a+b,0,2) and 2*n = a+b+1 and
      (a < b and b-a = n or a >= b and a-b = n))$



rlqe rlex sec;


true


rlqea rlex sec;


{{true,{n = 1,b = 1,a = 0}},

 {true,{n = 2,b = 3,a = 1}}}


rlqe ex(n,sec);


(3*a - b + 1 = 0 and a + b #2# 0 and a - b < 0)

 or (3*a - b = 0 and a + b ~2~ 0 and a - b < 0)


% Information Flow Control, Nonlinear Variant
phi := ex(n,
   (a < b and cong(a+b,0,2) and 2*n = a+b and
      ((a<b and b-a=n^2) or (a >= b and a-b = n^2))) or
   (a < b and ncong(a+b,0,2) and 2*n = a+b+1 and
      ((a < b and b-a = n^2) or (a >= b and a-b = n^2))))$



rlwqe phi;


             2            2                2            2
bex g19 [ - a  + 2*a*b - b  - 2 <= g19 <= a  - 2*a*b + b  + 2] (a - b < 0

                2
 and a - b + g19  = 0 and a + b #2# 0 and a + b - 2*g19 + 1 = 0) or bex g18 [

    2            2                2            2
 - a  + 2*a*b - b  - 2 <= g18 <= a  - 2*a*b + b  + 2] (a - b < 0

                2
 and a - b + g18  = 0 and a + b ~2~ 0 and a + b - 2*g18 = 0)


% Integer Roots
phi := ex(x,x^5-3x^2+1 = 0 and 3x >= 1 and x <= 3)$



rlwqe phi;


false


% Integer Roots of Generic Polynomial
phi := ex(x,a*x^2+b*x+c=0)$



rlwqe phi;


             2    2                2    2            2
bex g20 [ - b  - c  - 2 <= g20 <= b  + c  + 2] (a*g20  + b*g20 + c = 0)


% Feasibility of Parametric Integer Constraints
las := ex(x,a*x>=b and c*x<=d)$



rlwqe las;


bex g22 [ - abs(a) <= g22 <= abs(a)] (

((a*d - b*c - c*g22 >= 0 and a > 0) or (a*d - b*c - c*g22 <= 0 and a < 0))

 and ((a > 0 and g22 >= 0) or (a < 0 and g22 <= 0)) and b + g22 ~a~ 0 and a <> 0

) or bex g22 [ - abs(c) <= g22 <= abs(c)] (

((c > 0 and g22 <= 0) or (c < 0 and g22 >= 0))

 and ((a*d + a*g22 - b*c >= 0 and c > 0) or (a*d + a*g22 - b*c <= 0 and c < 0))

 and d + g22 ~c~ 0 and c <> 0) or (b <= 0 and d >= 0)


procedure t1(m);
   rlsimpl ex(for i:=1:m collect mkid(x,i),
      (for i:=1:m sum mkid(x,i))=a and
      for i:=1:m mkand mkid(x,i)>=0);


t1


procedure t2(m);
   rlsimpl ex(for i:=1:m join for j:=1:m collect mkid(mkid(x,i),j),
      for i:=1:m mkand (for j:=1:m sum mkid(mkid(x,i),j))=mkid(a,i) and
      for j:=1:m mkand (for i:=1:m sum mkid(mkid(x,i),j))=mkid(b,j) and
      for i:=1:m mkand for j:=1:m mkand mkid(mkid(x,i),j)>=0);


t2


% We compute $T_{1,8}$. In the literature we have treated instances
% with in the range t1(5), ..., t1(11):

f:=t1(5)$

 s:=rlwqe f$

 rlatnum s;


192
 rlexpand s$

 ws;


a >= 0


% We compute $T_{2,2}$. In the literature we have treated instances with
% in the range t1(1), ..., t1(3):

f:=t2(2)$

 s:=rlwqe f$

 rlatnum s;


24
 rlexpand s$

 ws;


(a1 + a2 - b1 - b2 = 0 and a2 - b2 <= 0 and a2 >= 0 and b1 >= 0)

 or (a1 + a2 - b1 - b2 = 0 and a2 - b2 - 1 <= 0 and a2 > 0 and b1 > 0)

 or (a1 + a2 - b1 - b2 = 0 and a2 - b1 - b2 <= 0 and a2 - b2 >= 0 and b2 >= 0)

 or (a1 + a2 - b1 - b2 = 0 and a2 - b1 - b2 < 0 and a2 - b2 + 1 >= 0 and b2 > 0)

 or (a1 + a2 - b1 - b2 = 0 and a2 - b1 - b2 < 0 and a2 - b1 + 1 >= 0 and b1 > 0)

 or (a1 + a2 - b1 - b2 = 0 and a2 - b1 - b2 <= 0 and a2 - b1 >= 0 and b1 >= 0)

 or (a1 + a2 - b1 - b2 = 0 and a2 - b1 - 1 <= 0 and a2 > 0 and b2 > 0)

 or (a1 + a2 - b1 - b2 = 0 and a2 - b1 <= 0 and a2 >= 0 and b2 >= 0)


% Dependency Analysis for Automatic Parallelization
dep := ex({ii,j,ip,jp},0<=ii<=m and 0<=j<=m and 0<=ip<=m and 0<=jp<=m and
(ii<>ip or j<>jp) and ii+j<>ip+jp and n*ii+j=n*ip+jp)$



depsol := rlwqe dep$


rlatnum depsol;


11031


rlexpand rlsimpl sub(m=4,n=4,depsol);


true


rlqe sub(m=4,n=4,dep);


true


rlqe sub(m=4,n=5,dep);


false


% Parametric Linear Optimization Problem with Univariately Nonlinear
% Constraints
f := ex({x,y},x+y <= z and x >= 0 and y >= 0 and x+y >= 0 and x^2-a >= 0);


f := ex x ex y (x + y - z <= 0 and x >= 0 and y >= 0 and x + y >= 0

             2
 and  - a + x  >= 0)


sol := rlwqe f$


rlatnum sol;


103

rlexpand sub(a=10,sol);


z - 3 > 0


end;


Time for test: 5195 ms, plus GC time: 626 ms
@@@@@ Resources used: (6 107 7 0)
