]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/cic_proof_checking/cicEnvironment.ml
added parsing time benchmark
[helm.git] / helm / ocaml / cic_proof_checking / cicEnvironment.ml
index 09b8ae88ac9935e4db18f9eb4b25e6ede7cb37b7..08166d5640443006405c87e76b9ed1ea8d9e834b 100644 (file)
@@ -476,6 +476,8 @@ let dump_to_channel = Cache.dump_to_channel;;
 let restore_from_channel = Cache.restore_from_channel;;
 let empty = Cache.empty;;
 
+let total_parsing_time = ref 0.0
+
 let get_object_to_add uri =
  let filename = Http_getter.getxml' uri in
  let bodyfilename =
@@ -506,12 +508,18 @@ let get_object_to_add uri =
        | None -> ()
    end 
  in
- (* this brakes something : 
-  *   let _ = CicUniv.restart_numbering () in 
-  *)
+ (* restarts the numbering of named universes (the ones inside the cic) *)
+ let _ = CicUniv.restart_numbering () in 
+ (* HACK ORRIBILE: fa in modo che il parser metta degli universi fresh non
+  * anonimi *)
+ let _ = CicParser3.set_uri uri in 
  let obj = 
    try 
-     CicParser.obj_of_xml filename bodyfilename 
+     let time = Unix.gettimeofday() in
+     let rc = CicParser.obj_of_xml filename bodyfilename in
+     total_parsing_time := 
+       !total_parsing_time +. ((Unix.gettimeofday()) -. time );
+     rc
    with exn -> 
      cleanup ();
      (match exn with
@@ -538,8 +546,7 @@ let get_object_to_add uri =
      (**********************************************
        TASSI: should fail when universes will be ON
      ***********************************************)
-     (** (Some CicUniv.empty_ugraph,None) *)
-     (None,None)
+     (Some CicUniv.empty_ugraph,None)
  in
    cleanup();
    obj,ugraph