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/gecode/flatzinc/mznlib/fzn_disjunctive_strict.mzn
Jip J. Dekker 1d9faf38de Squashed 'software/gecode/' content from commit 313e8764
git-subtree-dir: software/gecode
git-subtree-split: 313e87646da4fc2752a70e83df16d993121a8e40
2021-06-16 14:02:33 +10:00

16 lines
603 B
MiniZinc

include "fzn_cumulative.mzn";
predicate fzn_disjunctive_strict(array[int] of var int: s,
array[int] of var int: d) =
assert(index_set(s) == index_set(d),
"disjunctive: the array arguments must have identical index sets",
forall (i in index_set(d)) (d[i] >= 0) /\
if forall (i in index_set(d)) (is_fixed(d[i])) then
fzn_cumulative(s,d,array1d(index_set(d),[1 | i in index_set(d)]),1)
else
forall (i,j in index_set(d) where i<j) (
s[i]+d[i] <= s[j] \/ s[j]+d[j] <= s[i]
)
endif
);