diff options
author | Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr> | 2018-06-06 01:38:36 +0200 |
---|---|---|
committer | Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr> | 2018-06-11 23:27:55 +0200 |
commit | 0daa84151fbd7d6e2646a76b7ff0e6c4fce3bdca (patch) | |
tree | 7d1d035d5b026bad78f3db1fd17869dfa4894da7 | |
parent | ab4bce38a7c0d08d1ebff70c4115b7c1d8e8be88 (diff) |
Simplify the cooking of primitive projections.
There is no need to expand a primitive projection with the section
parameters and universes, for one good reason: they are never applied
neither to parameters nor universe instances.
-rw-r--r-- | kernel/cooking.ml | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/kernel/cooking.ml b/kernel/cooking.ml index 5783453e6..8a79bcf22 100644 --- a/kernel/cooking.ml +++ b/kernel/cooking.ml @@ -126,16 +126,15 @@ let expmod_constr cache modlist c = | Not_found -> Constr.map substrec c) | Proj (p, c') -> - (try - let p' = share_univs (ConstRef (Projection.constant p)) Univ.Instance.empty modlist in - let make c = Projection.make c (Projection.unfolded p) in - match kind p' with - | Const (p',_) -> mkProj (make p', substrec c') - | App (f, args) -> - (match kind f with - | Const (p', _) -> mkProj (make p', substrec c') - | _ -> assert false) - | _ -> assert false + (try + (** No need to expand parameters or universes for projections *) + let map cst = + let _ = Cmap.find cst (fst modlist) in + pop_con cst + in + let p = Projection.map map p in + let c' = substrec c' in + mkProj (p, c') with Not_found -> Constr.map substrec c) | _ -> Constr.map substrec c |