+ let mk_hint (u1,_,_) (u2,_,_) =
+ let l = OCic2NCic.convert_obj u1
+ (fst (CicEnvironment.get_obj CicUniv.oblivion_ugraph u1)) in
+ let r = OCic2NCic.convert_obj u2
+ (fst (CicEnvironment.get_obj CicUniv.oblivion_ugraph u2)) in
+ match List.hd l,List.hd r with
+ | (_,_,_,_,NCic.Constant (_,_,Some l,_,_)),
+ (_,_,_,_,NCic.Constant (_,_,Some r,_,_)) ->
+ let rec aux ctx t1 t2 =
+ match t1, t2 with
+ | NCic.Lambda (n1,s1,b1), NCic.Lambda(_,s2,b2) ->
+ if NCicReduction.are_convertible ~subst:[] ~metasenv:[] ctx s1 s2
+ then aux ((n1, NCic.Decl s1) :: ctx) b1 b2
+ else None
+ | b1,b2 ->
+ if NCicReduction.are_convertible ~subst:[] ~metasenv:[] ctx b1 b2
+ then begin
+(*
+ prerr_endline ("hint: " ^ NCicPp.ppterm ~metasenv:[] ~subst:[]
+ ~context:ctx b1 ^ " === " ^ NCicPp.ppterm ~metasenv:[]
+ ~subst:[] ~context:ctx b2);
+*)
+ Some (ctx,b1,b2)
+ end else None
+ in
+ aux [] l r
+ | _ -> None
+ in
+ let hints =
+ List.fold_left
+ (fun acc (_,_,l) ->
+ acc @
+ if List.length l > 1 then
+ combine mk_hint (fun (u1,_,_) (u2,_,_) -> UriManager.eq u1 u2) l l
+ else [])
+ [] (CoercDb.to_list ())