tests/spec/unit/general/array_union_intersect_enum.mzn
raw| 1 | /*** |
| 2 | !Test |
| 3 | solvers: [gecode] |
| 4 | expected: !Result |
| 5 | solution: !Solution |
| 6 | x: [!!set {A}, !!set {B}, !!set {C}] |
| 7 | ***/ |
| 8 | |
| 9 | enum Foo = {A, B, C}; |
| 10 | array [1..3] of var set of Foo: x; |
| 11 | var set of Foo: x_union = array_union(x); |
| 12 | var set of Foo: x_intersection = array_intersect(x); |
| 13 | |
| 14 | constraint forall (x_i in x) (card(x_i) = 1); |
| 15 | constraint x_union = Foo; |
| 16 | constraint x_intersection = {}; |
| 17 | constraint forall (i in 1..2) (min(x[i]) < min(x[i + 1])); |