diff options
| author | barras | 2002-04-17 12:00:02 +0000 |
|---|---|---|
| committer | barras | 2002-04-17 12:00:02 +0000 |
| commit | b78095db8cbf074761a18f80d296a37561c79125 (patch) | |
| tree | 30f71aab99253446919d74dfa6d6045a65f46224 | |
| parent | cda6963b3ca8fd75c00a0c65dd9ecffdeadfb3c3 (diff) | |
typed unification in the case of Pattern
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@2654 85f007b7-540e-0410-9357-904b9bb8a0f7
| -rw-r--r-- | proofs/clenv.ml | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/proofs/clenv.ml b/proofs/clenv.ml index 73a70f921a..ec79b91f61 100644 --- a/proofs/clenv.ml +++ b/proofs/clenv.ml @@ -775,15 +775,18 @@ let clenv_unify allow_K cv_pb ty1 ty2 clenv = let hd1,l1 = whd_stack ty1 in let hd2,l2 = whd_stack ty2 in match kind_of_term hd1, l1<>[], kind_of_term hd2, l2<>[] with - | (Meta _, true, Lambda _, _ | Lambda _, _, Meta _, true) -> + (* Pattern case *) + | (Meta _, true, Lambda _, _ | Lambda _, _, Meta _, true) + when List.length l1 = List.length l2 -> (try - clenv_unify_0 cv_pb ty1 ty2 clenv + clenv_typed_unify cv_pb ty1 ty2 clenv with ex when catchable_exception ex -> try clenv_unify2 allow_K cv_pb ty1 ty2 clenv with ex when catchable_exception ex -> error "Cannot solve a second-order unification problem") + (* Second order case *) | (Meta _, true, _, _ | _, _, Meta _, true) -> (try clenv_unify2 allow_K cv_pb ty1 ty2 clenv @@ -793,6 +796,7 @@ let clenv_unify allow_K cv_pb ty1 ty2 clenv = with ex when catchable_exception ex -> error "Cannot solve a second-order unification problem") + (* General case: try first order *) | _ -> clenv_unify_0 cv_pb ty1 ty2 clenv |
