aboutsummaryrefslogtreecommitdiff
path: root/interp/topconstr.ml
diff options
context:
space:
mode:
authormsozeau2008-10-22 16:25:12 +0000
committermsozeau2008-10-22 16:25:12 +0000
commit6322f01644dd370322b09b663c53eef57388dcce (patch)
treec498df27a9dbd282169adced997b25021400ca7c /interp/topconstr.ml
parente03d1840a8e6eec927e7fbe006d59ab21b8d818f (diff)
A much better implementation of implicit generalization:
- Do it after internalisation (esp. after notation expansion) - Generalize it to any constr, not just typeclasses - Prepare for having settings on the implicit status of generalized variables (currently only impl,impl and expl,expl are supported). - Simplified implementation! (Still some refactoring needed in typeclasses parsing code). This patch contains a fix for bug #1964 as well. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@11490 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'interp/topconstr.ml')
-rw-r--r--interp/topconstr.ml9
1 files changed, 6 insertions, 3 deletions
diff --git a/interp/topconstr.ml b/interp/topconstr.ml
index 058d997e0d..935d95fc54 100644
--- a/interp/topconstr.ml
+++ b/interp/topconstr.ml
@@ -502,9 +502,12 @@ let rec match_ alp metas sigma a1 a2 = match (a1,a2) with
& List.length eqnl1 = List.length eqnl2 ->
let rtno1' = abstract_return_type_context_rawconstr tml1 rtno1 in
let rtno2' = abstract_return_type_context_aconstr tml2 rtno2 in
- let sigma = Option.fold_left2 (match_ alp metas) sigma rtno1' rtno2' in
+ let sigma =
+ try Option.fold_left2 (match_ alp metas) sigma rtno1' rtno2'
+ with Option.Heterogeneous -> raise No_match
+ in
let sigma = List.fold_left2
- (fun s (tm1,_) (tm2,_) -> match_ alp metas s tm1 tm2) sigma tml1 tml2 in
+ (fun s (tm1,_) (tm2,_) -> match_ alp metas s tm1 tm2) sigma tml1 tml2 in
List.fold_left2 (match_equations alp metas) sigma eqnl1 eqnl2
| RLetTuple (_,nal1,(na1,to1),b1,c1), ALetTuple (nal2,(na2,to2),b2,c2)
when List.length nal1 = List.length nal2 ->
@@ -603,7 +606,7 @@ type notation = string
type explicitation = ExplByPos of int * identifier option | ExplByName of identifier
-type binder_kind = Default of binding_kind | TypeClass of binding_kind * binding_kind
+type binder_kind = Default of binding_kind | Generalized of binding_kind * binding_kind * bool
type proj_flag = int option (* [Some n] = proj of the n-th visible argument *)