forked from google/or-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
averback_1.4.fzn
35 lines (35 loc) · 1.92 KB
/
averback_1.4.fzn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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 1..1: Baker :: output_var = 1;
var 0..4: Farmer :: output_var;
var 0..4: Glover :: output_var;
var 0..4: Hosier :: output_var;
var -2..2: INT____00001 :: is_defined_var :: var_is_introduced;
var 0..4: INT____00002 :: is_defined_var :: var_is_introduced;
var -1..3: INT____00003 :: is_defined_var :: var_is_introduced;
var 0..4: INT____00004 :: is_defined_var :: var_is_introduced;
var 1..5: INT____00005 :: is_defined_var :: var_is_introduced;
var 0..4: INT____00006 :: is_defined_var :: var_is_introduced;
var 0..4: Dyer :: output_var = INT____00006;
var 3..3: baker :: output_var = 3;
var 0..4: dyer :: output_var = INT____00002;
var 0..4: farmer :: output_var = INT____00004;
var 0..4: glover :: output_var;
var 0..4: hosier :: output_var;
constraint all_different_int([Baker, Dyer, Farmer, Glover, Hosier]);
constraint all_different_int([baker, dyer, farmer, glover, hosier]);
constraint int_lin_eq([-1, 1], [INT____00001, Hosier], 2) :: defines_var(INT____00001);
constraint int_lin_eq([-1, 1], [INT____00003, Farmer], 1) :: defines_var(INT____00003);
constraint int_lin_eq([-1, 1], [INT____00005, glover], -1) :: defines_var(INT____00005);
constraint int_mod(INT____00001, 5, INT____00002) :: defines_var(INT____00002);
constraint int_mod(INT____00003, 5, INT____00004) :: defines_var(INT____00004);
constraint int_mod(INT____00005, 5, INT____00006) :: defines_var(INT____00006);
constraint int_ne(baker, 1);
constraint int_ne(dyer, Dyer);
constraint int_ne(farmer, Farmer);
constraint int_ne(glover, Glover);
constraint int_ne(hosier, Hosier);
solve satisfy;