title: How to add if(A and B) then C constraints in Gurobi
body: <p>Now I have three 5 by 3 matrix, X, Y, Z. All elements in them are binary variables. I want to add the following constraints:</p>
  
  <p><a href="https://i.stack.imgur.com/ITD7c.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ITD7c.gif" alt="enter image description here"></a></p>
  
  <p>I know I should introduce an auxiliary binary variable here. But I really stuck in how to write these simple conditional equalities as linear constraints. Any advice, tricks, suggestions?</p>
  
  <p>Many thanks in advance!  </p>