I have a nonlinear optimization problem of the form :
$$ \begin{align} & \underset{ \mathbf{x} }{ \text{ maximize } } & & f(\mathbf{x}) \\ & \text{ subject to } & & g(\mathbf{x}) \leqslant 0,\\ & & & x_{ i } \in \{ 0,\cdots,r \}. \forall i \end{align} $$
where $g(\mathbf{x})$ is a nonlinear function. I did the transfomation $x_i=\log y_i$ and make the problem a linear programming problem as:
$$ \begin{align} & \underset{ \mathbf{y} }{ \text{ maximize } } & & f(\mathbf{y}) \\ & \text{ subject to } & & g(\mathbf{y}) \leqslant 0,\\ & & & y_{ i } \in \{ 1,,\cdots,e^r \}. \forall i \end{align} $$
How to model this problem in a solver ? Specifically, how to write the constraint $y_{ i } \in \{ 1,,\cdots,e^r \}$ in a solver ?