]> matita.cs.unibo.it Git - helm.git/blobdiff - components/cic_unification/cicUnification.ml
The function exists_a_meta has been modified to capture also
[helm.git] / components / cic_unification / cicUnification.ml
index ecde4cdfd9bd2fb1dee201d64f96c75f8437a9ce..8ba0ae917c828e807d85980acdb0a6a560a77718 100644 (file)
@@ -74,7 +74,11 @@ in profiler_toa.HExtlib.profile foo ()
 ;;
 
 let exists_a_meta l = 
-  List.exists (function Cic.Meta _ -> true | _ -> false) l
+  List.exists 
+    (function 
+       | Cic.Meta _  
+       | Cic.Appl (Cic.Meta _::_) -> true
+       | _ -> false) l
 
 let rec deref subst t =
   let snd (_,a,_) = a in
@@ -457,18 +461,19 @@ debug_print (lazy ("restringo Meta n." ^ (string_of_int n) ^ "on variable n." ^
           (sprintf
             "Can't unify %s with %s due to different constants"
             (CicMetaSubst.ppterm subst t1) 
-            (CicMetaSubst.ppterm subst t2)))) 
+            (CicMetaSubst.ppterm subst t2))))
    | C.MutInd (uri1,i1,exp_named_subst1),C.MutInd (uri2,i2,exp_named_subst2) ->
        if UriManager.eq uri1 uri2 && i1 = i2 then
          fo_unif_subst_exp_named_subst 
            test_equality_only 
            subst context metasenv exp_named_subst1 exp_named_subst2 ugraph
        else
-         raise (UnificationFailure (lazy "4"))
-           (* (sprintf
-              "Can't unify %s with %s due to different inductive principles"
-              (CicMetaSubst.ppterm subst t1) 
-              (CicMetaSubst.ppterm subst t2))) *)
+         raise (UnificationFailure
+           (lazy
+            (sprintf
+             "Can't unify %s with %s due to different inductive principles"
+             (CicMetaSubst.ppterm subst t1) 
+             (CicMetaSubst.ppterm subst t2))))
    | C.MutConstruct (uri1,i1,j1,exp_named_subst1),
        C.MutConstruct (uri2,i2,j2,exp_named_subst2) ->
        if UriManager.eq uri1 uri2 && i1 = i2 && j1 = j2 then
@@ -476,11 +481,12 @@ debug_print (lazy ("restringo Meta n." ^ (string_of_int n) ^ "on variable n." ^
            test_equality_only 
            subst context metasenv exp_named_subst1 exp_named_subst2 ugraph
        else
-         raise (UnificationFailure (lazy "5"))
-           (* (sprintf
+         raise (UnificationFailure
+          (lazy
+            (sprintf
               "Can't unify %s with %s due to different inductive constructors"
               (CicMetaSubst.ppterm subst t1) 
-              (CicMetaSubst.ppterm subst t2))) *)
+              (CicMetaSubst.ppterm subst t2))))
    | (C.Implicit _, _) | (_, C.Implicit _) ->  assert false
    | (C.Cast (te,ty), t2) -> fo_unif_subst test_equality_only 
                               subst context metasenv te t2 ugraph
@@ -653,7 +659,9 @@ debug_print (lazy ("restringo Meta n." ^ (string_of_int n) ^ "on variable n." ^
                           C.Appl (C.MutInd _::_) -> 
                             fo_unif_subst test_equality_only 
                               subst context metasenv t1 t2' ugraph         
-                        | _ -> raise (UnificationFailure (lazy "99")))
+                        | _ -> raise 
+                           (UnificationFailure 
+                              (lazy ("not a mutind :"^CicMetaSubst.ppterm subst t2 ))))
                   | _ -> raise exn)))
    | (C.MutCase (_,_,outt1,t1',pl1), C.MutCase (_,_,outt2,t2',pl2))->
        let subst', metasenv',ugraph1 =