Gecode / gecode

Generic Constraint Development Environment
https://www.gecode.org
Other
283 stars 76 forks source link

fzn-gecode, sort+element, hangs #168

Open matsc-at-sics-se opened 1 year ago

matsc-at-sics-se commented 1 year ago

On Ubuntu 22.04.2 LTS.

The following model outputs one solution and then hangs if you run it with minizinc -a:

include "globals.mzn";
var 1..1: B;
var 1..1 union 4..4: C;
var 2..4: D;
var 2..2 union 4..4: E;
var 1..1 union 4..4: F;
var 3..4: G;
var 2..2 union 4..4: H;
var 3..4: J;
var 1..1 union 4..4: K;
constraint sort([C,K,G,D],[F,E,H,J]);
constraint [F,E,H,J][B] = C;
solve :: int_search([B,D,F,K,C,E,G,H,J], input_order, indomain) satisfy;
matsc-at-sics-se commented 1 year ago

Here is the smallest instance of this bug that I could find.

include "globals.mzn";
var 3..4: A;
var {2,4}: D;
var {2,4}: E;
var 3..4: H;
var {2,4}: I;
constraint
  sort([D,3,D,A],[E,I,D,H]);
% solve :: int_search([A,D,E,H,I], input_order, indomain_min) satisfy;