forked from google/or-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
averbach_1.2.fzn
31 lines (31 loc) · 1.95 KB
/
averbach_1.2.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
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 fixed_cumulative(array [int] of var int: s, array [int] of int: d, array [int] of int: r, int: b);
predicate global_cardinality(array [int] of var int: x, array [int] of int: cover, array [int] of var int: counts);
predicate maximum_int(var int: m, array [int] of var int: x);
predicate minimum_int(var int: m, array [int] of var int: x);
predicate sliding_sum(int: low, int: up, int: seq, array [int] of var int: vs);
predicate sort(array [int] of var int: x, array [int] of var int: y);
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);
predicate var_cumulative(array [int] of var int: s, array [int] of int: d, array [int] of int: r, var int: b);
var 1..3: American :: output_var;
var bool: BOOL____00001 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00002 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00004 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00005 :: is_defined_var :: var_is_introduced;
var 1..3: English :: output_var;
var 1..3: French :: output_var;
var 1..1: X = 1;
var 1..3: Y;
var 1..3: Z;
array [1..3] of var 1..3: xtable :: output_array([1..3]) = [1, Y, Z];
constraint all_different_int([American, English, French]);
constraint all_different_int(xtable);
constraint array_bool_or([BOOL____00001, BOOL____00002], true);
constraint array_bool_or([BOOL____00004, BOOL____00005], true);
constraint int_lin_eq_reif([-1, 1], [American, Y], -2, BOOL____00002) :: defines_var(BOOL____00002);
constraint int_lin_eq_reif([-1, 1], [American, Y], 1, BOOL____00001) :: defines_var(BOOL____00001);
constraint int_lin_eq_reif([1, -1], [French, 1], -2, BOOL____00005) :: defines_var(BOOL____00005);
constraint int_lin_eq_reif([1, -1], [French, 1], 1, BOOL____00004) :: defines_var(BOOL____00004);
solve satisfy;