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