chocoteam / choco-solver

An open-source Java library for Constraint Programming
http://choco-solver.org/
BSD 4-Clause "Original" or "Old" License
683 stars 137 forks source link

Reified global constraints are decomposed in Minizinc parser #1072

Open IgnaceBleukx opened 7 months ago

IgnaceBleukx commented 7 months ago

Dear,

I am using the Choco-solver through Minizinc and noticed the lack of support for (half) reified global constraints in the flatzinc output.

For example, when compiling the following model for Choco v4.10.14, the alldifferent constraint gets decomposed.

include "globals.mzn";

int: N = 3;
array[1..N] of var 1..10 : x;
var bool: bv;

constraint bv -> alldifferent(x);

While (as far as I understand) the Java interface allows this constraint to be written as:

model.IfThen(bv,model.allDifferent(vars))

It seems Minizinc does have support for keeping these reified global constraints (e.g., for Chuffed, the flatzinc output contains the compiled constraint fzn_all_different_int_imp.

Are there any plans on adding the reified versions of global constraints to the Minizinc parser?

Kind regards, Ignace

cprudhom commented 7 months ago

You are right. This can certainly be part of the next release.