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.
on-restart-benchmarks/share/minizinc/std/fzn_strict_lex2_reif.mzn
Jip J. Dekker f2a1c4e389 Squashed 'software/mza/' content from commit f970a59b17
git-subtree-dir: software/mza
git-subtree-split: f970a59b177c13ca3dd8aaef8cc6681d83b7e813
2021-07-11 16:34:30 +10:00

23 lines
693 B
MiniZinc

include "lex_less.mzn";
predicate fzn_strict_lex2_reif(array[int, int] of var int: x, var bool: b) =
let {
int: lbx1 = min(index_set_1of2(x)),
int: ubx1 = max(index_set_1of2(x)),
int: lbx2 = min(index_set_2of2(x)),
int: ubx2 = max(index_set_2of2(x))
} in b <-> (
forall(i in lbx1 + 1 .. ubx1) (
lex_less([x[i - 1, j] | j in index_set_2of2(x)],
[x[i, j] | j in index_set_2of2(x)]
)
)
/\
forall(j in lbx2 + 1 .. ubx2) (
lex_less([x[i, j - 1] | i in index_set_1of2(x)],
[x[i, j ] | i in index_set_1of2(x)]
)
)
);