Debian Codegraph @

tests/spec/unit/types/tuple_subtyping.mzn

raw
1 /***
2 !Test
3 solvers: [gecode]
4 expected: !Result
5 status: SATISFIED
6 solution: !Solution
7 single: [1]
8 double: [1.0, [1,2,3]]
9 tupId: [1, 0.0]
10 tupExpr: [-5.0, 0]
11 arr1: [[5, 1.0], [1, -1.0]]
12 arr2: [[1, 0], [1, 0]]
13 arrId: [[1.0, 0.0], [1.0, 0.0]]
14 arrExpr: [[1.0, 0.0], [2.0, 1.0], [3.0, 0.0]]
15 ***/
16
17 tuple(int): single ::output = (true,);
18 tuple(float, array[int] of int): double ::output = (1, 1..3);
19
20 tuple(bool, bool): i1 = (true, false);
21 tuple(int, float): tupId ::output = i1;
22
23 function tuple(int, bool): tupFn() = (-5, false);
24 tuple(float, int): tupExpr ::output = tupFn();
25
26 array[1..2] of tuple(int, float): arr1 ::output = [(5, 1.0), (true, -1)];
27 array[1..2] of tuple(int, int): arr2 ::output = [(true, 0), (1, false)];
28
29 array[_] of tuple(float, float): arrId ::output = arr2;
30
31 function array[3..5] of tuple(int, bool): arrFn() = array1d(3..5, [
32 (1, false),
33 (2, true),
34 (3, false),
35 ]);
36 array[_] of tuple(float, float): arrExpr ::output = arrFn();