]> matita.cs.unibo.it Git - helm.git/blobdiff - components/tactics/universe.ml
some depend files
[helm.git] / components / tactics / universe.ml
index 40c3c1abdbb560ed2b5c20586aeca44d520509bf..c8d370f04ff8807f08cbf2afd6a12459bd42af63 100644 (file)
@@ -44,20 +44,36 @@ let rec unfold context = function
        Cic.Prod(name,s,t')     
   | t -> ProofEngineReduction.unfold context t
 
-let rec collapse_head_metas = function 
-  | Cic.Appl(a::l) -> 
-      let a' = collapse_head_metas a in
-      (match a' with
-       | Cic.Meta(n,m) -> Cic.Meta(n,m)
-       | t ->  
-           let l' = List.map collapse_head_metas l in
-              Cic.Appl(t::l'))
-  | t -> t
+let rec collapse_head_metas t = 
+  match t with
+    | Cic.Appl([]) -> assert false
+    | Cic.Appl(a::l) -> 
+       let a' = collapse_head_metas a in
+         (match a' with
+            | Cic.Meta(n,m) -> Cic.Meta(n,m)
+            | t ->     
+                let l' = List.map collapse_head_metas l in
+                  Cic.Appl(t::l'))
+    | Cic.Rel _ 
+    | Cic.Var _         
+    | Cic.Meta _ 
+    | Cic.Sort _ 
+    | Cic.Implicit _
+    | Cic.Const _ 
+    | Cic.MutInd _
+    | Cic.MutConstruct _ -> t
+    | Cic.LetIn _
+    | Cic.Lambda _
+    | Cic.Prod _
+    | Cic.Cast _
+    | Cic.MutCase _
+    | Cic.Fix _
+    | Cic.CoFix _ -> Cic.Meta(-1,[])
 ;;
 
 let rec dummies_of_coercions = 
   function
-    | Cic.Appl (c::l) when CoercGraph.is_a_coercion c ->
+    | Cic.Appl (c::l) when CoercDb.is_a_coercion' c ->
        Cic.Meta (-1,[])
     | Cic.Appl l -> 
        let l' = List.map dummies_of_coercions l in Cic.Appl l'
@@ -93,7 +109,7 @@ let index univ key term =
   (* flexible terms are not indexed *)
   if key = Cic.Meta(-1,[]) then univ
   else
-    (prerr_endline("ADD: "^CicPp.ppterm key^" |-> "^CicPp.ppterm term);
+    ((*prerr_endline("ADD: "^CicPp.ppterm key^" |-> "^CicPp.ppterm term);*)
      TI.index univ key term)
 ;;