From 7002b3daca6da29eadf80019847630b8583c3daf Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Sun, 3 Aug 2014 20:02:49 +0200 Subject: Move to a representation of universe polymorphic constants using indices for variables. Simplifies instantiation of constants/inductives, requiring less allocation and Map.find's. Abstraction by variables is handled mostly inside the kernel but could be moved outside. --- kernel/typeops.ml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'kernel/typeops.ml') diff --git a/kernel/typeops.ml b/kernel/typeops.ml index cd1f2c8564..cb0c429a95 100644 --- a/kernel/typeops.ml +++ b/kernel/typeops.ml @@ -189,9 +189,7 @@ let type_of_projection env (cst,u) = match cb.const_proj with | Some pb -> if cb.const_polymorphic then - let mib,_ = lookup_mind_specif env (pb.proj_ind,0) in - let subst = make_inductive_subst mib u in - Vars.subst_univs_level_constr subst pb.proj_type + Vars.subst_instance_constr u pb.proj_type else pb.proj_type | None -> raise (Invalid_argument "type_of_projection: not a projection") @@ -388,8 +386,7 @@ let judge_of_projection env p cj = with Not_found -> error_case_not_inductive env cj in assert(eq_mind pb.proj_ind (fst ind)); - let usubst = make_inductive_subst (fst (lookup_mind_specif env ind)) u in - let ty = Vars.subst_univs_level_constr usubst pb.Declarations.proj_type in + let ty = Vars.subst_instance_constr u pb.Declarations.proj_type in let ty = substl (cj.uj_val :: List.rev args) ty in (* TODO: Universe polymorphism for projections *) {uj_val = mkProj (p,cj.uj_val); -- cgit v1.2.3