);
res
;;
+
+
+let extract_differing_subterms t1 t2 =
+ let module C = Cic in
+ let rec aux t1 t2 =
+ match t1, t2 with
+ | C.Appl l1, C.Appl l2 when (List.length l1) <> (List.length l2) ->
+ [(t1, t2)]
+ | C.Appl (h1::tl1), C.Appl (h2::tl2) ->
+ let res = List.concat (List.map2 aux tl1 tl2) in
+ if h1 <> h2 then
+ if res = [] then [(h1, h2)] else [(t1, t2)]
+ else
+ if List.length res > 1 then [(t1, t2)] else res
+ | t1, t2 ->
+ if t1 <> t2 then [(t1, t2)] else []
+ in
+ let res = aux t1 t2 in
+ match res with
+ | hd::[] -> Some hd
+ | _ -> None
+;;