this repo has no description
1%-----------------------------------------------------------------------------%
2% Constrains two arrays of int variables to represent inverse functions.
3% All the values in each array must be within the index set of the other array.
4%
5% Linear version.
6%-----------------------------------------------------------------------------%
7
8include "domain_encodings.mzn";
9
10predicate inverse(array[int] of var int: f, array[int] of var int: g) =
11 let {
12 array[int,int] of var 0..1: map_f = eq_encode(f);
13 array[int,int] of var 0..1: map_g = eq_encode(g);
14 } in forall (i in index_set(f), j in index_set(g)) (map_f[i,j] = map_g[j,i]);
15
16%-----------------------------------------------------------------------------%