Integer Linear programming formulation if then condition
you can introduce a binary variable z verifying the following constraints :


(A-1) &lt;= 12*z
z&lt;= 0.5*A  
-(1-z)*12 &lt;= B-A &lt;= (1-z)*12
-12*z &lt;= B &lt;= 12*z