+ SameEquivalenceClass ((nodes,inf,sup) as set,((r,_,leq_d,geq_d) as node_to_be_deleted),node')->
+prerr_endline ("SAMEEQCLASS: " ^ string_of_cop r);
+(
+let _,inf,sup = set in
+if not (List.for_all (fun ((_,_,_,geq) as node) -> !geq = [] && let rec check_sups = function [] -> true | (_,_,leq,_) as node::tl -> if !leq = [] then List.exists (fun n -> n===node) sup && check_sups tl else check_sups (!leq@tl) in check_sups [node]) inf) then (ps_of_set ([],None,[]) set; assert false);
+if not (List.for_all (fun ((_,_,leq,_) as node) -> !leq = [] && let rec check_infs = function [] -> true | (_,_,_,geq) as node::tl -> if !geq = [] then List.exists (fun n -> n===node) inf && check_infs tl else check_infs (!geq@tl) in check_infs [node]) sup) then ((*ps_of_set ([],None,[]) set;*) assert false);
+);
+ let rec clean inf sup res =
+ function
+ [] -> inf,sup,res
+ | node::tl when node===node_to_be_deleted ->
+ clean inf sup res tl
+ | (repr',others,leq,geq) as node::tl ->
+ leq :=
+ List.fold_right
+ (fun node l ->
+ if node_to_be_deleted <=> node then
+ node::l
+ else
+ !leq_d@l
+ ) !leq [];
+ let sup = if !leq = [] then sup@@node else sup in
+ geq :=
+ List.fold_right
+ (fun node l ->
+ if node_to_be_deleted <=> node then
+ node::l
+ else
+ !geq_d@l
+ ) !geq [];
+ let inf = if !geq = [] then inf@@node else inf in
+ if node===node' then
+ clean inf sup ((repr',others@[candidate],leq,geq)::res) tl
+ else
+ clean inf sup (node::res) tl
+ in
+ let inf,sup,nodes = clean inf sup [] nodes in
+ let inf = remove node_to_be_deleted inf in
+ let sup = remove node_to_be_deleted sup in
+let set = nodes,inf,sup in
+(
+let _,inf,sup = set in
+if not (List.for_all (fun ((_,_,_,geq) as node) -> !geq = [] && let rec check_sups = function [] -> true | (_,_,leq,_) as node::tl -> if !leq = [] then List.exists (fun n -> n===node) sup && check_sups tl else check_sups (!leq@tl) in check_sups [node]) inf) then (ps_of_set ([],None,[]) set; assert false);
+if not (List.for_all (fun ((_,_,leq,_) as node) -> !leq = [] && let rec check_infs = function [] -> true | (_,_,_,geq) as node::tl -> if !geq = [] then List.exists (fun n -> n===node) inf && check_infs tl else check_infs (!geq@tl) in check_infs [node]) sup) then (ps_of_set ([],None,[]) set; assert false);
+);
+ news,(nodes,inf,sup)