this repo has no description
at develop 1.0 kB view raw
1%-----------------------------------------------------------------------------% 2% Requires that the array 'x' is strictly lexicographically less than array 'y'. 3% Compares them from first to last element, regardless of indices 4%-----------------------------------------------------------------------------% 5 6predicate fzn_lex_less_float_reif(array[int] of var float: x, 7 array[int] of var float: y, 8 var bool: c) = 9 let { int: lx = min(index_set(x)), 10 int: ux = max(index_set(x)), 11 int: ly = min(index_set(y)), 12 int: uy = max(index_set(y)), 13 int: size = max(ux - lx, uy - ly), 14 array[0..size+1] of var bool: b } 15 in 16 (c <-> b[0]) 17 /\ 18 forall(i in 0..size) ( 19 b[i] = ( x[lx + i] <= y[ly + i] 20 /\ 21 (x[lx + i] < y[ly + i] \/ b[i+1]) ) 22 ) 23 /\ 24 b[size + 1] = (ux - lx < uy - ly); 25 26%-----------------------------------------------------------------------------%