2 NCicTypeChecker.set_logger
4 | `Start_type_checking s -> ()
5 (* prerr_endline ("Start: " ^ NUri.string_of_uri s) *)
6 | `Type_checking_completed s -> ()
7 (* prerr_endline ("End: " ^ NUri.string_of_uri s) *)
9 NCicPp.set_ppterm NCicPp.trivial_pp_term;
10 Helm_registry.load_from "conf.xml";
13 let s = Sys.argv.(1) in
14 if s = "-alluris" then
16 let uri_re = Str.regexp ".*\\(ind\\|var\\|con\\)$" in
17 let uris = Http_getter.getalluris () in
18 let alluris = List.filter (fun u -> Str.string_match uri_re u 0) uris in
19 let oc = open_out "alluris.txt" in
20 List.iter (fun s -> output_string oc (s^"\n")) alluris;
25 with Invalid_argument _ ->
27 let ic = open_in "alluris.txt" in
28 try while true do r := input_line ic :: !r; done; []
33 (fun u -> try Some (NUri.nuri_of_ouri (UriManager.uri_of_string u)) with _
36 prerr_endline "caching objects";
38 (* prerr_endline ("************* INIZIO **************** " ^ NUri.string_of_uri uu); *)
39 let _,o = NCicEnvironment.get_obj uu in
41 NCicTypeChecker.typecheck_obj o;
42 (* prerr_endline ("************* FINE ****************" ^ NUri.string_of_uri uu); *)
44 | NCicTypeChecker.AssertFailure s
45 | NCicTypeChecker.TypeCheckerFailure s as e ->
46 (* prerr_endline ("Obj: " ^ NCicPp.ppobj o); *)
47 prerr_endline (Lazy.force s); raise e
48 | CicEnvironment.Object_not_found s ->
49 prerr_endline ("Obj not found: " ^ UriManager.string_of_uri s);
52 NCicEnvironment.invalidate ();
54 prerr_endline "typechecking, first with the new and then with the old kernel";
55 let prima = Unix.gettimeofday () in
57 (fun u -> NCicTypeChecker.typecheck_obj (snd (NCicEnvironment.get_obj u)))
59 let dopo = Unix.gettimeofday () in
61 let dopo2 = Unix.gettimeofday () in
62 Printf.eprintf "NEW typing: %3.2f, gc: %3.2f\n%!" (dopo -. prima) (dopo2 -. dopo);
63 CicEnvironment.invalidate ();
64 let alluris = List.map NUri.ouri_of_nuri alluris in
66 let prima = Unix.gettimeofday () in
67 List.iter (fun u -> ignore (CicTypeChecker.typecheck u)) alluris;
68 let dopo = Unix.gettimeofday () in
70 let dopo2 = Unix.gettimeofday () in
71 Printf.eprintf "OLD typing: %3.2f, gc: %3.2f\n%!" (dopo -. prima) (dopo2 -. dopo)