Debian Codegraph @

tests/spec/unit/regression/bug347.mzn

raw
1 /***
2 !Test
3 expected:
4 - !Result
5 solution: !Solution
6 execution_unit_1000_3: 0
7 execution_unit_1000_4: 0
8 uav1: 0
9 - !Result
10 solution: !Solution
11 execution_unit_1000_3: 1
12 execution_unit_1000_4: 1
13 uav1: 1
14 - !Result
15 solution: !Solution
16 execution_unit_1000_3: 2
17 execution_unit_1000_4: 2
18 uav1: 2
19 - !Result
20 solution: !Solution
21 execution_unit_1000_3: 3
22 execution_unit_1000_4: 3
23 uav1: 3
24 - !Result
25 solution: !Solution
26 execution_unit_1000_3: 4
27 execution_unit_1000_4: 4
28 uav1: 4
29 - !Result
30 solution: !Solution
31 execution_unit_1000_3: 5
32 execution_unit_1000_4: 5
33 uav1: 5
34 - !Result
35 solution: !Solution
36 execution_unit_1000_3: 6
37 execution_unit_1000_4: 6
38 uav1: 6
39 ***/
40
41 % Regression test for bug #347: mzn2fzn's FlatZinc optimiser was incorrectly
42 % optimising away some of the equality constraints involving uav1 below.
43
44 include "alldifferent.mzn";
45 var 0..6: uav1;
46 var 0..6: uav2;
47 var 0..6: uav3;
48 var 0..6: uav4;
49 var 0..6: execution_unit_1000_3;
50 var 0..6: execution_unit_1000_4;
51 constraint alldifferent([uav1, uav2, uav3, uav4]);
52 constraint execution_unit_1000_3 = uav1;
53 constraint execution_unit_1000_4 = uav1;
54 solve satisfy;
55 output [
56 "uav1 = ", show(uav1), ";\n",
57 "uav2 = ", show(uav2), ";\n",
58 "uav3 = ", show(uav3), ";\n",
59 "uav4 = ", show(uav4), ";\n"
60 ];