let to_list s =
let eq (x1,y1) (x2,y2) =
(Term.eq x1 x2 && Term.eq y1 y2) ||
(Term.eq x1 y2 && Term.eq y1 x2)
in
let mem (x,y) = List.exists (eq (x,y)) in
Term.Map.fold
(fun x ys acc ->
Term.Set.fold
(fun y acc ->
if mem (x, y) acc then acc else (x, y) :: acc)
ys acc)
s []