aboutsummaryrefslogtreecommitdiffhomepage
path: root/checker/inductive.ml
diff options
context:
space:
mode:
authorGravatar Matthieu Sozeau <matthieu.sozeau@inria.fr>2014-09-06 11:27:09 +0200
committerGravatar Matthieu Sozeau <matthieu.sozeau@inria.fr>2014-09-06 11:27:09 +0200
commit0413899668e8be15df5065abdaf1d40ad3c2c31b (patch)
tree5d2c4671737b9d0c9eba68cdf0d16503c6e47608 /checker/inductive.ml
parentd7db69dea59cddd3ac81ed469170fad889af4e16 (diff)
Fix checker to handle projections with eta and universe polymorphism correctly.
Diffstat (limited to 'checker/inductive.ml')
-rw-r--r--checker/inductive.ml10
1 files changed, 5 insertions, 5 deletions
diff --git a/checker/inductive.ml b/checker/inductive.ml
index c23b2578b..c95cb7a2e 100644
--- a/checker/inductive.ml
+++ b/checker/inductive.ml
@@ -83,7 +83,7 @@ let constructor_instantiate mind u mib c =
let s = ind_subst mind mib u in
substl s (subst_instance_constr u c)
-let instantiate_params full t args sign =
+let instantiate_params full t u args sign =
let fail () =
anomaly ~label:"instantiate_params" (Pp.str "type, ctxt and args mismatch") in
let (rem_args, subs, ty) =
@@ -91,7 +91,8 @@ let instantiate_params full t args sign =
(fun (_,copt,_) (largs,subs,ty) ->
match (copt, largs, ty) with
| (None, a::args, Prod(_,_,t)) -> (args, a::subs, t)
- | (Some b,_,LetIn(_,_,_,t)) -> (largs, (substl subs b)::subs, t)
+ | (Some b,_,LetIn(_,_,_,t)) ->
+ (largs, (substl subs (subst_instance_constr u b))::subs, t)
| (_,[],_) -> if full then fail() else ([], subs, ty)
| _ -> fail ())
sign
@@ -103,13 +104,12 @@ let instantiate_params full t args sign =
let full_inductive_instantiate mib u params sign =
let dummy = Prop Null in
let t = mkArity (sign,dummy) in
- let ar = fst (destArity (instantiate_params true t params mib.mind_params_ctxt)) in
- subst_instance_context u ar
+ fst (destArity (instantiate_params true t u params mib.mind_params_ctxt))
let full_constructor_instantiate ((mind,_),u,(mib,_),params) =
let inst_ind = constructor_instantiate mind u mib in
(fun t ->
- instantiate_params true (inst_ind t) params mib.mind_params_ctxt)
+ instantiate_params true (inst_ind t) u params mib.mind_params_ctxt)
(************************************************************************)
(************************************************************************)