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 CicParser.impredicative_set := false;
22 NCicTypeChecker.set_logger logger;
23 NCicPp.set_ppterm NCicPp.trivial_pp_term;
24 Helm_registry.load_from "conf.xml";
27 let s = Sys.argv.(1) in
28 if s = "-alluris" then
30 let uri_re = Str.regexp ".*\\(ind\\|con\\)$" in
31 let uris = Http_getter.getalluris () in
32 let alluris = List.filter (fun u -> Str.string_match uri_re u 0) uris in
33 let oc = open_out "alluris.txt" in
34 List.iter (fun s -> output_string oc (s^"\n")) alluris;
39 with Invalid_argument _ ->
41 let ic = open_in "alluris.txt" in
42 try while true do r := input_line ic :: !r; done; []
47 (fun u -> try Some (UriManager.uri_of_string u) with _ -> None) alluris
50 prerr_endline "computing graphs to load...";
51 let dbd = HSql.quick_connect (LibraryDb.parse_dbd_conf ()) in
52 MetadataTypes.ownerize_tables (Helm_registry.get "matita.owner");
54 HExtlib.list_uniq (List.sort UriManager.compare l)
57 uniq (List.map (fun (uri,_) -> UriManager.strip_xpointer uri)
58 (MetadataDeps.inverse_deps ~dbd u)) in
62 List.fold_left (fun (acc,todo) x ->
64 if w = [] then (x::acc,todo) else (acc,uniq (todo@w)))
67 if todo = [] then uniq acc else fix acc todo
73 let roots_alluris = alluris in *)
74 prerr_endline "generating Coq graphs...";
76 let roots_alluris = alluris in
78 CicEnvironment.set_trust (fun _ -> false);
80 prerr_endline (" - " ^ UriManager.string_of_uri u);
82 ignore(CicTypeChecker.typecheck u);
84 | CicTypeChecker.AssertFailure s
85 | CicTypeChecker.TypeCheckerFailure s -> prerr_endline (Lazy.force s)
87 prerr_endline "loading...";
90 prerr_endline (" - "^UriManager.string_of_uri u);
91 try NCicEnvironment.load_graph u with exn -> ())
93 prerr_endline "finished....";
94 CicUniv.do_rank (NCicEnvironment.get_graph ());
95 prerr_endline "caching objects";
96 prerr_endline "ranked....";
97 HExtlib.profiling_enabled := false;
99 let uu= NUri.nuri_of_ouri uu in
101 logger (`Start_type_checking uu);
102 let _,o = NCicEnvironment.get_obj uu in
104 NCicTypeChecker.typecheck_obj o;
105 logger (`Type_checking_completed uu);
107 | NCicTypeChecker.AssertFailure s
108 | NCicTypeChecker.TypeCheckerFailure s as e ->
109 prerr_endline ("######### " ^ Lazy.force s);
110 if not ignore_exc then raise e
111 | CicEnvironment.Object_not_found s ->
112 prerr_endline ("Obj not found: " ^ UriManager.string_of_uri s)
115 NCicEnvironment.invalidate ();
117 HExtlib.profiling_enabled := true;
118 NCicTypeChecker.set_logger (fun _ -> ());
119 prerr_endline "typechecking, first with the new and then with the old kernel";
120 let prima = Unix.gettimeofday () in
123 let u= NUri.nuri_of_ouri u in
125 NCicTypeChecker.typecheck_obj (snd (NCicEnvironment.get_obj u)))
127 let dopo = Unix.gettimeofday () in
129 let dopo2 = Unix.gettimeofday () in
130 Printf.eprintf "NEW typing: %3.2f, gc: %3.2f\n%!" (dopo -. prima) (dopo2 -. dopo);
131 CicEnvironment.invalidate ();
133 let prima = Unix.gettimeofday () in
134 List.iter (fun u -> ignore (CicTypeChecker.typecheck u)) alluris;
135 let dopo = Unix.gettimeofday () in
137 let dopo2 = Unix.gettimeofday () in
138 Printf.eprintf "OLD typing: %3.2f, gc: %3.2f\n%!" (dopo -. prima) (dopo2 -. dopo)