tests/spec/unit/regression/github_728.mzn
raw| 1 | /*** |
| 2 | !Test |
| 3 | solvers: [gecode] |
| 4 | expected: |
| 5 | - !Result |
| 6 | solution: !Solution |
| 7 | wanted: !!set {1} |
| 8 | - !Result |
| 9 | solution: !Solution |
| 10 | wanted: !!set {4} |
| 11 | ***/ |
| 12 | |
| 13 | enum color = {red, green, blue}; |
| 14 | set of int: shirt_ids = 1..5; |
| 15 | array[shirt_ids] of color: shirts = [red, green, blue, red, green]; |
| 16 | var set of shirt_ids: wanted; |
| 17 | constraint forall (c in color)(count(i in wanted)(shirts[i] = c) = (c = red)); |
| 18 | solve satisfy; |