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 3e72b0e857 Squashed 'software/gecode_on_record/' content from commit 37ed9bda4
git-subtree-dir: software/gecode_on_record
git-subtree-split: 37ed9bda495ea87e63217c19a374b5a93bb0078e
2021-06-16 14:03:52 +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
);