-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
OandX.fzn
106 lines (106 loc) · 12.5 KB
/
OandX.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
array [1..1323] of int: lines = [1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1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, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0];
var 0..49: INT____00001 :: is_defined_var :: var_is_introduced;
array [1..27] of var 0..1: d :: output_array([1..27]);
array [1..49] of var 0..1: g :: output_array([1..49]);
var 0..49: obj :: output_var = INT____00001;
constraint int_lin_eq([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [d[1], d[2], d[3], d[4], d[5], d[6], d[7], d[8], d[9], d[10], d[11], d[12], d[13], d[14], d[15], d[16], d[17], d[18], d[19], d[20], d[21], d[22], d[23], d[24], d[25], d[26], d[27]], 14);
constraint int_lin_eq([-1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [INT____00001, g[1], g[2], g[3], g[4], g[5], g[6], g[7], g[8], g[9], g[10], g[11], g[12], g[13], g[14], g[15], g[16], g[17], g[18], g[19], g[20], g[21], g[22], g[23], g[24], g[25], g[26], g[27], g[28], g[29], g[30], g[31], g[32], g[33], g[34], g[35], g[36], g[37], g[38], g[39], g[40], g[41], g[42], g[43], g[44], g[45], g[46], g[47], g[48], g[49]], 0) :: defines_var(INT____00001);
constraint int_lin_le([-1, -1, -1, -27], [d[1], d[2], d[3], g[1]], -1);
constraint int_lin_le([-1, -1, -1, -27], [d[1], d[4], d[7], g[10]], -1);
constraint int_lin_le([-1, -1, -1, -27], [d[1], d[5], d[9], g[28]], -1);
constraint int_lin_le([-1, -1, -1, -27], [d[1], d[10], d[19], g[19]], -1);
constraint int_lin_le([-1, -1, -1, -27], [d[1], d[11], d[21], g[40]], -1);
constraint int_lin_le([-1, -1, -1, -27], [d[1], d[13], d[25], g[34]], -1);
constraint int_lin_le([-1, -1, -1, -27], [d[1], d[14], d[27], g[46]], -1);
constraint int_lin_le([-1, -1, -1, -27], [d[2], d[5], d[8], g[11]], -1);
constraint int_lin_le([-1, -1, -1, -27], [d[2], d[11], d[20], g[20]], -1);
constraint int_lin_le([-1, -1, -1, -27], [d[2], d[14], d[26], g[36]], -1);
constraint int_lin_le([-1, -1, -1, -27], [d[3], d[5], d[7], g[29]], -1);
constraint int_lin_le([-1, -1, -1, -27], [d[3], d[6], d[9], g[12]], -1);
constraint int_lin_le([-1, -1, -1, -27], [d[3], d[11], d[19], g[41]], -1);
constraint int_lin_le([-1, -1, -1, -27], [d[3], d[12], d[21], g[21]], -1);
constraint int_lin_le([-1, -1, -1, -27], [d[3], d[14], d[25], g[47]], -1);
constraint int_lin_le([-1, -1, -1, -27], [d[3], d[15], d[27], g[38]], -1);
constraint int_lin_le([-1, -1, -1, -27], [d[4], d[5], d[6], g[2]], -1);
constraint int_lin_le([-1, -1, -1, -27], [d[4], d[13], d[22], g[22]], -1);
constraint int_lin_le([-1, -1, -1, -27], [d[4], d[14], d[24], g[42]], -1);
constraint int_lin_le([-1, -1, -1, -27], [d[5], d[14], d[23], g[23]], -1);
constraint int_lin_le([-1, -1, -1, -27], [d[6], d[14], d[22], g[43]], -1);
constraint int_lin_le([-1, -1, -1, -27], [d[6], d[15], d[24], g[24]], -1);
constraint int_lin_le([-1, -1, -1, -27], [d[7], d[8], d[9], g[3]], -1);
constraint int_lin_le([-1, -1, -1, -27], [d[7], d[13], d[19], g[35]], -1);
constraint int_lin_le([-1, -1, -1, -27], [d[7], d[14], d[21], g[48]], -1);
constraint int_lin_le([-1, -1, -1, -27], [d[7], d[16], d[25], g[25]], -1);
constraint int_lin_le([-1, -1, -1, -27], [d[7], d[17], d[27], g[44]], -1);
constraint int_lin_le([-1, -1, -1, -27], [d[8], d[14], d[20], g[37]], -1);
constraint int_lin_le([-1, -1, -1, -27], [d[8], d[17], d[26], g[26]], -1);
constraint int_lin_le([-1, -1, -1, -27], [d[9], d[14], d[19], g[49]], -1);
constraint int_lin_le([-1, -1, -1, -27], [d[9], d[15], d[21], g[39]], -1);
constraint int_lin_le([-1, -1, -1, -27], [d[9], d[17], d[25], g[45]], -1);
constraint int_lin_le([-1, -1, -1, -27], [d[9], d[18], d[27], g[27]], -1);
constraint int_lin_le([-1, -1, -1, -27], [d[10], d[11], d[12], g[4]], -1);
constraint int_lin_le([-1, -1, -1, -27], [d[10], d[13], d[16], g[13]], -1);
constraint int_lin_le([-1, -1, -1, -27], [d[10], d[14], d[18], g[30]], -1);
constraint int_lin_le([-1, -1, -1, -27], [d[11], d[14], d[17], g[14]], -1);
constraint int_lin_le([-1, -1, -1, -27], [d[12], d[14], d[16], g[31]], -1);
constraint int_lin_le([-1, -1, -1, -27], [d[12], d[15], d[18], g[15]], -1);
constraint int_lin_le([-1, -1, -1, -27], [d[13], d[14], d[15], g[5]], -1);
constraint int_lin_le([-1, -1, -1, -27], [d[16], d[17], d[18], g[6]], -1);
constraint int_lin_le([-1, -1, -1, -27], [d[19], d[20], d[21], g[7]], -1);
constraint int_lin_le([-1, -1, -1, -27], [d[19], d[22], d[25], g[16]], -1);
constraint int_lin_le([-1, -1, -1, -27], [d[19], d[23], d[27], g[32]], -1);
constraint int_lin_le([-1, -1, -1, -27], [d[20], d[23], d[26], g[17]], -1);
constraint int_lin_le([-1, -1, -1, -27], [d[21], d[23], d[25], g[33]], -1);
constraint int_lin_le([-1, -1, -1, -27], [d[21], d[24], d[27], g[18]], -1);
constraint int_lin_le([-1, -1, -1, -27], [d[22], d[23], d[24], g[8]], -1);
constraint int_lin_le([-1, -1, -1, -27], [d[25], d[26], d[27], g[9]], -1);
constraint int_lin_le([1, 1, 1, -27], [d[1], d[2], d[3], g[1]], 2);
constraint int_lin_le([1, 1, 1, -27], [d[1], d[4], d[7], g[10]], 2);
constraint int_lin_le([1, 1, 1, -27], [d[1], d[5], d[9], g[28]], 2);
constraint int_lin_le([1, 1, 1, -27], [d[1], d[10], d[19], g[19]], 2);
constraint int_lin_le([1, 1, 1, -27], [d[1], d[11], d[21], g[40]], 2);
constraint int_lin_le([1, 1, 1, -27], [d[1], d[13], d[25], g[34]], 2);
constraint int_lin_le([1, 1, 1, -27], [d[1], d[14], d[27], g[46]], 2);
constraint int_lin_le([1, 1, 1, -27], [d[2], d[5], d[8], g[11]], 2);
constraint int_lin_le([1, 1, 1, -27], [d[2], d[11], d[20], g[20]], 2);
constraint int_lin_le([1, 1, 1, -27], [d[2], d[14], d[26], g[36]], 2);
constraint int_lin_le([1, 1, 1, -27], [d[3], d[5], d[7], g[29]], 2);
constraint int_lin_le([1, 1, 1, -27], [d[3], d[6], d[9], g[12]], 2);
constraint int_lin_le([1, 1, 1, -27], [d[3], d[11], d[19], g[41]], 2);
constraint int_lin_le([1, 1, 1, -27], [d[3], d[12], d[21], g[21]], 2);
constraint int_lin_le([1, 1, 1, -27], [d[3], d[14], d[25], g[47]], 2);
constraint int_lin_le([1, 1, 1, -27], [d[3], d[15], d[27], g[38]], 2);
constraint int_lin_le([1, 1, 1, -27], [d[4], d[5], d[6], g[2]], 2);
constraint int_lin_le([1, 1, 1, -27], [d[4], d[13], d[22], g[22]], 2);
constraint int_lin_le([1, 1, 1, -27], [d[4], d[14], d[24], g[42]], 2);
constraint int_lin_le([1, 1, 1, -27], [d[5], d[14], d[23], g[23]], 2);
constraint int_lin_le([1, 1, 1, -27], [d[6], d[14], d[22], g[43]], 2);
constraint int_lin_le([1, 1, 1, -27], [d[6], d[15], d[24], g[24]], 2);
constraint int_lin_le([1, 1, 1, -27], [d[7], d[8], d[9], g[3]], 2);
constraint int_lin_le([1, 1, 1, -27], [d[7], d[13], d[19], g[35]], 2);
constraint int_lin_le([1, 1, 1, -27], [d[7], d[14], d[21], g[48]], 2);
constraint int_lin_le([1, 1, 1, -27], [d[7], d[16], d[25], g[25]], 2);
constraint int_lin_le([1, 1, 1, -27], [d[7], d[17], d[27], g[44]], 2);
constraint int_lin_le([1, 1, 1, -27], [d[8], d[14], d[20], g[37]], 2);
constraint int_lin_le([1, 1, 1, -27], [d[8], d[17], d[26], g[26]], 2);
constraint int_lin_le([1, 1, 1, -27], [d[9], d[14], d[19], g[49]], 2);
constraint int_lin_le([1, 1, 1, -27], [d[9], d[15], d[21], g[39]], 2);
constraint int_lin_le([1, 1, 1, -27], [d[9], d[17], d[25], g[45]], 2);
constraint int_lin_le([1, 1, 1, -27], [d[9], d[18], d[27], g[27]], 2);
constraint int_lin_le([1, 1, 1, -27], [d[10], d[11], d[12], g[4]], 2);
constraint int_lin_le([1, 1, 1, -27], [d[10], d[13], d[16], g[13]], 2);
constraint int_lin_le([1, 1, 1, -27], [d[10], d[14], d[18], g[30]], 2);
constraint int_lin_le([1, 1, 1, -27], [d[11], d[14], d[17], g[14]], 2);
constraint int_lin_le([1, 1, 1, -27], [d[12], d[14], d[16], g[31]], 2);
constraint int_lin_le([1, 1, 1, -27], [d[12], d[15], d[18], g[15]], 2);
constraint int_lin_le([1, 1, 1, -27], [d[13], d[14], d[15], g[5]], 2);
constraint int_lin_le([1, 1, 1, -27], [d[16], d[17], d[18], g[6]], 2);
constraint int_lin_le([1, 1, 1, -27], [d[19], d[20], d[21], g[7]], 2);
constraint int_lin_le([1, 1, 1, -27], [d[19], d[22], d[25], g[16]], 2);
constraint int_lin_le([1, 1, 1, -27], [d[19], d[23], d[27], g[32]], 2);
constraint int_lin_le([1, 1, 1, -27], [d[20], d[23], d[26], g[17]], 2);
constraint int_lin_le([1, 1, 1, -27], [d[21], d[23], d[25], g[33]], 2);
constraint int_lin_le([1, 1, 1, -27], [d[21], d[24], d[27], g[18]], 2);
constraint int_lin_le([1, 1, 1, -27], [d[22], d[23], d[24], g[8]], 2);
constraint int_lin_le([1, 1, 1, -27], [d[25], d[26], d[27], g[9]], 2);
solve :: int_search([d[1], d[2], d[3], d[4], d[5], d[6], d[7], d[8], d[9], d[10], d[11], d[12], d[13], d[14], d[15], d[16], d[17], d[18], d[19], d[20], d[21], d[22], d[23], d[24], d[25], d[26], d[27], g[1], g[2], g[3], g[4], g[5], g[6], g[7], g[8], g[9], g[10], g[11], g[12], g[13], g[14], g[15], g[16], g[17], g[18], g[19], g[20], g[21], g[22], g[23], g[24], g[25], g[26], g[27], g[28], g[29], g[30], g[31], g[32], g[33], g[34], g[35], g[36], g[37], g[38], g[39], g[40], g[41], g[42], g[43], g[44], g[45], g[46], g[47], g[48], g[49], INT____00001], first_fail, indomain, complete) minimize INT____00001;