Generated on Sat Feb 7 2015 02:01:31 for Gecode by doxygen 1.8.9.1
bugfix_r7854.cpp
Go to the documentation of this file.
1 /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2 /*
3  * Main authors:
4  * Guido Tack <tack@gecode.org>
5  *
6  * Copyright:
7  * Guido Tack, 2014
8  *
9  * Last modified:
10  * $Date: 2014-11-04 13:28:32 +0100 (Tue, 04 Nov 2014) $ by $Author: schulte $
11  * $Revision: 14287 $
12  *
13  * This file is part of Gecode, the generic constraint
14  * development environment:
15  * http://www.gecode.org
16  *
17  * Permission is hereby granted, free of charge, to any person obtaining
18  * a copy of this software and associated documentation files (the
19  * "Software"), to deal in the Software without restriction, including
20  * without limitation the rights to use, copy, modify, merge, publish,
21  * distribute, sublicense, and/or sell copies of the Software, and to
22  * permit persons to whom the Software is furnished to do so, subject to
23  * the following conditions:
24  *
25  * The above copyright notice and this permission notice shall be
26  * included in all copies or substantial portions of the Software.
27  *
28  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
29  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
30  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
31  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
32  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
33  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
34  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
35  *
36  */
37 
38 #include "test/flatzinc.hh"
39 
40 namespace Test { namespace FlatZinc {
41 
42  namespace {
44  class Create {
45  public:
46 
48  Create(void) {
49  (void) new FlatZincTest("bugfix_r7854","\
50 array[1 .. 9] of var 0 .. 8: pos__253 :: output_array([1..9]);\
51 array[1 .. 17] of var 0 .. 1: y__967::var_is_introduced;\
52 array[1 .. 17] of var bool: ful;\
53 array[1 .. 34] of int: prefs__250 = \
54  [ 0, 2, 0, 4, 0, 7, 1, 4, 1, 8, 2, 3, 2, 4, 3, 0, 3, 4, 4, 5, 4, 0, 5, 0, \
55  5, 8, 6, 2, 6, 7, 7, 8, 7, 6 ];\
56 var 0 .. 8: sat :: output_var;\
57 var bool: b__268::var_is_introduced;\
58 var bool: b__275::var_is_introduced;\
59 var bool: b__292::var_is_introduced;\
60 var bool: b__299::var_is_introduced;\
61 var bool: b__316::var_is_introduced;\
62 var bool: b__323::var_is_introduced;\
63 var bool: b__340::var_is_introduced;\
64 var bool: b__347::var_is_introduced;\
65 var bool: b__364::var_is_introduced;\
66 var bool: b__371::var_is_introduced;\
67 var bool: b__388::var_is_introduced;\
68 var bool: b__395::var_is_introduced;\
69 var bool: b__412::var_is_introduced;\
70 var bool: b__419::var_is_introduced;\
71 var bool: b__436::var_is_introduced;\
72 var bool: b__443::var_is_introduced;\
73 var bool: b__460::var_is_introduced;\
74 var bool: b__467::var_is_introduced;\
75 var bool: b__484::var_is_introduced;\
76 var bool: b__491::var_is_introduced;\
77 var bool: b__508::var_is_introduced;\
78 var bool: b__515::var_is_introduced;\
79 var bool: b__532::var_is_introduced;\
80 var bool: b__539::var_is_introduced;\
81 var bool: b__556::var_is_introduced;\
82 var bool: b__563::var_is_introduced;\
83 var bool: b__580::var_is_introduced;\
84 var bool: b__587::var_is_introduced;\
85 var bool: b__604::var_is_introduced;\
86 var bool: b__611::var_is_introduced;\
87 var bool: b__628::var_is_introduced;\
88 var bool: b__635::var_is_introduced;\
89 var bool: b__652::var_is_introduced;\
90 var bool: b__659::var_is_introduced;\
91 constraint bool_xor(b__652, b__659, ful[17]);\
92 constraint bool_xor(b__628, b__635, ful[16]);\
93 constraint bool_xor(b__604, b__611, ful[15]);\
94 constraint bool_xor(b__580, b__587, ful[14]);\
95 constraint bool_xor(b__556, b__563, ful[13]);\
96 constraint bool_xor(b__532, b__539, ful[12]);\
97 constraint bool_xor(b__508, b__515, ful[11]);\
98 constraint bool_xor(b__484, b__491, ful[10]);\
99 constraint bool_xor(b__460, b__467, ful[9]);\
100 constraint bool_xor(b__436, b__443, ful[8]);\
101 constraint bool_xor(b__412, b__419, ful[7]);\
102 constraint bool_xor(b__388, b__395, ful[6]);\
103 constraint bool_xor(b__364, b__371, ful[5]);\
104 constraint bool_xor(b__340, b__347, ful[4]);\
105 constraint bool_xor(b__316, b__323, ful[3]);\
106 constraint bool_xor(b__292, b__299, ful[2]);\
107 constraint bool_xor(b__268, b__275, ful[1]);\
108 constraint \
109  int_lin_eq(\
110  [ -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], \
111  [ sat, y__967[17], y__967[16], y__967[15], y__967[14], y__967[13], \
112  y__967[12], y__967[11], y__967[10], y__967[9], y__967[8], y__967[7], \
113  y__967[6], y__967[5], y__967[4], y__967[3], y__967[2], y__967[1] ], 0);\
114 constraint bool2int(ful[17], y__967[17]);\
115 constraint bool2int(ful[16], y__967[16]);\
116 constraint bool2int(ful[15], y__967[15]);\
117 constraint bool2int(ful[14], y__967[14]);\
118 constraint bool2int(ful[13], y__967[13]);\
119 constraint bool2int(ful[12], y__967[12]);\
120 constraint bool2int(ful[11], y__967[11]);\
121 constraint bool2int(ful[10], y__967[10]);\
122 constraint bool2int(ful[9], y__967[9]);\
123 constraint bool2int(ful[8], y__967[8]);\
124 constraint bool2int(ful[7], y__967[7]);\
125 constraint bool2int(ful[6], y__967[6]);\
126 constraint bool2int(ful[5], y__967[5]);\
127 constraint bool2int(ful[4], y__967[4]);\
128 constraint bool2int(ful[3], y__967[3]);\
129 constraint bool2int(ful[2], y__967[2]);\
130 constraint bool2int(ful[1], y__967[1]);\
131 constraint int_lt(pos__253[1], pos__253[2]);\
132 constraint \
133  int_lin_eq_reif([ 1, -1 ], [ pos__253[9], pos__253[8] ], -1, b__635);\
134 constraint \
135  int_lin_eq_reif([ 1, -1 ], [ pos__253[9], pos__253[6] ], -1, b__563);\
136 constraint \
137  int_lin_eq_reif([ 1, -1 ], [ pos__253[9], pos__253[2] ], -1, b__371);\
138 constraint \
139  int_lin_eq_reif([ 1, -1 ], [ pos__253[8], pos__253[9] ], -1, b__628);\
140 constraint \
141  int_lin_eq_reif([ 1, -1 ], [ pos__253[8], pos__253[7] ], -1, b__652);\
142 constraint \
143  int_lin_eq_reif([ 1, -1 ], [ pos__253[8], pos__253[7] ], -1, b__611);\
144 constraint \
145  int_lin_eq_reif([ 1, -1 ], [ pos__253[8], pos__253[1] ], -1, b__323);\
146 constraint \
147  int_lin_eq_reif([ 1, -1 ], [ pos__253[7], pos__253[8] ], -1, b__659);\
148 constraint \
149  int_lin_eq_reif([ 1, -1 ], [ pos__253[7], pos__253[8] ], -1, b__604);\
150 constraint \
151  int_lin_eq_reif([ 1, -1 ], [ pos__253[7], pos__253[3] ], -1, b__580);\
152 constraint \
153  int_lin_eq_reif([ 1, -1 ], [ pos__253[6], pos__253[9] ], -1, b__556);\
154 constraint \
155  int_lin_eq_reif([ 1, -1 ], [ pos__253[6], pos__253[5] ], -1, b__491);\
156 constraint \
157  int_lin_eq_reif([ 1, -1 ], [ pos__253[6], pos__253[1] ], -1, b__532);\
158 constraint \
159  int_lin_eq_reif([ 1, -1 ], [ pos__253[5], pos__253[6] ], -1, b__484);\
160 constraint \
161  int_lin_eq_reif([ 1, -1 ], [ pos__253[5], pos__253[4] ], -1, b__467);\
162 constraint \
163  int_lin_eq_reif([ 1, -1 ], [ pos__253[5], pos__253[3] ], -1, b__419);\
164 constraint \
165  int_lin_eq_reif([ 1, -1 ], [ pos__253[5], pos__253[2] ], -1, b__347);\
166 constraint \
167  int_lin_eq_reif([ 1, -1 ], [ pos__253[5], pos__253[1] ], -1, b__508);\
168 constraint \
169  int_lin_eq_reif([ 1, -1 ], [ pos__253[5], pos__253[1] ], -1, b__299);\
170 constraint \
171  int_lin_eq_reif([ 1, -1 ], [ pos__253[4], pos__253[5] ], -1, b__460);\
172 constraint \
173  int_lin_eq_reif([ 1, -1 ], [ pos__253[4], pos__253[3] ], -1, b__395);\
174 constraint \
175  int_lin_eq_reif([ 1, -1 ], [ pos__253[4], pos__253[1] ], -1, b__436);\
176 constraint \
177  int_lin_eq_reif([ 1, -1 ], [ pos__253[3], pos__253[7] ], -1, b__587);\
178 constraint \
179  int_lin_eq_reif([ 1, -1 ], [ pos__253[3], pos__253[5] ], -1, b__412);\
180 constraint \
181  int_lin_eq_reif([ 1, -1 ], [ pos__253[3], pos__253[4] ], -1, b__388);\
182 constraint \
183  int_lin_eq_reif([ 1, -1 ], [ pos__253[3], pos__253[1] ], -1, b__275);\
184 constraint \
185  int_lin_eq_reif([ 1, -1 ], [ pos__253[2], pos__253[9] ], -1, b__364);\
186 constraint \
187  int_lin_eq_reif([ 1, -1 ], [ pos__253[2], pos__253[5] ], -1, b__340);\
188 constraint \
189  int_lin_eq_reif([ 1, -1 ], [ pos__253[1], pos__253[8] ], -1, b__316);\
190 constraint \
191  int_lin_eq_reif([ 1, -1 ], [ pos__253[1], pos__253[6] ], -1, b__539);\
192 constraint \
193  int_lin_eq_reif([ 1, -1 ], [ pos__253[1], pos__253[5] ], -1, b__515);\
194 constraint \
195  int_lin_eq_reif([ 1, -1 ], [ pos__253[1], pos__253[5] ], -1, b__292);\
196 constraint \
197  int_lin_eq_reif([ 1, -1 ], [ pos__253[1], pos__253[4] ], -1, b__443);\
198 constraint \
199  int_lin_eq_reif([ 1, -1 ], [ pos__253[1], pos__253[3] ], -1, b__268);\
200 constraint int_ne(pos__253[1], pos__253[2]);\
201 constraint int_ne(pos__253[1], pos__253[3]);\
202 constraint int_ne(pos__253[1], pos__253[4]);\
203 constraint int_ne(pos__253[1], pos__253[5]);\
204 constraint int_ne(pos__253[1], pos__253[6]);\
205 constraint int_ne(pos__253[1], pos__253[7]);\
206 constraint int_ne(pos__253[1], pos__253[8]);\
207 constraint int_ne(pos__253[1], pos__253[9]);\
208 constraint int_ne(pos__253[2], pos__253[3]);\
209 constraint int_ne(pos__253[2], pos__253[4]);\
210 constraint int_ne(pos__253[2], pos__253[5]);\
211 constraint int_ne(pos__253[2], pos__253[6]);\
212 constraint int_ne(pos__253[2], pos__253[7]);\
213 constraint int_ne(pos__253[2], pos__253[8]);\
214 constraint int_ne(pos__253[2], pos__253[9]);\
215 constraint int_ne(pos__253[3], pos__253[4]);\
216 constraint int_ne(pos__253[3], pos__253[5]);\
217 constraint int_ne(pos__253[3], pos__253[6]);\
218 constraint int_ne(pos__253[3], pos__253[7]);\
219 constraint int_ne(pos__253[3], pos__253[8]);\
220 constraint int_ne(pos__253[3], pos__253[9]);\
221 constraint int_ne(pos__253[4], pos__253[5]);\
222 constraint int_ne(pos__253[4], pos__253[6]);\
223 constraint int_ne(pos__253[4], pos__253[7]);\
224 constraint int_ne(pos__253[4], pos__253[8]);\
225 constraint int_ne(pos__253[4], pos__253[9]);\
226 constraint int_ne(pos__253[5], pos__253[6]);\
227 constraint int_ne(pos__253[5], pos__253[7]);\
228 constraint int_ne(pos__253[5], pos__253[8]);\
229 constraint int_ne(pos__253[5], pos__253[9]);\
230 constraint int_ne(pos__253[6], pos__253[7]);\
231 constraint int_ne(pos__253[6], pos__253[8]);\
232 constraint int_ne(pos__253[6], pos__253[9]);\
233 constraint int_ne(pos__253[7], pos__253[8]);\
234 constraint int_ne(pos__253[7], pos__253[9]);\
235 constraint int_ne(pos__253[8], pos__253[9]);\
236 solve \
237  ::int_search(pos__253, first_fail, indomain, complete) maximize sat;\
238 ", "\
239 pos__253 = array1d(1..9, [0, 1, 4, 3, 2, 8, 5, 6, 7]);\n\
240 sat = 8;\n\
241 ----------\n\
242 ==========\n\
243 ");
244  }
245  };
246 
247  Create c;
248  }
249 
250 }}
251 
252 // STATISTICS: test-flatzinc
Gecode::FloatVal c(-8, 8)
General test support.
Definition: afc.cpp:43