Debian Codegraph @

tests/spec/unit/optional/test-opt-float-2.mzn

raw
1 /***
2 !Test
3 expected: !Result
4 solution: !Solution
5 addn: [0.0, -2.0, -1.0, 0.0, 1.0, 2.0, -2.0, -4.0, -3.0, -2.0, -1.0, 0.0, -1.0, -3.0, -2.0, -1.0, 0.0, 1.0, 0.0, -2.0, -1.0, 0.0, 1.0, 2.0, 1.0, -1.0, 0.0, 1.0, 2.0, 3.0, 2.0, 0.0, 1.0, 2.0, 3.0, 4.0]
6 subn: [null, null, null, null, null, null, -2.0, 0.0, -1.0, -2.0, -3.0, -4.0, -1.0, 1.0, 0.0, -1.0, -2.0, -3.0, 0.0, 2.0, 1.0, 0.0, -1.0, -2.0, 1.0, 3.0, 2.0, 1.0, 0.0, -1.0, 2.0, 4.0, 3.0, 2.0, 1.0, 0.0]
7 prod: [1.0, -2.0, -1.0, 0.0, 1.0, 2.0, -2.0, 4.0, 2.0, 0.0, -2.0, -4.0, -1.0, 2.0, 1.0, 0.0, -1.0, -2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, -2.0, -1.0, 0.0, 1.0, 2.0, 2.0, -4.0, -2.0, 0.0, 2.0, 4.0]
8 divn: [null, null, null, null, null, -2.0, 1.0, 2.0, -2.0, -1.0, -1.0, 0.5, 1.0, -1.0, -0.5, 1.0, -0.5, -1.0, 1.0, 0.5, 2.0, -1.0, -2.0, 2.0, 1.0]
9 gt: [true, true, true, true, false, false, true, true, false]
10 ge: [true, true, true, true, true, false, true, true, true]
11 lt: [true, true, true, true, false, true, true, false, false]
12 le: [true, true, true, true, true, true, true, false, true]
13 status: SATISFIED
14 ***/
15
16 array [1..36] of float: addn :: add_to_output = [x + y | x, y in [<>, -2.0, -1.0, 0.0, 1.0, 2.0]];
17 array [1..36] of opt float: subn :: add_to_output = [x - y | x, y in [<>, -2.0, -1.0, 0.0, 1.0, 2.0]];
18 array [1..36] of float: prod :: add_to_output = [x * y | x, y in [<>, -2.0, -1.0, 0.0, 1.0, 2.0]];
19 array [1..25] of opt float: divn :: add_to_output = [x / y | x, y in [<>, -2.0, -1.0, 1.0, 2.0]];
20
21 array [1..9] of bool: gt :: add_to_output = [ x > y | x, y in [<>, 0.0, 1.0]];
22 array [1..9] of bool: ge :: add_to_output = [ x >= y | x, y in [<>, 0.0, 1.0]];
23 array [1..9] of bool: lt :: add_to_output = [ x < y | x, y in [<>, 0.0, 1.0]];
24 array [1..9] of bool: le :: add_to_output = [ x <= y | x, y in [<>, 0.0, 1.0]];
25
26 solve satisfy;