| 1 |
/*** |
| 2 |
!Test |
| 3 |
solvers: [gecode, chuffed] |
| 4 |
expected: !Result |
| 5 |
solution: !SolutionSet |
| 6 |
- !Solution |
| 7 |
x: [1, 1, 3] |
| 8 |
- !Solution |
| 9 |
x: [1, 3, 3] |
| 10 |
- !Solution |
| 11 |
x: [1, 4, 3] |
| 12 |
- !Solution |
| 13 |
x: [3, 1, 3] |
| 14 |
- !Solution |
| 15 |
x: [3, 3, 3] |
| 16 |
- !Solution |
| 17 |
x: [3, 4, 3] |
| 18 |
- !Solution |
| 19 |
x: [4, 1, 3] |
| 20 |
- !Solution |
| 21 |
x: [4, 2, 3] |
| 22 |
- !Solution |
| 23 |
x: [4, 3, 3] |
| 24 |
- !Solution |
| 25 |
x: [4, 4, 3] |
| 26 |
options: |
| 27 |
all_solutions: true |
| 28 |
***/ |
| 29 |
|
| 30 |
% A test for the integer version of value_precede/3. |
| 31 |
|
| 32 |
include "value_precede.mzn"; |
| 33 |
|
| 34 |
array[1..3] of var 1..4: x ::add_to_output; |
| 35 |
|
| 36 |
constraint value_precede(19, 10, [1, 3, 5, 19, 3, 10]); |
| 37 |
constraint value_precede(4, 3, [1, 2, 1, 2, 5]); % s and t not in x. |
| 38 |
constraint value_precede(4, 2, x) /\ x[3] = 3; |
| 39 |
|
| 40 |
solve satisfy; |
| 41 |
|
| 42 |
output ["x = array1d(1..3, ", show(x), ");\n"]; |