-let _ =
- let indent = ref 0 in
-(* let do_indent () = String.make !indent ' ' in *)
- NCicTypeChecker.set_logger
+let debug = false
+let ignore_exc = false
+
+let indent = ref 0;;
+
+let logger =
+ let do_indent () = String.make !indent ' ' in
(function
| `Start_type_checking s -> ();
-(* prerr_endline (do_indent () ^ "Start: " ^ NUri.string_of_uri s); *)
+ if debug then
+ prerr_endline (do_indent () ^ "Start: " ^ NUri.string_of_uri s);
incr indent
| `Type_checking_completed s -> ();
decr indent;
-(* prerr_endline (do_indent () ^ "End: " ^ NUri.string_of_uri s) *)
- );
+ if debug then
+ prerr_endline (do_indent () ^ "End: " ^ NUri.string_of_uri s))
+;;
+
+let _ =
+ NCicTypeChecker.set_logger logger;
NCicPp.set_ppterm NCicPp.trivial_pp_term;
Helm_registry.load_from "conf.xml";
let alluris =
in
let who_uses u =
uniq (List.map (fun (uri,_) -> UriManager.strip_xpointer uri)
- (MetadataDeps.inverse_deps ~dbd u))
- in
+ (MetadataDeps.inverse_deps ~dbd u)) in
let roots_alluris =
- let rec fix acc l =
- let acc, todo =
- List.fold_left (fun (acc,todo) x ->
- let w = who_uses x in
- if w = [] then (x::acc,todo) else (acc,uniq (todo@w)))
- (acc,[]) l
- in
- if todo = [] then uniq acc else fix acc todo
- in
- (fix [] alluris)
+ let rec fix acc l =
+ let acc, todo =
+ List.fold_left (fun (acc,todo) x ->
+ let w = who_uses x in
+ if w = [] then (x::acc,todo) else (acc,uniq (todo@w)))
+ (acc,[]) l
+ in
+ if todo = [] then uniq acc else fix acc todo
+ in
+ (fix [] alluris)
in
+(*
+ BARO!
+ let roots_alluris = alluris in *)
prerr_endline "generating Coq graphs...";
CicEnvironment.set_trust (fun _ -> false);
List.iter (fun u ->
- prerr_endline (" - " ^ UriManager.string_of_uri u);
- try
- ignore(CicTypeChecker.typecheck u);
- with
- | CicTypeChecker.AssertFailure s
- | CicTypeChecker.TypeCheckerFailure s -> prerr_endline (Lazy.force s)
- ) roots_alluris;
+ prerr_endline (" - " ^ UriManager.string_of_uri u);
+ try
+ ignore(CicTypeChecker.typecheck u);
+ with
+ | CicTypeChecker.AssertFailure s
+ | CicTypeChecker.TypeCheckerFailure s -> prerr_endline (Lazy.force s)
+ ) roots_alluris;
prerr_endline "loading...";
List.iter
(fun u ->
List.iter (fun uu ->
let uu= NUri.nuri_of_ouri uu in
indent := 0;
-(* prerr_endline ("************* INIZIO **************** " ^ NUri.string_of_uri uu); *)
+ logger (`Start_type_checking uu);
let _,o = NCicEnvironment.get_obj uu in
-(* prerr_endline (NCicPp.ppobj o); *)
try
NCicTypeChecker.typecheck_obj o;
-(* prerr_endline ("************* FINE ****************" ^ NUri.string_of_uri uu); *)
+ logger (`Type_checking_completed uu);
with
| NCicTypeChecker.AssertFailure s
| NCicTypeChecker.TypeCheckerFailure s as e ->
-(* prerr_endline ("Obj: " ^ NCicPp.ppobj o); *)
- prerr_endline ("######### " ^ Lazy.force s); raise e
+ prerr_endline ("######### " ^ Lazy.force s);
+ if not ignore_exc then raise e
| CicEnvironment.Object_not_found s ->
- prerr_endline ("Obj not found: " ^ UriManager.string_of_uri s);
+ prerr_endline ("Obj not found: " ^ UriManager.string_of_uri s)
)
alluris;
NCicEnvironment.invalidate ();
Gc.compact ();
HExtlib.profiling_enabled := true;
+ NCicTypeChecker.set_logger (fun _ -> ());
prerr_endline "typechecking, first with the new and then with the old kernel";
let prima = Unix.gettimeofday () in
List.iter