| 1 |
/*** |
| 2 |
!Test |
| 3 |
expected: |
| 4 |
- !Result |
| 5 |
solution: !Solution |
| 6 |
x: [1, 1, 1] |
| 7 |
- !Result |
| 8 |
solution: !Solution |
| 9 |
x: [1, 1, 4] |
| 10 |
- !Result |
| 11 |
solution: !Solution |
| 12 |
x: [1, 4, 1] |
| 13 |
- !Result |
| 14 |
solution: !Solution |
| 15 |
x: [1, 4, 4] |
| 16 |
- !Result |
| 17 |
solution: !Solution |
| 18 |
x: [4, 1, 1] |
| 19 |
- !Result |
| 20 |
solution: !Solution |
| 21 |
x: [4, 1, 4] |
| 22 |
- !Result |
| 23 |
solution: !Solution |
| 24 |
x: [4, 4, 1] |
| 25 |
- !Result |
| 26 |
solution: !Solution |
| 27 |
x: [4, 4, 4] |
| 28 |
***/ |
| 29 |
|
| 30 |
% At for value_precede_ch variables. |
| 31 |
|
| 32 |
include "value_precede_chain.mzn"; |
| 33 |
|
| 34 |
array[1..3] of var 1..4: x; |
| 35 |
|
| 36 |
constraint value_precede_chain([3, 2, 1], [3, 2, 1]); |
| 37 |
constraint value_precede_chain([5, 3, 2], x); |
| 38 |
solve satisfy; |
| 39 |
output ["x = array1d(1..3, ", show(x), ");\n"]; |