Boolean variable true iff equation is satisfied in ILP
You can do this by introducing the two inequalities

$$x_1 \le x_2 + M (1-y)$$

and

$$x_1 &gt; x_2 - M y.$$

The former encodes the requirement $y=1 \implies x_1 \le x_2$ (you can see that if $y=1$, then the $M(1-y)$ term disappears; if $y=0$, then $M(1-y)$ becomes something huge and the inequality is automatically satisfied).  The latter encodes the requirement $y=0 \implies x_1 &gt; x_2$ (for similar reasons).  

Hopefully this gives you an idea how to handle other kinds of implications as well, should they arise.  Basically, multiply by something big, and add it/subtract it somewhere.