Debian Codegraph @

tests/spec/unit/general/pow_2.mzn

raw
1 /***
2 --- !Test
3 solvers: [gecode]
4 options:
5 all_solutions: true
6 -D: x = -2..2; y = 0
7 expected: !Result
8 solution: !SolutionSet
9 - !Solution
10 b: -2
11 z: 1
12 - !Solution
13 b: -1
14 z: 1
15 - !Solution
16 b: 0
17 z: 1
18 - !Solution
19 b: 1
20 z: 1
21 - !Solution
22 b: 2
23 z: 1
24 --- !Test
25 solvers: [gecode]
26 options:
27 all_solutions: true
28 -D: x = -2..2; y = 1
29 expected: !Result
30 solution: !SolutionSet
31 - !Solution
32 b: -2
33 z: -2
34 - !Solution
35 b: -1
36 z: -1
37 - !Solution
38 b: 0
39 z: 0
40 - !Solution
41 b: 1
42 z: 1
43 - !Solution
44 b: 2
45 z: 2
46 --- !Test
47 solvers: [gecode]
48 options:
49 all_solutions: true
50 -D: x = 0..1; y = 2
51 expected: !Result
52 solution: !SolutionSet
53 - !Solution
54 b: 0
55 z: 0
56 - !Solution
57 b: 1
58 z: 1
59 --- !Test
60 solvers: [gecode]
61 options:
62 all_solutions: true
63 -D: x = -1..1; y = 3
64 expected: !Result
65 solution: !SolutionSet
66 - !Solution
67 b: -1
68 z: -1
69 - !Solution
70 b: 0
71 z: 0
72 - !Solution
73 b: 1
74 z: 1
75 --- !Test
76 solvers: [gecode]
77 options:
78 all_solutions: true
79 -D: x = 1..3; y = -1
80 expected: !Result
81 solution: !SolutionSet
82 - !Solution
83 b: 1
84 z: 1
85 - !Solution
86 b: 2
87 z: 0
88 - !Solution
89 b: 3
90 z: 0
91 --- !Test
92 solvers: [gecode]
93 options:
94 all_solutions: true
95 -D: x = 2..3; y = 2
96 expected: !Result
97 solution: !SolutionSet
98 - !Solution
99 b: 2
100 z: 4
101 - !Solution
102 b: 3
103 z: 9
104 --- !Test
105 solvers: [gecode]
106 options:
107 all_solutions: true
108 -D: x = -1..2; y = -2
109 expected: !Result
110 solution: !SolutionSet
111 - !Solution
112 b: -1
113 z: 1
114 - !Solution
115 b: 1
116 z: 1
117 - !Solution
118 b: 2
119 z: 0
120 ***/
121
122 % Test for pow with var base, par exponent
123
124 set of int: x;
125 var x: b;
126 int: y;
127 var int: z;
128
129 constraint z = pow(b, y);