tests/spec/unit/output/test_bug_975.mzn
raw| 1 | /*** |
| 2 | !Test |
| 3 | solvers: [gecode] |
| 4 | options: |
| 5 | all_solutions: true |
| 6 | expected: !Result |
| 7 | status: ALL_SOLUTIONS |
| 8 | solution: !SolutionSet |
| 9 | - !Solution |
| 10 | x : [1, 1] |
| 11 | y : 4 |
| 12 | - !Solution |
| 13 | x : [2, 1] |
| 14 | y : 3 |
| 15 | - !Solution |
| 16 | x : [1, 2] |
| 17 | y : 3 |
| 18 | - !Solution |
| 19 | x : [2, 2] |
| 20 | y : 2 |
| 21 | ***/ |
| 22 | |
| 23 | array[1..2] of int: a = [2,1]; |
| 24 | array[1..2] of 1..3: b = [1,2]; |
| 25 | array[1..2] of var 1..2: x; |
| 26 | function var int: f(int: t) = a[b[x[t]]]; |
| 27 | var int: y ::output = sum(t in 1..2) (f(t)); |