I am confronted with the problem of writing conditional constraints in a binary integer programming problem. Let us consider a typical knapsack problem. The constraint is that if items $1$ and $2$ are chosen then item $3$ must also be chosen. Let $x_1,x_2,x_3$ be the corresponding binary decision variables. Can I write $x_1+x_2-x_3<2$ for this constraint? Am I doing it correctly?
There is another constraint as well which says that if items $4$ and $5$ are chosen then items $6$ and $7$ must not be chosen. I feel myself unable to write this constraint. Please help me as to how to proceed.