/* Find a lower bound of the boolean program:
 *   min  sum(x)
 *   sjt  Ax+b > 0
 *        x = {-1,1}
 *
 * This sdpsol source file finds a bound using Shor's second relaxation
 * See: 
 *   N. Z. Shor, "Quadratic Optimization Problems", Soviet Journal of
 *   Computers and System Science, 1987, Vol. 25, No. 6, pp 1-11
 */

include("boolean.mat");  /* load A,b,preLambda */
p=rows(A);               /* row size of A */
k=cols(A);               /* column size of A */

variable t,nu(k,1),tau(p,1),lambda(p*p,1);

c=ones(k,1);
Lambda = reshape(preLambda*lambda,k+1,k+1);

[diag(nu),       .5*(c-A'*tau);
 .5*(c-A'*tau)', -t-sum(nu)-tau'*b] + Lambda > 0;
   tau .> 0;
lambda .> 0;

maximize obj = t;
