title: How to using linear programming to solve the logical constraints
body: <p>I wish to use linear programming to solve the below describe in logic. In the below example, <code>n1, n2, n3, b1, b2, b3</code> are boolean variables. </p>
  
  <p>The objective is to minimize <code>c1</code>.</p>
  
  <p>Below are the constraints:</p>
  
  <p>constraint 1:  <code>(（n1==n2 xor n3） &amp;&amp; c1==2 &amp;&amp; b1 ) || ( (n1== n2  or n3) &amp;&amp; c1==1 &amp;&amp; b2 ) || (( n1 == n2 and n3) 1&amp;&amp; c1==3 &amp;&amp; b3)</code> </p>
  
  <p>constraint 2: <code>n1 &amp;&amp; n2== not n3</code></p>
  
  <p>constraint 3: <code>only one of b1, b2, b3 is true</code></p>
  
  <p>May I know is it possible to encode those logical constraints into integer constraints required by linear programming tools like Gurobi or lpsolve? Or is there any tools that can make use of boolean constraints?</p>
  
  <p>Thanks.</p>