this repo has no description
at develop 8.8 kB view raw
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 * This file is part of Gecode, the generic constraint 10 * development environment: 11 * http://www.gecode.org 12 * 13 * Permission is hereby granted, free of charge, to any person obtaining 14 * a copy of this software and associated documentation files (the 15 * "Software"), to deal in the Software without restriction, including 16 * without limitation the rights to use, copy, modify, merge, publish, 17 * distribute, sublicense, and/or sell copies of the Software, and to 18 * permit persons to whom the Software is furnished to do so, subject to 19 * the following conditions: 20 * 21 * The above copyright notice and this permission notice shall be 22 * included in all copies or substantial portions of the Software. 23 * 24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 25 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 26 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 27 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 28 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 29 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 30 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 31 * 32 */ 33 34#include "test/flatzinc.hh" 35 36namespace Test { namespace FlatZinc { 37 38 namespace { 39 /// Helper class to create and register tests 40 class Create { 41 public: 42 43 /// Perform creation and registration 44 Create(void) { 45 (void) new FlatZincTest("singHoist2", 46"predicate bool_lin_ge(array [int] of int: a, array [int] of var bool: x, var int: c);\n\ 47predicate bool_lin_gt(array [int] of int: a, array [int] of var bool: x, var int: c);\n\ 48predicate bool_lin_lt(array [int] of int: a, array [int] of var bool: x, var int: c);\n\ 49predicate bool_lin_ne(array [int] of int: a, array [int] of var bool: x, var int: c);\n\ 50array [1..16] of int: Empty = [0, 2, 3, 3, 2, 0, 2, 3, 3, 2, 0, 2, 3, 3, 2, 0];\n\ 51array [1..4] of int: Full = [4, 4, 4, 5];\n\ 52array [1..3] of int: MaxTime = [10, 25, 10];\n\ 53array [1..3] of int: MinTime = [10, 25, 10];\n\ 54var bool: BOOL____00001 :: is_defined_var :: var_is_introduced;\n\ 55var bool: BOOL____00002 :: is_defined_var :: var_is_introduced;\n\ 56var bool: BOOL____00003 :: is_defined_var :: var_is_introduced;\n\ 57var bool: BOOL____00004 :: is_defined_var :: var_is_introduced;\n\ 58var bool: BOOL____00005 :: is_defined_var :: var_is_introduced;\n\ 59var bool: BOOL____00006 :: is_defined_var :: var_is_introduced;\n\ 60var bool: BOOL____00007 :: is_defined_var :: var_is_introduced;\n\ 61var bool: BOOL____00008 :: is_defined_var :: var_is_introduced;\n\ 62var bool: BOOL____00009 :: is_defined_var :: var_is_introduced;\n\ 63var bool: BOOL____00010 :: is_defined_var :: var_is_introduced;\n\ 64var bool: BOOL____00011 :: is_defined_var :: var_is_introduced;\n\ 65var bool: BOOL____00012 :: is_defined_var :: var_is_introduced;\n\ 66var bool: BOOL____00013 :: is_defined_var :: var_is_introduced;\n\ 67var bool: BOOL____00014 :: is_defined_var :: var_is_introduced;\n\ 68var bool: BOOL____00015 :: is_defined_var :: var_is_introduced;\n\ 69var bool: BOOL____00016 :: is_defined_var :: var_is_introduced;\n\ 70var bool: BOOL____00017 :: is_defined_var :: var_is_introduced;\n\ 71var bool: BOOL____00018 :: is_defined_var :: var_is_introduced;\n\ 72var bool: BOOL____00019 :: is_defined_var :: var_is_introduced;\n\ 73var bool: BOOL____00020 :: is_defined_var :: var_is_introduced;\n\ 74var bool: BOOL____00021 :: is_defined_var :: var_is_introduced;\n\ 75var bool: BOOL____00022 :: is_defined_var :: var_is_introduced;\n\ 76var bool: BOOL____00023 :: is_defined_var :: var_is_introduced;\n\ 77var bool: BOOL____00024 :: is_defined_var :: var_is_introduced;\n\ 78array [1..4] of var 0..135: Entry :: output_array([0..3]);\n\ 79var 0..45: Period :: output_var;\n\ 80array [1..4] of var 0..135: Removal :: output_array([0..3]);\n\ 81constraint array_bool_or([BOOL____00001, BOOL____00002], true);\n\ 82constraint array_bool_or([BOOL____00003, BOOL____00004], true);\n\ 83constraint array_bool_or([BOOL____00005, BOOL____00006], true);\n\ 84constraint array_bool_or([BOOL____00007, BOOL____00008], true);\n\ 85constraint array_bool_or([BOOL____00009, BOOL____00010], true);\n\ 86constraint array_bool_or([BOOL____00011, BOOL____00012], true);\n\ 87constraint array_bool_or([BOOL____00013, BOOL____00014], true);\n\ 88constraint array_bool_or([BOOL____00015, BOOL____00016], true);\n\ 89constraint array_bool_or([BOOL____00017, BOOL____00018], true);\n\ 90constraint array_bool_or([BOOL____00019, BOOL____00020], true);\n\ 91constraint array_bool_or([BOOL____00021, BOOL____00022], true);\n\ 92constraint array_bool_or([BOOL____00023, BOOL____00024], true);\n\ 93constraint int_eq(Removal[1], 0);\n\ 94constraint int_lin_eq([-1, 1], [Entry[1], Removal[4]], -5);\n\ 95constraint int_lin_eq([-1, 1], [Entry[2], Removal[1]], -4);\n\ 96constraint int_lin_eq([-1, 1], [Entry[3], Removal[2]], -4);\n\ 97constraint int_lin_eq([-1, 1], [Entry[4], Removal[3]], -4);\n\ 98constraint int_lin_le([-3, 1], [Period, Removal[4]], -5);\n\ 99constraint int_lin_le([-1, 1], [Entry[2], Removal[2]], 10);\n\ 100constraint int_lin_le([-1, 1], [Entry[3], Removal[3]], 25);\n\ 101constraint int_lin_le([-1, 1], [Entry[4], Removal[4]], 10);\n\ 102constraint int_lin_le([1, -1], [Entry[2], Removal[2]], -10);\n\ 103constraint int_lin_le([1, -1], [Entry[3], Removal[3]], -25);\n\ 104constraint int_lin_le([1, -1], [Entry[4], Removal[4]], -10);\n\ 105constraint int_lin_le_reif([-2, 1, -1], [Period, Entry[1], Removal[1]], 0, BOOL____00012) :: defines_var(BOOL____00012);\n\ 106constraint int_lin_le_reif([-2, 1, -1], [Period, Entry[1], Removal[2]], -2, BOOL____00020) :: defines_var(BOOL____00020);\n\ 107constraint int_lin_le_reif([-2, 1, -1], [Period, Entry[1], Removal[3]], -3, BOOL____00024) :: defines_var(BOOL____00024);\n\ 108constraint int_lin_le_reif([-2, 1, -1], [Period, Entry[3], Removal[1]], -3, BOOL____00004) :: defines_var(BOOL____00004);\n\ 109constraint int_lin_le_reif([-2, 1, -1], [Period, Entry[4], Removal[1]], -3, BOOL____00008) :: defines_var(BOOL____00008);\n\ 110constraint int_lin_le_reif([-2, 1, -1], [Period, Entry[4], Removal[2]], -3, BOOL____00016) :: defines_var(BOOL____00016);\n\ 111constraint int_lin_le_reif([-1, 1, -1], [Period, Entry[1], Removal[1]], 0, BOOL____00010) :: defines_var(BOOL____00010);\n\ 112constraint int_lin_le_reif([-1, 1, -1], [Period, Entry[1], Removal[2]], -2, BOOL____00018) :: defines_var(BOOL____00018);\n\ 113constraint int_lin_le_reif([-1, 1, -1], [Period, Entry[1], Removal[3]], -3, BOOL____00022) :: defines_var(BOOL____00022);\n\ 114constraint int_lin_le_reif([-1, 1, -1], [Period, Entry[3], Removal[1]], -3, BOOL____00002) :: defines_var(BOOL____00002);\n\ 115constraint int_lin_le_reif([-1, 1, -1], [Period, Entry[4], Removal[1]], -3, BOOL____00006) :: defines_var(BOOL____00006);\n\ 116constraint int_lin_le_reif([-1, 1, -1], [Period, Entry[4], Removal[2]], -3, BOOL____00014) :: defines_var(BOOL____00014);\n\ 117constraint int_lin_le_reif([1, 1, -1], [Period, Entry[2], Removal[2]], 0, BOOL____00001) :: defines_var(BOOL____00001);\n\ 118constraint int_lin_le_reif([1, 1, -1], [Period, Entry[2], Removal[3]], -2, BOOL____00005) :: defines_var(BOOL____00005);\n\ 119constraint int_lin_le_reif([1, 1, -1], [Period, Entry[2], Removal[4]], -3, BOOL____00009) :: defines_var(BOOL____00009);\n\ 120constraint int_lin_le_reif([1, 1, -1], [Period, Entry[3], Removal[3]], 0, BOOL____00013) :: defines_var(BOOL____00013);\n\ 121constraint int_lin_le_reif([1, 1, -1], [Period, Entry[3], Removal[4]], -2, BOOL____00017) :: defines_var(BOOL____00017);\n\ 122constraint int_lin_le_reif([1, 1, -1], [Period, Entry[4], Removal[4]], 0, BOOL____00021) :: defines_var(BOOL____00021);\n\ 123constraint int_lin_le_reif([2, 1, -1], [Period, Entry[2], Removal[2]], 0, BOOL____00003) :: defines_var(BOOL____00003);\n\ 124constraint int_lin_le_reif([2, 1, -1], [Period, Entry[2], Removal[3]], -2, BOOL____00007) :: defines_var(BOOL____00007);\n\ 125constraint int_lin_le_reif([2, 1, -1], [Period, Entry[2], Removal[4]], -3, BOOL____00011) :: defines_var(BOOL____00011);\n\ 126constraint int_lin_le_reif([2, 1, -1], [Period, Entry[3], Removal[3]], 0, BOOL____00015) :: defines_var(BOOL____00015);\n\ 127constraint int_lin_le_reif([2, 1, -1], [Period, Entry[3], Removal[4]], -2, BOOL____00019) :: defines_var(BOOL____00019);\n\ 128constraint int_lin_le_reif([2, 1, -1], [Period, Entry[4], Removal[4]], 0, BOOL____00023) :: defines_var(BOOL____00023);\n\ 129solve minimize Period;\n\ 130", "Entry = array1d(0..3, [62, 4, 18, 47]);\n\ 131Period = 25;\n\ 132Removal = array1d(0..3, [0, 14, 43, 57]);\n\ 133----------\n\ 134==========\n\ 135"); 136 } 137 }; 138 139 Create c; 140 } 141 142}} 143 144// STATISTICS: test-flatzinc