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 2572df0663 Squashed 'software/gecode_base/' content from commit bbefcea214
git-subtree-dir: software/gecode_base
git-subtree-split: bbefcea214fec798a0f5acc442581984555acd21
2021-07-11 17:26:05 +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
);