let pre_identification (vi_ctrs : t_vi_ctrs) (std_ls : t_equal)
(var_identif : t_partition) : t_partition =
let sub = (std_ls,FreeVar 0,[])
in
let rec help n ns tas = function
| ms::tail ->
let m = List.hd ms in
if egal sub (Var(n)) (Var(m)) then
if is_allowed var_identif n m vi_ctrs then
help n (merge ns ms) tas tail
else
raise Invalid_Var_Identif
else
help n ns (ms::tas) tail
| [] -> ((n::ns),tas)
in
let rec help2 tas = function
| (n::ns)::tail ->
let (new_nns,new_tail) = help n ns [] tail in
help2 (new_nns::tas) new_tail
| [] -> tas
| _ -> failwith ("pre_identification: var_identif is not a valid partition"^
", it contains an empty class")
in
let var_identif = help2 [] var_identif
in
if is_allowed_vi var_identif vi_ctrs then
var_identif
else
raise Invalid_Var_Identif