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/redefinitions-2.1.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

21 lines
776 B
MiniZinc

/***
@groupdef flatzinc.twoone FlatZinc builtins added in MiniZinc 2.1.0.
These functions and predicates define built-in operations of the MiniZinc language
that have been added in MiniZinc 2.1.0. Solvers that support these natively need
to include a file called redefinitions-2.1.0.mzn in their solver library that
redefines these predicates as builtins.
*/
/** @group flatzinc.twoone Constrains \a a ≤ \a x ≤ \a b */
predicate float_in(var float: x, float: a, float: b) =
x >= a /\ x <= b;
/** @group flatzinc.twoone Constrains \a x to take one of the values in \a as */
predicate float_dom(var float: x, array[int] of float: as) =
let {
array[int] of var bool: b = [float_in(x,as[2*i-1],as[2*i]) | i in 1..length(as) div 2]
} in exists(b);