I have to make a linear constraint for a binary variable in the following way.
We have a set $S=\{0,1,\dots,k\}$ and the binary variable $b$ is defined as:
$$b=\begin{cases} 1 & if\;S=1,\\ 0 & otherwise \end{cases} .$$
I couldn't manage to create the constraints for this relation to hold.