Closed odow closed 5 months ago
Thank you for bringing this to our attention.
Unfortunately, this will take some time to figure out. In my test, the same issue also happens in BARON.jl (we use basically the same way to translate expressions to strings as that package).
Also, I do not think that we are actually responsible for dropping terms.
Using @show
on the expression, as it is given to the solver, I got
c = :(0.0 + x[1] * +() + x[1] * +(1.0 * x[1] * x[1]))
So it seems that MathOptInterface is already dropping that term? Not sure if that is a bug in MathOptInterface or a corner case that is expected, but not covered here and in BARON.jl
Let me take a look
This is a bug in MAiNGO, but it is also a bug in BARON. I'll submit a PR with the fix.
Fixed BARON as well: https://github.com/jump-dev/BARON.jl/pull/81
You should be a bit mindful of the source code in BARON. That part was written in 2019, right near the start of our transition to MathOptInterface. It hadn't had many eyes (or tests) on it over time :smile:
I assume somewhere that you drop zeros from summations, so then you're left with an empty list of arguments.
Reported on https://discourse.julialang.org/t/jump-maingo-no-method-matching/114514