]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/cic_omdoc/cic2acic.ml
added universes
[helm.git] / helm / ocaml / cic_omdoc / cic2acic.ml
index 69c91cdb3eb959d07fa1e8592ddf80adc518de02..0d3127c3176be7c7d2b514895f28257ac927b689 100644 (file)
  * http://cs.unibo.it/helm/.
  *)
 
-type sort_kind = [ `Prop | `Set | `Type | `CProp ]
-
-let sort_of_string = function
-  | "Prop" -> `Prop
-  | "Set" -> `Set
-  | "Type" -> `Type
-  | "CProp" -> `CProp
-  | _ -> assert false
+type sort_kind = [ `Prop | `Set | `Type of CicUniv.universe | `CProp ]
 
 let string_of_sort = function
   | `Prop -> "Prop"
   | `Set -> "Set"
-  | `Type -> "Type"
+  | `Type u -> "Type:" ^ string_of_int (CicUniv.univno u)
   | `CProp -> "CProp"
 
 let sort_of_sort = function
   | Cic.Prop  -> `Prop
   | Cic.Set   -> `Set
-  | Cic.Type _ -> `Type
+  | Cic.Type u -> `Type u
   | Cic.CProp -> `CProp
 
 (* let hashtbl_add_time = ref 0.0;; *)
@@ -134,8 +127,8 @@ let acic_of_cic_context' seed ids_to_terms ids_to_father_ids ids_to_inner_sorts
        match CicReduction.whd context t with 
           C.Sort C.Prop  -> `Prop
         | C.Sort C.Set   -> `Set
-        | C.Sort (C.Type _)
-        | C.Meta _       -> `Type
+        | C.Sort (C.Type u) -> `Type u
+        | C.Meta _       -> `Type (CicUniv.fresh())
         | C.Sort C.CProp -> `CProp
         | t              ->
             prerr_endline ("Cic2acic.sort_of applied to: " ^ CicPp.ppterm t) ;
@@ -188,7 +181,8 @@ Cic.Sort (Cic.Type (CicUniv.fresh())); (* TASSI: non dovrebbe fare danni *)
         with
          Not_found ->  (* l'inner-type non e' nella tabella ==> sort <> Prop *)
           (* CSC: Type or Set? I can not tell *)
-          None,Cic.Sort (Cic.Type (CicUniv.fresh())),`Type,false 
+          let u = CicUniv.fresh() in
+          None,Cic.Sort (Cic.Type u),`Type u,false 
          (* TASSI non dovrebbe fare danni *)
 (* *)
        in