00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #include "test/flatzinc.hh"
00039
00040 namespace Test { namespace FlatZinc {
00041
00042 namespace {
00044 class Create {
00045 public:
00046
00048 Create(void) {
00049 (void) new FlatZincTest("singHoist2",
00050 "predicate bool_lin_ge(array [int] of int: a, array [int] of var bool: x, var int: c);\n\
00051 predicate bool_lin_gt(array [int] of int: a, array [int] of var bool: x, var int: c);\n\
00052 predicate bool_lin_lt(array [int] of int: a, array [int] of var bool: x, var int: c);\n\
00053 predicate bool_lin_ne(array [int] of int: a, array [int] of var bool: x, var int: c);\n\
00054 array [1..16] of int: Empty = [0, 2, 3, 3, 2, 0, 2, 3, 3, 2, 0, 2, 3, 3, 2, 0];\n\
00055 array [1..4] of int: Full = [4, 4, 4, 5];\n\
00056 array [1..3] of int: MaxTime = [10, 25, 10];\n\
00057 array [1..3] of int: MinTime = [10, 25, 10];\n\
00058 var bool: BOOL____00001 :: is_defined_var :: var_is_introduced;\n\
00059 var bool: BOOL____00002 :: is_defined_var :: var_is_introduced;\n\
00060 var bool: BOOL____00003 :: is_defined_var :: var_is_introduced;\n\
00061 var bool: BOOL____00004 :: is_defined_var :: var_is_introduced;\n\
00062 var bool: BOOL____00005 :: is_defined_var :: var_is_introduced;\n\
00063 var bool: BOOL____00006 :: is_defined_var :: var_is_introduced;\n\
00064 var bool: BOOL____00007 :: is_defined_var :: var_is_introduced;\n\
00065 var bool: BOOL____00008 :: is_defined_var :: var_is_introduced;\n\
00066 var bool: BOOL____00009 :: is_defined_var :: var_is_introduced;\n\
00067 var bool: BOOL____00010 :: is_defined_var :: var_is_introduced;\n\
00068 var bool: BOOL____00011 :: is_defined_var :: var_is_introduced;\n\
00069 var bool: BOOL____00012 :: is_defined_var :: var_is_introduced;\n\
00070 var bool: BOOL____00013 :: is_defined_var :: var_is_introduced;\n\
00071 var bool: BOOL____00014 :: is_defined_var :: var_is_introduced;\n\
00072 var bool: BOOL____00015 :: is_defined_var :: var_is_introduced;\n\
00073 var bool: BOOL____00016 :: is_defined_var :: var_is_introduced;\n\
00074 var bool: BOOL____00017 :: is_defined_var :: var_is_introduced;\n\
00075 var bool: BOOL____00018 :: is_defined_var :: var_is_introduced;\n\
00076 var bool: BOOL____00019 :: is_defined_var :: var_is_introduced;\n\
00077 var bool: BOOL____00020 :: is_defined_var :: var_is_introduced;\n\
00078 var bool: BOOL____00021 :: is_defined_var :: var_is_introduced;\n\
00079 var bool: BOOL____00022 :: is_defined_var :: var_is_introduced;\n\
00080 var bool: BOOL____00023 :: is_defined_var :: var_is_introduced;\n\
00081 var bool: BOOL____00024 :: is_defined_var :: var_is_introduced;\n\
00082 array [1..4] of var 0..135: Entry :: output_array([0..3]);\n\
00083 var 0..45: Period :: output_var;\n\
00084 array [1..4] of var 0..135: Removal :: output_array([0..3]);\n\
00085 constraint array_bool_or([BOOL____00001, BOOL____00002], true);\n\
00086 constraint array_bool_or([BOOL____00003, BOOL____00004], true);\n\
00087 constraint array_bool_or([BOOL____00005, BOOL____00006], true);\n\
00088 constraint array_bool_or([BOOL____00007, BOOL____00008], true);\n\
00089 constraint array_bool_or([BOOL____00009, BOOL____00010], true);\n\
00090 constraint array_bool_or([BOOL____00011, BOOL____00012], true);\n\
00091 constraint array_bool_or([BOOL____00013, BOOL____00014], true);\n\
00092 constraint array_bool_or([BOOL____00015, BOOL____00016], true);\n\
00093 constraint array_bool_or([BOOL____00017, BOOL____00018], true);\n\
00094 constraint array_bool_or([BOOL____00019, BOOL____00020], true);\n\
00095 constraint array_bool_or([BOOL____00021, BOOL____00022], true);\n\
00096 constraint array_bool_or([BOOL____00023, BOOL____00024], true);\n\
00097 constraint int_eq(Removal[1], 0);\n\
00098 constraint int_lin_eq([-1, 1], [Entry[1], Removal[4]], -5);\n\
00099 constraint int_lin_eq([-1, 1], [Entry[2], Removal[1]], -4);\n\
00100 constraint int_lin_eq([-1, 1], [Entry[3], Removal[2]], -4);\n\
00101 constraint int_lin_eq([-1, 1], [Entry[4], Removal[3]], -4);\n\
00102 constraint int_lin_le([-3, 1], [Period, Removal[4]], -5);\n\
00103 constraint int_lin_le([-1, 1], [Entry[2], Removal[2]], 10);\n\
00104 constraint int_lin_le([-1, 1], [Entry[3], Removal[3]], 25);\n\
00105 constraint int_lin_le([-1, 1], [Entry[4], Removal[4]], 10);\n\
00106 constraint int_lin_le([1, -1], [Entry[2], Removal[2]], -10);\n\
00107 constraint int_lin_le([1, -1], [Entry[3], Removal[3]], -25);\n\
00108 constraint int_lin_le([1, -1], [Entry[4], Removal[4]], -10);\n\
00109 constraint int_lin_le_reif([-2, 1, -1], [Period, Entry[1], Removal[1]], 0, BOOL____00012) :: defines_var(BOOL____00012);\n\
00110 constraint int_lin_le_reif([-2, 1, -1], [Period, Entry[1], Removal[2]], -2, BOOL____00020) :: defines_var(BOOL____00020);\n\
00111 constraint int_lin_le_reif([-2, 1, -1], [Period, Entry[1], Removal[3]], -3, BOOL____00024) :: defines_var(BOOL____00024);\n\
00112 constraint int_lin_le_reif([-2, 1, -1], [Period, Entry[3], Removal[1]], -3, BOOL____00004) :: defines_var(BOOL____00004);\n\
00113 constraint int_lin_le_reif([-2, 1, -1], [Period, Entry[4], Removal[1]], -3, BOOL____00008) :: defines_var(BOOL____00008);\n\
00114 constraint int_lin_le_reif([-2, 1, -1], [Period, Entry[4], Removal[2]], -3, BOOL____00016) :: defines_var(BOOL____00016);\n\
00115 constraint int_lin_le_reif([-1, 1, -1], [Period, Entry[1], Removal[1]], 0, BOOL____00010) :: defines_var(BOOL____00010);\n\
00116 constraint int_lin_le_reif([-1, 1, -1], [Period, Entry[1], Removal[2]], -2, BOOL____00018) :: defines_var(BOOL____00018);\n\
00117 constraint int_lin_le_reif([-1, 1, -1], [Period, Entry[1], Removal[3]], -3, BOOL____00022) :: defines_var(BOOL____00022);\n\
00118 constraint int_lin_le_reif([-1, 1, -1], [Period, Entry[3], Removal[1]], -3, BOOL____00002) :: defines_var(BOOL____00002);\n\
00119 constraint int_lin_le_reif([-1, 1, -1], [Period, Entry[4], Removal[1]], -3, BOOL____00006) :: defines_var(BOOL____00006);\n\
00120 constraint int_lin_le_reif([-1, 1, -1], [Period, Entry[4], Removal[2]], -3, BOOL____00014) :: defines_var(BOOL____00014);\n\
00121 constraint int_lin_le_reif([1, 1, -1], [Period, Entry[2], Removal[2]], 0, BOOL____00001) :: defines_var(BOOL____00001);\n\
00122 constraint int_lin_le_reif([1, 1, -1], [Period, Entry[2], Removal[3]], -2, BOOL____00005) :: defines_var(BOOL____00005);\n\
00123 constraint int_lin_le_reif([1, 1, -1], [Period, Entry[2], Removal[4]], -3, BOOL____00009) :: defines_var(BOOL____00009);\n\
00124 constraint int_lin_le_reif([1, 1, -1], [Period, Entry[3], Removal[3]], 0, BOOL____00013) :: defines_var(BOOL____00013);\n\
00125 constraint int_lin_le_reif([1, 1, -1], [Period, Entry[3], Removal[4]], -2, BOOL____00017) :: defines_var(BOOL____00017);\n\
00126 constraint int_lin_le_reif([1, 1, -1], [Period, Entry[4], Removal[4]], 0, BOOL____00021) :: defines_var(BOOL____00021);\n\
00127 constraint int_lin_le_reif([2, 1, -1], [Period, Entry[2], Removal[2]], 0, BOOL____00003) :: defines_var(BOOL____00003);\n\
00128 constraint int_lin_le_reif([2, 1, -1], [Period, Entry[2], Removal[3]], -2, BOOL____00007) :: defines_var(BOOL____00007);\n\
00129 constraint int_lin_le_reif([2, 1, -1], [Period, Entry[2], Removal[4]], -3, BOOL____00011) :: defines_var(BOOL____00011);\n\
00130 constraint int_lin_le_reif([2, 1, -1], [Period, Entry[3], Removal[3]], 0, BOOL____00015) :: defines_var(BOOL____00015);\n\
00131 constraint int_lin_le_reif([2, 1, -1], [Period, Entry[3], Removal[4]], -2, BOOL____00019) :: defines_var(BOOL____00019);\n\
00132 constraint int_lin_le_reif([2, 1, -1], [Period, Entry[4], Removal[4]], 0, BOOL____00023) :: defines_var(BOOL____00023);\n\
00133 solve minimize Period;\n\
00134 ", "Entry = array1d(0..3, [62, 4, 18, 47]);\n\
00135 Period = 25;\n\
00136 Removal = array1d(0..3, [0, 14, 43, 57]);\n\
00137 ----------\n\
00138 ==========\n\
00139 ");
00140 }
00141 };
00142
00143 Create c;
00144 }
00145
00146 }}
00147
00148