| 1 |
/*** |
| 2 |
!Test |
| 3 |
expected: |
| 4 |
- !Result |
| 5 |
solution: !Solution |
| 6 |
inv_f1: [5, 7, 6, 8] |
| 7 |
inv_f2: [1, 3, 2, 4] |
| 8 |
- !Result |
| 9 |
solution: !Solution |
| 10 |
inv_f1: [5, 7, 6, 4] |
| 11 |
inv_f2: [1, 3, 2, 5] |
| 12 |
- !Result |
| 13 |
solution: !Solution |
| 14 |
inv_f1: [5, 7, 4, 6] |
| 15 |
inv_f2: [1, 4, 2, 5] |
| 16 |
- !Result |
| 17 |
solution: !Solution |
| 18 |
inv_f1: [5, 7, 8, 6] |
| 19 |
inv_f2: [1, 4, 2, 3] |
| 20 |
- !Result |
| 21 |
solution: !Solution |
| 22 |
inv_f1: [5, 7, 4, 4] |
| 23 |
inv_f2: [1, 5, 2, 5] |
| 24 |
- !Result |
| 25 |
solution: !Solution |
| 26 |
inv_f1: [5, 7, 4, 8] |
| 27 |
inv_f2: [1, 5, 2, 4] |
| 28 |
- !Result |
| 29 |
solution: !Solution |
| 30 |
inv_f1: [5, 7, 8, 4] |
| 31 |
inv_f2: [1, 5, 2, 3] |
| 32 |
***/ |
| 33 |
|
| 34 |
include "inverse_in_range.mzn"; |
| 35 |
|
| 36 |
%-----------------------------------------------------------------------------% |
| 37 |
% inverse |
| 38 |
%-----------------------------------------------------------------------------% |
| 39 |
array[1..4] of var 4..8: inv_f1 :: add_to_output = [5, 7, _, _]; |
| 40 |
array[5..8] of var 1..5: inv_f2 :: add_to_output = array1d(5..8, [1, _, 2, _]); |
| 41 |
|
| 42 |
constraint inverse_in_range(inv_f1, inv_f2); |
| 43 |
|
| 44 |
solve satisfy; |
| 45 |
|
| 46 |
output [ |
| 47 |
"inv_f1 = array1d(1..4, ", show(inv_f1), ");\n", |
| 48 |
"inv_f2 = array1d(5..8, ", show(inv_f2), ");\n" |
| 49 |
]; |