Debian Codegraph @

tests/spec/unit/optional/test_if_then_else_var_opt_bool.mzn

raw
1 /***
2 !Test
3 solvers: [gecode, chuffed]
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: false
17 - !Solution
18 a: [false, true, true]
19 x: true
20 ***/
21
22 array [1..3] of var bool: a :: add_to_output;
23 array [1..3] of var opt bool: b :: add_to_output;
24
25 var opt bool: x :: add_to_output;
26
27 constraint a[3];
28 constraint fzn_if_then_else_var_opt_bool(a, b, x);
29
30 constraint absent(b[1]) /\ occurs(b[2]) /\ occurs(b[3]);
31 constraint b[2] > b[3];