@@ -12,7 +12,7 @@ let extract_axioms s =
1212 Printer.ContextObjectMap. fold fold s []
1313
1414(* TODO: compare axiom names (constants) also *)
15- let test_assumptions env sigma s ax_tys =
15+ let test_assumptions msg env sigma s ax_tys =
1616 let unify ty1 ty2 =
1717 match Reductionops. infer_conv env sigma ty1 ty2 with
1818 | Some _ -> true
@@ -23,7 +23,10 @@ let test_assumptions env sigma s ax_tys =
2323 | Printer. Axiom _ ->
2424 let ety = EConstr. of_constr ty in
2525 if List. exists (unify ety) ax_tys then ()
26- else CErrors. user_err (str " Axiom: " ++ Printer. pr_econstr_env env sigma ety)
26+ else begin
27+ Feedback. msg_notice (str (" \n <FAILED::> " ^ msg ^ " \n " ));
28+ CErrors. user_err (str " Axiom: " ++ Printer. pr_econstr_env env sigma ety)
29+ end
2730 | _ -> ()
2831 in
2932 Printer.ContextObjectMap. iter iter s
@@ -35,7 +38,7 @@ let locate r =
3538 (gr, Globnames. printable_constr_of_global gr)
3639 with Not_found -> CErrors. user_err (str " Not found: " ++ Libnames. pr_qualid r)
3740
38- let test c_ref ax_refs =
41+ let test ?( msg = " Axioms " ) c_ref ax_refs =
3942 let env = Global. env() in
4043 let sigma = Evd. from_env env in
4144 let (gr, cstr) = locate c_ref in
@@ -47,5 +50,5 @@ let test c_ref ax_refs =
4750 (fun (sigma , tys ) (_ , c ) ->
4851 let sigma, ty = Typing. type_of env sigma (EConstr. of_constr c) in
4952 sigma, ty :: tys) (sigma, [] ) ax_grs_cstrs in
50- test_assumptions env sigma assumptions ax_tys;
51- Feedback. msg_notice (str " SUCCESS " )
53+ test_assumptions msg env sigma assumptions ax_tys;
54+ Feedback. msg_notice (str ( " \n <PASSED::> " ^ msg ^ " \n " ) )
0 commit comments