| 1 |
/*** |
| 2 |
!Test |
| 3 |
expected: |
| 4 |
- !Error |
| 5 |
- !Result # TODO: Remove when bug is fixed |
| 6 |
status: SATISFIED |
| 7 |
***/ |
| 8 |
|
| 9 |
% Regression test for bug #220. The assignment of the let-variable 'capacity' |
| 10 |
% below should result in an error message being produced during flattening |
| 11 |
% because there are different array indexes on the LHS and RHS. |
| 12 |
% mzn2fzn 1.3.1 and before do not detect this and instead produced an array |
| 13 |
% with an incorrect index set. |
| 14 |
|
| 15 |
int: K = 3; |
| 16 |
int: R = 3; |
| 17 |
|
| 18 |
constraint |
| 19 |
forall ( k in 1..K, j in 1..R) |
| 20 |
(let { |
| 21 |
array[0..K] of int: capacity = [100000] ++ [k | k in 1..K] |
| 22 |
} |
| 23 |
in |
| 24 |
trace( show(capacity) ++ " " ++ show(min(index_set(capacity))) ++"\n", |
| 25 |
true) |
| 26 |
); |
| 27 |
|
| 28 |
solve satisfy; |