Debian Codegraph @

tests/spec/unit/types/alias.mzn

raw
1 /***
2 !Test
3 solvers: [gecode]
4 expected: !Result
5 status: SATISFIED
6 solution: !Solution
7 x: 3
8 y: [null, 1]
9 tup: [2, true]
10 tuptup: [2, true, 2, true]
11 ***/
12 type MyInt = int;
13 MyInt: x ::output = 3;
14
15 type MyVarInt = var 1..1;
16 type AliasToMyVarInt = MyVarInt;
17 array[1..2] of opt AliasToMyVarInt: y ::output;
18 constraint absent(y[1]) > absent(y[2]);
19
20 type MyTuple = tuple(1..2, bool);
21 var MyTuple: tup ::output;
22 constraint tup.2 <-> (tup.1 mod 2 = 0);
23 constraint tup.2;
24
25 var MyTuple ++ var MyTuple: tuptup ::output = tup ++ tup;
26
27 type DubTup ::output = MyTuple ++ tuple(float, int);
28 DubTup: dubtup = (1, false, 3.0, 2);