-
Notifications
You must be signed in to change notification settings - Fork 153
Open
Description
Hi choco team,
I hope that you are doing well.
Is your feature request related to a problem? Please describe.
Choco provides a convenient expression builder that is then compiled into a set of constraints.
It is a complicated task, but some improvements seems possible.
For instance, reification is not needed when there is a simple conjunction of constraint.
Let us consider the following model.
Model model = new Model();
IntVar x = model.intVar("x", 1, 9);
IntVar y = model.intVar("y", 0, 9);
IntVar z = model.intVar("z", 0, 9);
x.le(y).and(z.ge(x)).post();
// x.le(y).and(z.ge(x)).decompose().post(); // do not change anything here
System.out.println(model);The output is the following.
satisfaction : undefined
== variables ==
x = {1..9}
y = {0..9}
z = {0..9}
LE_exp_1 = [0,1]
GE_exp_2 = [0,1]
cste -- 2 = 2
== constraints ==
BASIC_REIF ([(x < y + 1) <=> LE_exp_1])
BASIC_REIF ([(x < z + 1) <=> GE_exp_2])
ARITHM ([LE_exp_1 = [0,1] + GE_exp_2 = [0,1] = 2])
Describe the solution you'd like
I want the conjunction to be posted as independent constraints.
x.le(y).post()
z.ge(x)).post();Describe alternatives you've considered
The immediate answer is to post multiple constraints, but, in my case, the expression is also built automatically.
Metadata
Metadata
Assignees
Labels
No labels