7 let do_indent () = String.make !indent ' ' in
9 | `Start_type_checking s -> ();
11 prerr_endline (do_indent () ^ "Start: " ^ NUri.string_of_uri s);
14 | `Type_checking_completed s -> ();
17 prerr_endline (do_indent () ^ "End: " ^ NUri.string_of_uri s))
21 NCicTypeChecker.set_logger logger;
22 NCicPp.set_ppterm NCicPp.trivial_pp_term;
23 Helm_registry.load_from "conf.xml";
26 let s = Sys.argv.(1) in
27 if s = "-alluris" then
29 let uri_re = Str.regexp ".*\\(ind\\|con\\)$" in
30 let uris = Http_getter.getalluris () in
31 let alluris = List.filter (fun u -> Str.string_match uri_re u 0) uris in
32 let oc = open_out "alluris.txt" in
33 List.iter (fun s -> output_string oc (s^"\n")) alluris;
38 with Invalid_argument _ ->
40 let ic = open_in "alluris.txt" in
41 try while true do r := input_line ic :: !r; done; []
46 (fun u -> try Some (UriManager.uri_of_string u) with _ -> None) alluris
49 prerr_endline "computing graphs to load...";
50 let dbd = HSql.quick_connect (LibraryDb.parse_dbd_conf ()) in
51 MetadataTypes.ownerize_tables (Helm_registry.get "matita.owner");
53 HExtlib.list_uniq (List.sort UriManager.compare l)
56 uniq (List.map (fun (uri,_) -> UriManager.strip_xpointer uri)
57 (MetadataDeps.inverse_deps ~dbd u)) in
61 List.fold_left (fun (acc,todo) x ->
63 if w = [] then (x::acc,todo) else (acc,uniq (todo@w)))
66 if todo = [] then uniq acc else fix acc todo
72 let roots_alluris = alluris in *)
73 prerr_endline "generating Coq graphs...";
74 CicEnvironment.set_trust (fun _ -> false);
76 prerr_endline (" - " ^ UriManager.string_of_uri u);
78 ignore(CicTypeChecker.typecheck u);
80 | CicTypeChecker.AssertFailure s
81 | CicTypeChecker.TypeCheckerFailure s -> prerr_endline (Lazy.force s)
83 prerr_endline "loading...";
86 prerr_endline (" - "^UriManager.string_of_uri u);
87 try NCicEnvironment.load_graph u with exn -> ())
89 prerr_endline "finished....";
90 CicUniv.do_rank (NCicEnvironment.get_graph ());
91 prerr_endline "ranked....";
92 prerr_endline "caching objects";
93 HExtlib.profiling_enabled := false;
95 let uu= NUri.nuri_of_ouri uu in
97 logger (`Start_type_checking uu);
98 let _,o = NCicEnvironment.get_obj uu in
100 NCicTypeChecker.typecheck_obj o;
101 logger (`Type_checking_completed uu);
103 | NCicTypeChecker.AssertFailure s
104 | NCicTypeChecker.TypeCheckerFailure s as e ->
105 prerr_endline ("######### " ^ Lazy.force s);
106 if not ignore_exc then raise e
107 | CicEnvironment.Object_not_found s ->
108 prerr_endline ("Obj not found: " ^ UriManager.string_of_uri s)
111 NCicEnvironment.invalidate ();
113 HExtlib.profiling_enabled := true;
114 NCicTypeChecker.set_logger (fun _ -> ());
115 prerr_endline "typechecking, first with the new and then with the old kernel";
116 let prima = Unix.gettimeofday () in
119 let u= NUri.nuri_of_ouri u in
121 NCicTypeChecker.typecheck_obj (snd (NCicEnvironment.get_obj u)))
123 let dopo = Unix.gettimeofday () in
125 let dopo2 = Unix.gettimeofday () in
126 Printf.eprintf "NEW typing: %3.2f, gc: %3.2f\n%!" (dopo -. prima) (dopo2 -. dopo);
127 CicEnvironment.invalidate ();
129 let prima = Unix.gettimeofday () in
130 List.iter (fun u -> ignore (CicTypeChecker.typecheck u)) alluris;
131 let dopo = Unix.gettimeofday () in
133 let dopo2 = Unix.gettimeofday () in
134 Printf.eprintf "OLD typing: %3.2f, gc: %3.2f\n%!" (dopo -. prima) (dopo2 -. dopo)