choco-solver icon indicating copy to clipboard operation
choco-solver copied to clipboard

Reified global constraints are decomposed in Minizinc parser

Open IgnaceBleukx opened this issue 1 year ago • 1 comments

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

IgnaceBleukx avatar Nov 20 '23 11:11 IgnaceBleukx

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

cprudhom avatar Nov 22 '23 14:11 cprudhom