forked from google/or-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
averbach_1.5.fzn
110 lines (110 loc) · 7.51 KB
/
averbach_1.5.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
array [1..6] of int: who = [1, 2, 1, 2, 1, 2];
var bool: BOOL____00002 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00003 :: 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 bool: BOOL____00006 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00007 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00008 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00010 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00011 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00013 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00014 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00015 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00017 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00018 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00019 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00021 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00022 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00023 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00025 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00026 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00027 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00029 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00030 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00031 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00033 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00035 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00037 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00039 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00041 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00043 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00045 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00047 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00049 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00051 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00053 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00055 :: is_defined_var :: var_is_introduced;
array [1..6] of var 0..2: winner :: output_array([1..6]);
array [1..6] of var 0..2: x :: output_array([1..6]);
var 0..6: z;
array [1..6] of var 0..6: z_cumsum :: output_array([1..6]);
constraint array_bool_or([BOOL____00013, BOOL____00010], BOOL____00014) :: defines_var(BOOL____00014);
constraint array_bool_or([BOOL____00017, BOOL____00013, BOOL____00010], BOOL____00018) :: defines_var(BOOL____00018);
constraint array_bool_or([BOOL____00021, BOOL____00017, BOOL____00013, BOOL____00010], BOOL____00022) :: defines_var(BOOL____00022);
constraint array_bool_or([BOOL____00025, BOOL____00021, BOOL____00017, BOOL____00013, BOOL____00010], BOOL____00026) :: defines_var(BOOL____00026);
constraint array_bool_or([BOOL____00029, BOOL____00025, BOOL____00021, BOOL____00017, BOOL____00013, BOOL____00010], BOOL____00030) :: defines_var(BOOL____00030);
constraint bool_eq_reif(BOOL____00010, false, BOOL____00011) :: defines_var(BOOL____00011);
constraint bool_eq_reif(BOOL____00014, false, BOOL____00015) :: defines_var(BOOL____00015);
constraint bool_eq_reif(BOOL____00018, false, BOOL____00019) :: defines_var(BOOL____00019);
constraint bool_eq_reif(BOOL____00022, false, BOOL____00023) :: defines_var(BOOL____00023);
constraint bool_eq_reif(BOOL____00026, false, BOOL____00027) :: defines_var(BOOL____00027);
constraint bool_eq_reif(BOOL____00030, false, BOOL____00031) :: defines_var(BOOL____00031);
constraint bool_le(BOOL____00002, BOOL____00003);
constraint bool_le(BOOL____00002, BOOL____00004);
constraint bool_le(BOOL____00002, BOOL____00005);
constraint bool_le(BOOL____00002, BOOL____00006);
constraint bool_le(BOOL____00002, BOOL____00007);
constraint bool_le(BOOL____00002, BOOL____00008);
constraint int_eq_reif(winner[1], 0, BOOL____00035) :: defines_var(BOOL____00035);
constraint int_eq_reif(winner[1], 1, BOOL____00033) :: defines_var(BOOL____00033);
constraint int_eq_reif(winner[2], 0, BOOL____00039) :: defines_var(BOOL____00039);
constraint int_eq_reif(winner[2], 2, BOOL____00037) :: defines_var(BOOL____00037);
constraint int_eq_reif(winner[3], 0, BOOL____00043) :: defines_var(BOOL____00043);
constraint int_eq_reif(winner[3], 1, BOOL____00041) :: defines_var(BOOL____00041);
constraint int_eq_reif(winner[4], 0, BOOL____00047) :: defines_var(BOOL____00047);
constraint int_eq_reif(winner[4], 2, BOOL____00045) :: defines_var(BOOL____00045);
constraint int_eq_reif(winner[5], 0, BOOL____00051) :: defines_var(BOOL____00051);
constraint int_eq_reif(winner[5], 1, BOOL____00049) :: defines_var(BOOL____00049);
constraint int_eq_reif(winner[6], 0, BOOL____00055) :: defines_var(BOOL____00055);
constraint int_eq_reif(winner[6], 2, BOOL____00053) :: defines_var(BOOL____00053);
constraint int_eq_reif(x[1], 0, BOOL____00010) :: defines_var(BOOL____00010);
constraint int_eq_reif(x[2], 0, BOOL____00013) :: defines_var(BOOL____00013);
constraint int_eq_reif(x[3], 0, BOOL____00017) :: defines_var(BOOL____00017);
constraint int_eq_reif(x[4], 0, BOOL____00021) :: defines_var(BOOL____00021);
constraint int_eq_reif(x[5], 0, BOOL____00025) :: defines_var(BOOL____00025);
constraint int_eq_reif(x[6], 0, BOOL____00029) :: defines_var(BOOL____00029);
constraint int_eq_reif(z_cumsum[1], 6, BOOL____00033);
constraint int_eq_reif(z_cumsum[2], 6, BOOL____00037);
constraint int_eq_reif(z_cumsum[3], 6, BOOL____00041);
constraint int_eq_reif(z_cumsum[4], 6, BOOL____00045);
constraint int_eq_reif(z_cumsum[5], 6, BOOL____00049);
constraint int_eq_reif(z_cumsum[6], 6, BOOL____00053);
constraint int_le_reif(z, 5, BOOL____00002) :: defines_var(BOOL____00002);
constraint int_lin_eq([-1, 1], [x[1], z_cumsum[1]], 0);
constraint int_lin_eq([-1, -1, 1], [x[1], x[2], z_cumsum[2]], 0);
constraint int_lin_eq([-1, -1, -1, 1], [x[1], x[2], x[3], z_cumsum[3]], 0);
constraint int_lin_eq([-1, -1, -1, -1, 1], [x[1], x[2], x[3], x[4], z_cumsum[4]], 0);
constraint int_lin_eq([-1, -1, -1, -1, -1, 1], [x[1], x[2], x[3], x[4], x[5], z_cumsum[5]], 0);
constraint int_lin_eq([-1, -1, -1, -1, -1, -1, 1], [x[1], x[2], x[3], x[4], x[5], x[6], z_cumsum[6]], 0);
constraint int_lin_eq([-1, 1, 1, 1, 1, 1, 1], [z, x[1], x[2], x[3], x[4], x[5], x[6]], 0);
constraint int_lt_reif(0, x[1], BOOL____00011);
constraint int_lt_reif(0, x[2], BOOL____00015);
constraint int_lt_reif(0, x[3], BOOL____00019);
constraint int_lt_reif(0, x[4], BOOL____00023);
constraint int_lt_reif(0, x[5], BOOL____00027);
constraint int_lt_reif(0, x[6], BOOL____00031);
constraint int_ne(2, 0);
constraint int_ne_reif(z_cumsum[1], 6, BOOL____00035);
constraint int_ne_reif(z_cumsum[2], 6, BOOL____00039);
constraint int_ne_reif(z_cumsum[3], 6, BOOL____00043);
constraint int_ne_reif(z_cumsum[4], 6, BOOL____00047);
constraint int_ne_reif(z_cumsum[5], 6, BOOL____00051);
constraint int_ne_reif(z_cumsum[6], 6, BOOL____00055);
constraint set_in_reif(x[1], 1..2, BOOL____00003) :: defines_var(BOOL____00003);
constraint set_in_reif(x[2], 1..2, BOOL____00004) :: defines_var(BOOL____00004);
constraint set_in_reif(x[3], 1..2, BOOL____00005) :: defines_var(BOOL____00005);
constraint set_in_reif(x[4], 1..2, BOOL____00006) :: defines_var(BOOL____00006);
constraint set_in_reif(x[5], 1..2, BOOL____00007) :: defines_var(BOOL____00007);
constraint set_in_reif(x[6], 1..2, BOOL____00008) :: defines_var(BOOL____00008);
solve :: int_search(x, first_fail, indomain, complete) satisfy;