forked from google/or-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
all_interval6.fzn
50 lines (50 loc) · 3.6 KB
/
all_interval6.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
predicate fzn_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_fzn_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_fzn_cumulative(array [int] of var int: s, array [int] of int: d, array [int] of int: r, var int: b);
var -11..11: INT____00001 :: is_defined_var :: var_is_introduced;
var -11..11: INT____00003 :: is_defined_var :: var_is_introduced;
var -11..11: INT____00005 :: is_defined_var :: var_is_introduced;
var -11..11: INT____00007 :: is_defined_var :: var_is_introduced;
var -11..11: INT____00009 :: is_defined_var :: var_is_introduced;
var -11..11: INT____00011 :: is_defined_var :: var_is_introduced;
var -11..11: INT____00013 :: is_defined_var :: var_is_introduced;
var -11..11: INT____00015 :: is_defined_var :: var_is_introduced;
var -11..11: INT____00017 :: is_defined_var :: var_is_introduced;
var -11..11: INT____00019 :: is_defined_var :: var_is_introduced;
var -11..11: INT____00021 :: is_defined_var :: var_is_introduced;
array [1..11] of var 1..11: differences :: output_array([0..10]);
array [1..12] of var 0..11: series :: output_array([0..11]);
constraint fzn_all_different_int(differences);
constraint fzn_all_different_int(series);
constraint int_abs(INT____00001, differences[1]);
constraint int_abs(INT____00003, differences[2]);
constraint int_abs(INT____00005, differences[3]);
constraint int_abs(INT____00007, differences[4]);
constraint int_abs(INT____00009, differences[5]);
constraint int_abs(INT____00011, differences[6]);
constraint int_abs(INT____00013, differences[7]);
constraint int_abs(INT____00015, differences[8]);
constraint int_abs(INT____00017, differences[9]);
constraint int_abs(INT____00019, differences[10]);
constraint int_abs(INT____00021, differences[11]);
constraint int_lin_eq([-1, -1, 1], [INT____00001, series[1], series[2]], 0) :: defines_var(INT____00001);
constraint int_lin_eq([-1, -1, 1], [INT____00003, series[2], series[3]], 0) :: defines_var(INT____00003);
constraint int_lin_eq([-1, -1, 1], [INT____00005, series[3], series[4]], 0) :: defines_var(INT____00005);
constraint int_lin_eq([-1, -1, 1], [INT____00007, series[4], series[5]], 0) :: defines_var(INT____00007);
constraint int_lin_eq([-1, -1, 1], [INT____00009, series[5], series[6]], 0) :: defines_var(INT____00009);
constraint int_lin_eq([-1, -1, 1], [INT____00011, series[6], series[7]], 0) :: defines_var(INT____00011);
constraint int_lin_eq([-1, -1, 1], [INT____00013, series[7], series[8]], 0) :: defines_var(INT____00013);
constraint int_lin_eq([-1, -1, 1], [INT____00015, series[8], series[9]], 0) :: defines_var(INT____00015);
constraint int_lin_eq([-1, -1, 1], [INT____00017, series[9], series[10]], 0) :: defines_var(INT____00017);
constraint int_lin_eq([-1, -1, 1], [INT____00019, series[10], series[11]], 0) :: defines_var(INT____00019);
constraint int_lin_eq([-1, -1, 1], [INT____00021, series[11], series[12]], 0) :: defines_var(INT____00021);
constraint int_lt(series[1], series[12]);
solve :: int_search(series, first_fail, indomain_max, complete) satisfy;