3 (* let do_indent () = String.make !indent ' ' in *)
4 NCicTypeChecker.set_logger
6 | `Start_type_checking s -> ();
7 (* prerr_endline (do_indent () ^ "Start: " ^ NUri.string_of_uri s);
10 | `Type_checking_completed s -> ();
13 prerr_endline (do_indent () ^ "End: " ^ NUri.string_of_uri s)
16 NCicPp.set_ppterm NCicPp.trivial_pp_term;
17 Helm_registry.load_from "conf.xml";
20 let s = Sys.argv.(1) in
21 if s = "-alluris" then
23 let uri_re = Str.regexp ".*\\(ind\\|con\\)$" in
24 let uris = Http_getter.getalluris () in
25 let alluris = List.filter (fun u -> Str.string_match uri_re u 0) uris in
26 let oc = open_out "alluris.txt" in
27 List.iter (fun s -> output_string oc (s^"\n")) alluris;
32 with Invalid_argument _ ->
34 let ic = open_in "alluris.txt" in
35 try while true do r := input_line ic :: !r; done; []
40 (fun u -> try Some (NUri.nuri_of_ouri (UriManager.uri_of_string u)) with _
43 prerr_endline "caching objects";
44 HExtlib.profiling_enabled := false;
47 (* prerr_endline ("************* INIZIO **************** " ^ NUri.string_of_uri uu); *)
48 let _,o = NCicEnvironment.get_obj uu in
50 NCicTypeChecker.typecheck_obj o;
51 (* prerr_endline ("************* FINE ****************" ^ NUri.string_of_uri uu); *)
53 | NCicTypeChecker.AssertFailure s
54 | NCicTypeChecker.TypeCheckerFailure s as e ->
55 (* prerr_endline ("Obj: " ^ NCicPp.ppobj o); *)
56 prerr_endline ("######### " ^ Lazy.force s); raise e
57 | CicEnvironment.Object_not_found s ->
58 prerr_endline ("Obj not found: " ^ UriManager.string_of_uri s);
61 NCicEnvironment.invalidate ();
63 HExtlib.profiling_enabled := true;
64 prerr_endline "typechecking, first with the new and then with the old kernel";
65 let prima = Unix.gettimeofday () in
69 NCicTypeChecker.typecheck_obj (snd (NCicEnvironment.get_obj u)))
71 let dopo = Unix.gettimeofday () in
73 let dopo2 = Unix.gettimeofday () in
74 Printf.eprintf "NEW typing: %3.2f, gc: %3.2f\n%!" (dopo -. prima) (dopo2 -. dopo);
75 CicEnvironment.invalidate ();
76 let alluris = List.map NUri.ouri_of_nuri alluris in
78 let prima = Unix.gettimeofday () in
79 List.iter (fun u -> ignore (CicTypeChecker.typecheck u)) alluris;
80 let dopo = Unix.gettimeofday () in
82 let dopo2 = Unix.gettimeofday () in
83 Printf.eprintf "OLD typing: %3.2f, gc: %3.2f\n%!" (dopo -. prima) (dopo2 -. dopo)