Debian Codegraph @

tests/spec/unit/globals/value_precede_chain/globals_value_precede_chain_int.mzn

raw
1 /***
2 !Test
3 solvers: [gecode, chuffed]
4 expected: !Result
5 solution: !SolutionSet
6 - !Solution
7 x: [1, 1, 1]
8 - !Solution
9 x: [4, 1, 1]
10 - !Solution
11 x: [4, 1, 3]
12 - !Solution
13 x: [1, 1, 4]
14 - !Solution
15 x: [4, 1, 4]
16 - !Solution
17 x: [4, 3, 1]
18 - !Solution
19 x: [4, 3, 2]
20 - !Solution
21 x: [4, 3, 3]
22 - !Solution
23 x: [4, 3, 4]
24 - !Solution
25 x: [1, 4, 1]
26 - !Solution
27 x: [4, 4, 1]
28 - !Solution
29 x: [1, 4, 3]
30 - !Solution
31 x: [4, 4, 3]
32 - !Solution
33 x: [1, 4, 4]
34 - !Solution
35 x: [4, 4, 4]
36 options:
37 all_solutions: true
38 ***/
39
40 % A test for value_precede_chain for integer variables.
41
42 include "value_precede_chain.mzn";
43
44 array[1..3] of var 1..4: x ::add_to_output;
45
46 constraint value_precede_chain([3, 2, 1], [3, 2, 1]);
47 constraint value_precede_chain([4, 3, 2], x);
48 constraint value_precede_chain(array1d(5..7, [4, 3, 2]), x);
49 solve satisfy;
50 output ["x = array1d(1..3, ", show(x), ");\n"];