ConstraintSolver.jl icon indicating copy to clipboard operation
ConstraintSolver.jl copied to clipboard

More complex constraints in RHS of an indicator / reification

Open hakank opened this issue 3 years ago • 2 comments

It would be great to be able to write more complex expressions, such as indicators and reifications in the RHS of an indicator / reification. For example (from http://hakank.org/julia/constraints/monks_and_doors.jl )

@constraint(model, m7 := { m3 => m6})  

@constraint(model, m8 := { (m7 == 1 && m8 == 1) => m1==1 )  

hakank avatar Feb 12 '21 19:02 hakank

The first version can work by changing it to:

@constraint(model, m7 := { m3 => {m6 == 1}})  

which isn't implemented yet but would be easy. It's probably hard to have

@constraint(model, m7 := { m3 => {m6 > 1}})

that working at the moment as > is not implemented directly and I'm not sure yet how to best allow this inside an indicator constraint which is also inside of a reified constraint. I might go for implementing it though such that m6 > 1 fails and m6 == 1 works first.

Wikunia avatar Feb 12 '21 20:02 Wikunia

The first is now implemented. Will check what I can do to support a different lhs of a reified or indicator constraint. Also support for > or >= is still not implemented.

Wikunia avatar Jul 19 '21 21:07 Wikunia