IntervalConstraintProgramming.jl
IntervalConstraintProgramming.jl copied to clipboard
`integerize` contractor and integer solutions
Great idea!
As I mentioned in an email, you can either:
- add the integerize() constraint to the system of constraints (like in your example), in which case the integerize contractor is invoked from time to time ;
- call integerize() in a systematic manner within the generated code of the forward-backward contractor, whenever the range of an integer variable is reduced. This would be the "optimal" way to go to maximize the filtering power. A possibility would be to attach an "integer" tag to a variable upon symbolic definition (e.g. @integer_variables x) and the appropriate code should be generated, for example
begin (_c, _b, y) = minus_rev(_c, _b, y) (_b, _a, x) = plus_rev(_b, _a, x) x = integerize(x) (_a, x) = exp_rev(_a, x) x = integerize(x) end
for the constraint "exp(x) + x - y = 0" with x integer.