+ match NCicLibrary.get_obj u with
+ | _,_,_,_,NCic.Constant (_,_,Some bo, ty, _) ->
+ let rec intros = function
+ | NCic.Prod (name, s, t) ->
+ let ctx, t = intros t in
+ ctx @ [(name, (NCic.Decl s))] , t
+ | t -> [], t
+ in
+ let ctx, ity = intros ty in
+ let sty, menv, _ =
+ NCicMetaSubst.saturate ~delta:max_int [] ctx ty 0
+ in
+ let ctx, ty = intros ty in
+ let metasenv, subst =
+ try
+ NCicUnification.unify menv [] ctx ity sty
+ with
+ | NCicUnification.Uncertain msg
+ | NCicUnification.UnificationFailure msg
+ | NCicMetaSubst.MetaSubstFailure msg ->
+ prerr_endline (Lazy.force msg);
+ prerr_endline
+ (Printf.sprintf "RESULT OF UNIF\n%s\n%s == %s\n"
+ (NCicPp.ppcontext ~metasenv:menv ~subst:[] ctx)
+ (NCicPp.ppterm ~metasenv:menv ~subst:[] ~context:ctx ity)
+ (NCicPp.ppterm ~metasenv:menv ~subst:[] ~context:ctx sty));
+ [], []
+ in
+ if (NCicReduction.are_convertible
+ ~subst (fun ~subst:_ _ _ _ ->[]) ctx ity sty)
+ then
+ prerr_endline ("OK: " ^ NUri.string_of_uri u)
+ else
+ prerr_endline ("FAIL: " ^ NUri.string_of_uri u);
+ (*let inferred_ty =
+ NCicTypeChecker.typeof ~subst:[] ~metasenv:[] [] bo
+ in*)
+ | _ -> ())