tests/spec/unit/optional/test_if_then_else_opt_float.mzn
raw| 1 | /*** |
| 2 | !Test |
| 3 | solvers: [gecode] |
| 4 | options: |
| 5 | all_solutions: true |
| 6 | expected: !Result |
| 7 | solution: !SolutionSet |
| 8 | - !Solution |
| 9 | a: [true, false, true] |
| 10 | x: null |
| 11 | - !Solution |
| 12 | a: [true, true, true] |
| 13 | x: null |
| 14 | - !Solution |
| 15 | a: [false, false, true] |
| 16 | x: 2.4 |
| 17 | - !Solution |
| 18 | a: [false, true, true] |
| 19 | x: 1.2 |
| 20 | ***/ |
| 21 | |
| 22 | array [1..3] of var bool: a :: add_to_output; |
| 23 | |
| 24 | var opt {1.2, 2.4}: x :: add_to_output; |
| 25 | |
| 26 | constraint a[3]; |
| 27 | constraint fzn_if_then_else_opt_float(a, [<>, 1.2, 2.4], x) :: mzn_break_here; |