Debian Codegraph @

tests/spec/unit/globals/lex_chain/globals_lex_chain__orbitope.mzn

raw
1 /***
2 !Test
3 solvers: [gecode, cbc, scip]
4 expected:
5 - !Result
6 solution: !Solution
7 lex_members_int:
8 - 1
9 - 0
10 - 1
11 lex_members_bool:
12 - false
13 - false
14 ***/
15
16 include "lex_chain_lesseq_orbitope.mzn";
17 include "lex_chain_greatereq_orbitope.mzn";
18
19 %-----------------------------------------------------------------------------%
20 % lex_chain_..._orbitope variants
21 %-----------------------------------------------------------------------------%
22
23 array[int, int] of var 0..1: arr1 = [|
24 0, 0, _ |
25 1, 1, 0 |
26 0, 1, 0 |];
27 constraint lex_chain_lesseq_orbitope(arr1, 0);
28
29 array[int, int] of var bool: arr2 = [|
30 false, false, true |
31 _, false, false|
32 false, true, _ |];
33 constraint lex_chain_lesseq_orbitope(arr2, 2);
34
35 array[int, int] of var 0..1: arr3 = [|
36 1, 0, _ |
37 0, 1, 0 |
38 0, _, 0 |];
39 constraint lex_chain_greatereq_orbitope(arr3, 1);
40
41
42 solve satisfy;
43
44 array [int] of int: lex_members_int :: output_only :: add_to_output =
45 [fix(arr1[1, 3]), fix(arr3[1, 3]), fix(arr3[3, 2])];
46
47 array [int] of bool: lex_members_bool :: output_only :: add_to_output =
48 [fix(arr2[2, 1]), fix(arr2[3, 3])];