]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/cic_unification/cicRefine.ml
added annotations to Cic.Implicit
[helm.git] / helm / ocaml / cic_unification / cicRefine.ml
index b64d8f4bb8b2236793b5be72d911e038e946b227..43ecd892915745020599e705acc6c341b583550f 100644 (file)
@@ -169,7 +169,7 @@ and type_of_aux' metasenv context t =
     | C.Sort s ->
        C.Sort C.Type, (*CSC manca la gestione degli universi!!! *)
         subst,metasenv
-    | C.Implicit -> raise (Impossible 21)
+    | C.Implicit -> raise (Impossible 21)
     | C.Cast (te,ty) ->
        let _,subst',metasenv' =
         type_of_aux subst metasenv context ty in
@@ -419,7 +419,7 @@ and type_of_aux' metasenv context t =
          | Some t,Some (_,C.Def (ct,_)) ->
             (try
               CicUnification.fo_unif_subst subst context metasenv t ct
-             with _ -> raise (NotRefinable (sprintf "The local context is not consistent with the canonical context, since %s cannot be unified with %s" (CicMetaSubst.ppterm subst t) (CicMetaSubst.ppterm subst ct))))
+             with e -> raise (NotRefinable (sprintf "The local context is not consistent with the canonical context, since %s cannot be unified with %s. Reason: %s" (CicMetaSubst.ppterm subst t) (CicMetaSubst.ppterm subst ct) (match e with CicUnification.AssertFailure msg -> msg | _ -> (Printexc.to_string e)))))
          | Some t,Some (_,C.Decl ct) ->
             let inferredty,subst',metasenv' =
              type_of_aux subst metasenv context t
@@ -427,7 +427,7 @@ and type_of_aux' metasenv context t =
              (try
                CicUnification.fo_unif_subst
                 subst' context metasenv' inferredty ct
-             with _ -> raise (NotRefinable (sprintf "The local context is not consistent with the canonical context, since the type %s of %s cannot be unified with the expected type %s" (CicMetaSubst.ppterm subst' inferredty) (CicMetaSubst.ppterm subst' t) (CicMetaSubst.ppterm subst' ct))))
+             with e -> raise (NotRefinable (sprintf "The local context is not consistent with the canonical context, since the type %s of %s cannot be unified with the expected type %s. Reason: %s" (CicMetaSubst.ppterm subst' inferredty) (CicMetaSubst.ppterm subst' t) (CicMetaSubst.ppterm subst' ct) (match e with CicUnification.AssertFailure msg -> msg | _ -> (Printexc.to_string e)))))
          | None, Some _  ->
              raise (NotRefinable (sprintf
               "Not well typed metavariable instance %s: the local context does not instantiate an hypothesis even if the hypothesis is not restricted in the canonical context %s"