this repo has no description
at develop 776 B view raw
1/*** 2 @groupdef flatzinc.twoone FlatZinc builtins added in MiniZinc 2.1.0. 3 4 These functions and predicates define built-in operations of the MiniZinc language 5 that have been added in MiniZinc 2.1.0. Solvers that support these natively need 6 to include a file called redefinitions-2.1.0.mzn in their solver library that 7 redefines these predicates as builtins. 8 9*/ 10 11 12/** @group flatzinc.twoone Constrains \a a ≤ \a x ≤ \a b */ 13predicate float_in(var float: x, float: a, float: b) = 14 x >= a /\ x <= b; 15 16/** @group flatzinc.twoone Constrains \a x to take one of the values in \a as */ 17predicate float_dom(var float: x, array[int] of float: as) = 18 let { 19 array[int] of var bool: b = [float_in(x,as[2*i-1],as[2*i]) | i in 1..length(as) div 2] 20 } in exists(b);