| 1 |
/*** |
| 2 |
!Test |
| 3 |
solvers: [gecode, chuffed] |
| 4 |
options: |
| 5 |
all_solutions: true |
| 6 |
expected: !Result |
| 7 |
solution: !SolutionSet |
| 8 |
- !Solution |
| 9 |
x: [!!set {1}, !Range 1..2] |
| 10 |
- !Solution |
| 11 |
x: [!!set {}, !Range 1..2] |
| 12 |
- !Solution |
| 13 |
x: [!Range 1..2, !!set {1}] |
| 14 |
- !Solution |
| 15 |
x: [!!set {1}, !!set {1}] |
| 16 |
- !Solution |
| 17 |
x: [!!set {2}, !!set {1}] |
| 18 |
- !Solution |
| 19 |
x: [!!set {}, !!set {1}] |
| 20 |
- !Solution |
| 21 |
x: [!!set {1}, !!set {2}] |
| 22 |
- !Solution |
| 23 |
x: [!Range 1..2, !!set {}] |
| 24 |
- !Solution |
| 25 |
x: [!!set {1}, !!set {}] |
| 26 |
***/ |
| 27 |
|
| 28 |
include "global_cardinality.mzn"; |
| 29 |
|
| 30 |
constraint global_cardinality([{1}, 0..2, 1..4], [1, 2, 3], [3, 2, 1]); |
| 31 |
|
| 32 |
array [1..2] of var set of 1..2: x; |
| 33 |
constraint global_cardinality(x, [1, 2], [1, 0], [2, 1]); |
| 34 |
|
| 35 |
solve satisfy; |