Skip to content

parse_one_operator_constraint: clash with parse_ternary_constraint when there are four arguments #2246

@dourouc05

Description

@dourouc05

Following #2051, there is a new parse_one_operator_constraint extension point in JuMP. However, it is not called in a very specific situation: when the constraint looks like binpacking(a, b, c, d), i.e. when there is just a function call and four arguments. For instance, the current implementation works correctly with binpacking(a, b, collect(1:10), d).

In that case, JuMP jumps to parse_ternary_constraint(_error, vectorized, :binpacking, Val(a), b, Val(c), d). As neither a nor b are inequality signs, it directly generates an error.

I only found a hacky solution for this: in parse_ternary_constraint, intercept all error calls, ensure that there is no parse_one_operator_constraint to call. JuliaConstraints/JuCP.jl@acb90e3

An example to trigger this error: JuliaConstraints/JuCP.jl@acb90e3#diff-fce720c43af3c52c862fd7451c7374b8R312-R327

I hope someone has more imagination that I do to fix this!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions