diff --git a/changelog.in b/changelog.in index 8b8ef60a21..aa32749a16 100755 --- a/changelog.in +++ b/changelog.in @@ -69,6 +69,14 @@ Date: 2019-02-14 This release fixes a number of minor issues and adds post events to general tracers. +[ENTRY] +Module: flatzinc +What: bug +Rank: minor +[DESCRIPTION] +Change table and regular predicates to take 1d arrays as arguments. +Otherwise the generated FlatZinc does not typecheck. + [ENTRY] Module: flatzinc What: bug diff --git a/gecode/flatzinc/mznlib/regular.mzn b/gecode/flatzinc/mznlib/regular.mzn index 6b00103ecb..1707f49d82 100644 --- a/gecode/flatzinc/mznlib/regular.mzn +++ b/gecode/flatzinc/mznlib/regular.mzn @@ -31,7 +31,7 @@ % predicate gecode_regular(array[int] of var int: x, int: Q, int: S, - array[int,int] of int: d, int: q0, set of int: F); + array[int] of int: d, int: q0, set of int: F); predicate regular(array[int] of var int: x, int: Q, int: S, array[int,int] of int: d, int: q0, set of int: F) = @@ -55,5 +55,5 @@ predicate regular(array[int] of var int: x, int: Q, int: S, assert(F subset 1..Q, "regular: final states in 'F' contain states outside 1..Q", - gecode_regular(x,Q,S,d,q0,F) + gecode_regular(x,Q,S,array1d(d),q0,F) )))))); diff --git a/gecode/flatzinc/mznlib/table_bool.mzn b/gecode/flatzinc/mznlib/table_bool.mzn index 889f826480..c9618d9caa 100644 --- a/gecode/flatzinc/mznlib/table_bool.mzn +++ b/gecode/flatzinc/mznlib/table_bool.mzn @@ -33,30 +33,30 @@ % predicate gecode_table_bool(array[int] of var bool: x, - array[int, int] of int: t); + array[int] of int: t); predicate gecode_table_bool_reif(array[int] of var bool: x, - array[int, int] of int: t, var bool: b); + array[int] of int: t, var bool: b); predicate gecode_table_bool_imp(array[int] of var bool: x, - array[int, int] of int: t, var bool: b); + array[int] of int: t, var bool: b); predicate table_bool(array[int] of var bool: x, array[int, int] of int: t) = assert (index_set_2of2(t) == index_set(x), "The second dimension of the table must equal the number of variables " ++ "in the first argument", - gecode_table_bool(x,t)); + gecode_table_bool(x,array1d(t))); predicate table_bool_reif(array[int] of var bool: x, array[int, int] of int: t, var bool: b) = assert (index_set_2of2(t) == index_set(x), "The second dimension of the table must equal the number of variables " ++ "in the first argument", - gecode_table_bool_reif(x,t,b)); + gecode_table_bool_reif(x,array1d(t),b)); predicate table_bool_imp(array[int] of var bool: x, array[int, int] of int: t, var bool: b) = assert (index_set_2of2(t) == index_set(x), "The second dimension of the table must equal the number of variables " ++ "in the first argument", - gecode_table_bool_imp(x,t,b)); + gecode_table_bool_imp(x,array1d(t),b)); diff --git a/gecode/flatzinc/mznlib/table_int.mzn b/gecode/flatzinc/mznlib/table_int.mzn index f4f71d01c6..872516cef2 100644 --- a/gecode/flatzinc/mznlib/table_int.mzn +++ b/gecode/flatzinc/mznlib/table_int.mzn @@ -33,31 +33,31 @@ % predicate gecode_table_int(array[int] of var int: x, - array[int, int] of int: t); + array[int] of int: t); predicate gecode_table_int_reif(array[int] of var int: x, - array[int, int] of int: t, var bool: b); + array[int] of int: t, var bool: b); predicate gecode_table_int_imp(array[int] of var int: x, - array[int, int] of int: t, var bool: b); + array[int] of int: t, var bool: b); predicate table_int(array[int] of var int: x, array[int, int] of int: t) = assert (index_set_2of2(t) == index_set(x), "The second dimension of the table must equal the number of variables " ++ "in the first argument", - gecode_table_int(x,t)); + gecode_table_int(x,array1d(t))); predicate table_int_reif(array[int] of var int: x, array[int, int] of int: t, var bool: b) = assert (index_set_2of2(t) == index_set(x), "The second dimension of the table must equal the number of variables " ++ "in the first argument", - gecode_table_int_reif(x,t,b)); + gecode_table_int_reif(x,array1d(t),b)); predicate table_int_imp(array[int] of var int: x, array[int, int] of int: t, var bool: b) = assert (index_set_2of2(t) == index_set(x), "The second dimension of the table must equal the number of variables " ++ "in the first argument", - gecode_table_int_imp(x,t,b)); + gecode_table_int_imp(x,array1d(t),b));