let build_increasing_index_cstrs prec_cstrs per_cstrs size_cstrs =
let ( ++ ) = Integer_var_set.union in
let vars_prec = vars_of_linear_constraints prec_cstrs in
let vars_per = vars_of_linear_constraints per_cstrs in
let vars_size = vars_of_linear_constraints size_cstrs in
let iof_vars =
Integer_var_set.filter
(function
| Iof _ -> true
| Size _ -> false)
(vars_prec ++ vars_per ++ vars_size)
in
let rec iter iof_vars =
if iof_vars = Integer_var_set.empty then []
else
match Integer_var_set.min_elt iof_vars with
| Size _ -> assert false
| Iof (c_n, _) ->
let iof_c_n_vars, iof_others_vars =
Integer_var_set.partition
(fun var ->
match var with
| Iof (c_n', _) when c_n' = c_n -> true
| _ -> false)
iof_vars
in
build_increasing_index_cstrs_of_c_n iof_c_n_vars @
iter iof_others_vars
in
iter iof_vars