1
0
This repository has been archived on 2025-03-06. You can view files and clone it, but cannot push or open issues or pull requests.

20 lines
665 B
MiniZinc

include "fzn_inverse.mzn";
include "fzn_inverse_reif.mzn";
include "analyse_all_different.mzn";
/** @group globals.channeling
Constrains two arrays of int variables, \a f and \a invf, to represent
inverse functions. All the values in each array must be within the index
set of the other array.
*/
predicate inverse(array[int] of var int: f,
array[int] of var int: invf) =
analyse_all_different(f) /\
analyse_all_different(invf) /\
fzn_inverse(f, invf);
predicate inverse_reif(array[int] of var int: f,
array[int] of var int: invf,
var bool: b) =
fzn_inverse_reif(f, invf, b);