]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/cic_proof_checking/cicEnvironment.ml
snapshot (first version in which some extensions work, e.g. infix +)
[helm.git] / helm / ocaml / cic_proof_checking / cicEnvironment.ml
index 15bffa57dfb1f20399d45f414652c1a91166845b..ad61bcd0481795e7b4917b7f330411cc667a259b 100644 (file)
@@ -165,6 +165,9 @@ module Cache :
               ) l
             in
              C.Meta(i,l')
+         | C.Sort (C.Type u) -> 
+             CicUniv.assert_univ u;
+             C.Sort (C.Type (CicUniv.recons_univ u))
          | C.Sort _ as t -> t
          | C.Implicit _ as t -> t
          | C.Cast (te,ty) -> C.Cast (restore_in_term te, restore_in_term ty)
@@ -214,7 +217,7 @@ module Cache :
             in
              C.CoFix (i, liftedfl)
       in
-      function
+      function 
          C.Constant (name,bo,ty,params,attrs) ->
            let bo' =
              match bo with
@@ -292,14 +295,14 @@ module Cache :
        *)
       empty (); 
       HT.iter
-       (fun k v ->
+       (fun k (v,u) ->
          callback (UriManager.string_of_uri k);
          HT.add cacheOfCookedObjects 
            (UriManager.uri_of_string (UriManager.string_of_uri k))
             (***********************************************
                TSSI: FIXME add channel stuff for universes
             ************************************************)
-           ((restore_uris v),CicUniv.empty_ugraph))
+           (restore_uris v, CicUniv.recons_graph u))
        restored
     ;;
 
@@ -393,6 +396,7 @@ module Cache :
            None -> 
              assert false (* only NON dummy universes can be committed *)
          | Some g ->
+              CicUniv.assert_univs_have_uri g;
              frozen_list := List.remove_assq uri !frozen_list ;
              HT.add cacheOfCookedObjects uri (obj,g) 
     with
@@ -475,6 +479,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 =
@@ -505,12 +511,15 @@ 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 
  let obj = 
    try 
-     CicParser.obj_of_xml filename bodyfilename 
+     let time = Unix.gettimeofday() in
+     let rc = CicParser.obj_of_xml uri filename bodyfilename in
+     total_parsing_time := 
+       !total_parsing_time +. ((Unix.gettimeofday()) -. time );
+     rc
    with exn -> 
      cleanup ();
      (match exn with