forked from google/or-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
all_different_modulo.fzn
22 lines (22 loc) · 1.11 KB
/
all_different_modulo.fzn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
predicate all_different_int(array [int] of var int: x);
predicate count(array [int] of var int: x, var int: y, var int: c);
predicate global_cardinality(array [int] of var int: x, array [int] of int: cover, array [int] of var int: counts);
predicate table_bool(array [int] of var bool: x, array [int, int] of bool: t);
predicate table_int(array [int] of var int: x, array [int, int] of int: t);
var 5..5: m :: output_var = 5;
array [1..4] of var int: mods____00001;
var 0..4: INT____00005 :: var_is_introduced = mods____00001[4];
var 0..4: INT____00004 :: var_is_introduced = mods____00001[3];
var 0..4: INT____00003 :: var_is_introduced = mods____00001[2];
var 0..4: INT____00002 :: var_is_introduced = mods____00001[1];
array [1..4] of var 1..25: x :: output_array([1..4]);
constraint all_different_int(mods____00001);
constraint int_eq(1, x[2]);
constraint int_eq(3, x[4]);
constraint int_eq(14, x[3]);
constraint int_eq(25, x[1]);
constraint int_mod(x[1], 5, mods____00001[1]);
constraint int_mod(x[2], 5, mods____00001[2]);
constraint int_mod(x[3], 5, mods____00001[3]);
constraint int_mod(x[4], 5, mods____00001[4]);
solve satisfy;