Skip to content

Redefining constraints with outlined result variables reverses their context #260

@glebbelov

Description

@glebbelov

Example: xy <= 4 can be redefined into a quadratic functional constraint z ~ xy, z<=4. Both z and x*y are in negative context.

z ~ xy can be outlined into a static constraint z >= xy, but here z is in CTX+! Then, e.g., linearizing z >= xy (e.g., x is binary) and propagating context, we get a contradiction, because z ~ xy has already been redefined into z >= x*y with z in CTX-.

Another example (nlmodels/chemeq.mod for a pure-linear solver): assume a quadratic expression is first stored as QuadratricFunctionalConstraint, in CTX_POS. Then it is redefined as res_var <= <expr>. Then assume it is linearized (see mul.h) and the resulting linear constraint is added as AddConstraint_AS_ROOT, propagating context into arguments. Then res_var receives CTX_NEG.

In this example it is possible to skip propagation after linearization, as we don't get any new arguments in the linearized constraint. However it is to check if we ever add new expression arguments tp a redefined functional constraint. Then, probably we need to propagate into the new expressions manually. Yet another example: nlmodels/weapon.mod for MILP/MIQP solver.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions