| 1 |
/*** |
| 2 |
!Test |
| 3 |
expected: |
| 4 |
- !Result |
| 5 |
solution: !Solution |
| 6 |
inc_avb: [true, false, false, false, false] |
| 7 |
inc_avi: [5, 3, 3, 1, 1] |
| 8 |
- !Result |
| 9 |
solution: !Solution |
| 10 |
inc_avb: [true, false, false, false, false] |
| 11 |
inc_avi: [5, 5, 3, 1, 1] |
| 12 |
- !Result |
| 13 |
solution: !Solution |
| 14 |
inc_avb: [true, false, false, false, false] |
| 15 |
inc_avi: [5, 5, 3, 3, 1] |
| 16 |
***/ |
| 17 |
|
| 18 |
include "decreasing.mzn"; |
| 19 |
|
| 20 |
%-----------------------------------------------------------------------------% |
| 21 |
% decreasing |
| 22 |
%-----------------------------------------------------------------------------% |
| 23 |
|
| 24 |
array[1..5] of var -100..100: inc_avi ::add_to_output = [5, _, 3, _, 1]; |
| 25 |
array[1..5] of var bool: inc_avb ::add_to_output = [true, false, _, _, _]; |
| 26 |
%array[1..8] of var set of 1..3: inc_avsi; % XXX :: is_output |
| 27 |
|
| 28 |
constraint decreasing(inc_avi); |
| 29 |
constraint decreasing(inc_avb); |
| 30 |
% XXX: comparisons not implemented for sets |
| 31 |
%constraint increasing(inc_avsi); |
| 32 |
|
| 33 |
solve satisfy; |
| 34 |
|
| 35 |
output [ |
| 36 |
"inc_avb = array1d(1..5, ", show(inc_avb), ");\n", |
| 37 |
"inc_avi = array1d(1..5, ", show(inc_avi), ");\n" |
| 38 |
]; |