Generated on Sat Feb 7 2015 02:01:31 for Gecode by doxygen 1.8.9.1
singHoist2.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("singHoist2",
50 "predicate bool_lin_ge(array [int] of int: a, array [int] of var bool: x, var int: c);\n\
51 predicate bool_lin_gt(array [int] of int: a, array [int] of var bool: x, var int: c);\n\
52 predicate bool_lin_lt(array [int] of int: a, array [int] of var bool: x, var int: c);\n\
53 predicate bool_lin_ne(array [int] of int: a, array [int] of var bool: x, var int: c);\n\
54 array [1..16] of int: Empty = [0, 2, 3, 3, 2, 0, 2, 3, 3, 2, 0, 2, 3, 3, 2, 0];\n\
55 array [1..4] of int: Full = [4, 4, 4, 5];\n\
56 array [1..3] of int: MaxTime = [10, 25, 10];\n\
57 array [1..3] of int: MinTime = [10, 25, 10];\n\
58 var bool: BOOL____00001 :: is_defined_var :: var_is_introduced;\n\
59 var bool: BOOL____00002 :: is_defined_var :: var_is_introduced;\n\
60 var bool: BOOL____00003 :: is_defined_var :: var_is_introduced;\n\
61 var bool: BOOL____00004 :: is_defined_var :: var_is_introduced;\n\
62 var bool: BOOL____00005 :: is_defined_var :: var_is_introduced;\n\
63 var bool: BOOL____00006 :: is_defined_var :: var_is_introduced;\n\
64 var bool: BOOL____00007 :: is_defined_var :: var_is_introduced;\n\
65 var bool: BOOL____00008 :: is_defined_var :: var_is_introduced;\n\
66 var bool: BOOL____00009 :: is_defined_var :: var_is_introduced;\n\
67 var bool: BOOL____00010 :: is_defined_var :: var_is_introduced;\n\
68 var bool: BOOL____00011 :: is_defined_var :: var_is_introduced;\n\
69 var bool: BOOL____00012 :: is_defined_var :: var_is_introduced;\n\
70 var bool: BOOL____00013 :: is_defined_var :: var_is_introduced;\n\
71 var bool: BOOL____00014 :: is_defined_var :: var_is_introduced;\n\
72 var bool: BOOL____00015 :: is_defined_var :: var_is_introduced;\n\
73 var bool: BOOL____00016 :: is_defined_var :: var_is_introduced;\n\
74 var bool: BOOL____00017 :: is_defined_var :: var_is_introduced;\n\
75 var bool: BOOL____00018 :: is_defined_var :: var_is_introduced;\n\
76 var bool: BOOL____00019 :: is_defined_var :: var_is_introduced;\n\
77 var bool: BOOL____00020 :: is_defined_var :: var_is_introduced;\n\
78 var bool: BOOL____00021 :: is_defined_var :: var_is_introduced;\n\
79 var bool: BOOL____00022 :: is_defined_var :: var_is_introduced;\n\
80 var bool: BOOL____00023 :: is_defined_var :: var_is_introduced;\n\
81 var bool: BOOL____00024 :: is_defined_var :: var_is_introduced;\n\
82 array [1..4] of var 0..135: Entry :: output_array([0..3]);\n\
83 var 0..45: Period :: output_var;\n\
84 array [1..4] of var 0..135: Removal :: output_array([0..3]);\n\
85 constraint array_bool_or([BOOL____00001, BOOL____00002], true);\n\
86 constraint array_bool_or([BOOL____00003, BOOL____00004], true);\n\
87 constraint array_bool_or([BOOL____00005, BOOL____00006], true);\n\
88 constraint array_bool_or([BOOL____00007, BOOL____00008], true);\n\
89 constraint array_bool_or([BOOL____00009, BOOL____00010], true);\n\
90 constraint array_bool_or([BOOL____00011, BOOL____00012], true);\n\
91 constraint array_bool_or([BOOL____00013, BOOL____00014], true);\n\
92 constraint array_bool_or([BOOL____00015, BOOL____00016], true);\n\
93 constraint array_bool_or([BOOL____00017, BOOL____00018], true);\n\
94 constraint array_bool_or([BOOL____00019, BOOL____00020], true);\n\
95 constraint array_bool_or([BOOL____00021, BOOL____00022], true);\n\
96 constraint array_bool_or([BOOL____00023, BOOL____00024], true);\n\
97 constraint int_eq(Removal[1], 0);\n\
98 constraint int_lin_eq([-1, 1], [Entry[1], Removal[4]], -5);\n\
99 constraint int_lin_eq([-1, 1], [Entry[2], Removal[1]], -4);\n\
100 constraint int_lin_eq([-1, 1], [Entry[3], Removal[2]], -4);\n\
101 constraint int_lin_eq([-1, 1], [Entry[4], Removal[3]], -4);\n\
102 constraint int_lin_le([-3, 1], [Period, Removal[4]], -5);\n\
103 constraint int_lin_le([-1, 1], [Entry[2], Removal[2]], 10);\n\
104 constraint int_lin_le([-1, 1], [Entry[3], Removal[3]], 25);\n\
105 constraint int_lin_le([-1, 1], [Entry[4], Removal[4]], 10);\n\
106 constraint int_lin_le([1, -1], [Entry[2], Removal[2]], -10);\n\
107 constraint int_lin_le([1, -1], [Entry[3], Removal[3]], -25);\n\
108 constraint int_lin_le([1, -1], [Entry[4], Removal[4]], -10);\n\
109 constraint int_lin_le_reif([-2, 1, -1], [Period, Entry[1], Removal[1]], 0, BOOL____00012) :: defines_var(BOOL____00012);\n\
110 constraint int_lin_le_reif([-2, 1, -1], [Period, Entry[1], Removal[2]], -2, BOOL____00020) :: defines_var(BOOL____00020);\n\
111 constraint int_lin_le_reif([-2, 1, -1], [Period, Entry[1], Removal[3]], -3, BOOL____00024) :: defines_var(BOOL____00024);\n\
112 constraint int_lin_le_reif([-2, 1, -1], [Period, Entry[3], Removal[1]], -3, BOOL____00004) :: defines_var(BOOL____00004);\n\
113 constraint int_lin_le_reif([-2, 1, -1], [Period, Entry[4], Removal[1]], -3, BOOL____00008) :: defines_var(BOOL____00008);\n\
114 constraint int_lin_le_reif([-2, 1, -1], [Period, Entry[4], Removal[2]], -3, BOOL____00016) :: defines_var(BOOL____00016);\n\
115 constraint int_lin_le_reif([-1, 1, -1], [Period, Entry[1], Removal[1]], 0, BOOL____00010) :: defines_var(BOOL____00010);\n\
116 constraint int_lin_le_reif([-1, 1, -1], [Period, Entry[1], Removal[2]], -2, BOOL____00018) :: defines_var(BOOL____00018);\n\
117 constraint int_lin_le_reif([-1, 1, -1], [Period, Entry[1], Removal[3]], -3, BOOL____00022) :: defines_var(BOOL____00022);\n\
118 constraint int_lin_le_reif([-1, 1, -1], [Period, Entry[3], Removal[1]], -3, BOOL____00002) :: defines_var(BOOL____00002);\n\
119 constraint int_lin_le_reif([-1, 1, -1], [Period, Entry[4], Removal[1]], -3, BOOL____00006) :: defines_var(BOOL____00006);\n\
120 constraint int_lin_le_reif([-1, 1, -1], [Period, Entry[4], Removal[2]], -3, BOOL____00014) :: defines_var(BOOL____00014);\n\
121 constraint int_lin_le_reif([1, 1, -1], [Period, Entry[2], Removal[2]], 0, BOOL____00001) :: defines_var(BOOL____00001);\n\
122 constraint int_lin_le_reif([1, 1, -1], [Period, Entry[2], Removal[3]], -2, BOOL____00005) :: defines_var(BOOL____00005);\n\
123 constraint int_lin_le_reif([1, 1, -1], [Period, Entry[2], Removal[4]], -3, BOOL____00009) :: defines_var(BOOL____00009);\n\
124 constraint int_lin_le_reif([1, 1, -1], [Period, Entry[3], Removal[3]], 0, BOOL____00013) :: defines_var(BOOL____00013);\n\
125 constraint int_lin_le_reif([1, 1, -1], [Period, Entry[3], Removal[4]], -2, BOOL____00017) :: defines_var(BOOL____00017);\n\
126 constraint int_lin_le_reif([1, 1, -1], [Period, Entry[4], Removal[4]], 0, BOOL____00021) :: defines_var(BOOL____00021);\n\
127 constraint int_lin_le_reif([2, 1, -1], [Period, Entry[2], Removal[2]], 0, BOOL____00003) :: defines_var(BOOL____00003);\n\
128 constraint int_lin_le_reif([2, 1, -1], [Period, Entry[2], Removal[3]], -2, BOOL____00007) :: defines_var(BOOL____00007);\n\
129 constraint int_lin_le_reif([2, 1, -1], [Period, Entry[2], Removal[4]], -3, BOOL____00011) :: defines_var(BOOL____00011);\n\
130 constraint int_lin_le_reif([2, 1, -1], [Period, Entry[3], Removal[3]], 0, BOOL____00015) :: defines_var(BOOL____00015);\n\
131 constraint int_lin_le_reif([2, 1, -1], [Period, Entry[3], Removal[4]], -2, BOOL____00019) :: defines_var(BOOL____00019);\n\
132 constraint int_lin_le_reif([2, 1, -1], [Period, Entry[4], Removal[4]], 0, BOOL____00023) :: defines_var(BOOL____00023);\n\
133 solve minimize Period;\n\
134 ", "Entry = array1d(0..3, [62, 4, 18, 47]);\n\
135 Period = 25;\n\
136 Removal = array1d(0..3, [0, 14, 43, 57]);\n\
137 ----------\n\
138 ==========\n\
139 ");
140  }
141  };
142 
143  Create c;
144  }
145 
146 }}
147 
148 // STATISTICS: test-flatzinc
Gecode::FloatVal c(-8, 8)
General test support.
Definition: afc.cpp:43