aboutsummaryrefslogtreecommitdiff
path: root/pretyping
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2015-11-29 19:05:53 +0100
committerPierre-Marie Pédrot2015-11-29 19:13:30 +0100
commite98d3c3793f26265a49f63a6e78d704f88341df9 (patch)
treec0328afc0034f3262dca2ca067531ee19bbb0ee0 /pretyping
parent103ec7205d9038f1f3821f9287e3bb0907a1e3ec (diff)
parent8d6e58e16cc53a3198eb4c4afef0a2c39f6a5c56 (diff)
Merge branch 'v8.5'
Diffstat (limited to 'pretyping')
-rw-r--r--pretyping/pretyping.ml30
1 files changed, 18 insertions, 12 deletions
diff --git a/pretyping/pretyping.ml b/pretyping/pretyping.ml
index 5f657aff57..78f134248c 100644
--- a/pretyping/pretyping.ml
+++ b/pretyping/pretyping.ml
@@ -394,18 +394,22 @@ let pretype_global loc rigid env evd gr us =
match us with
| None -> evd, None
| Some l ->
- let _, ctx = Universes.unsafe_constr_of_global gr in
- let arr = Univ.Instance.to_array (Univ.UContext.instance ctx) in
- let len = Array.length arr in
- if len != List.length l then
- user_err_loc (loc, "pretype",
- str "Universe instance should have length " ++ int len)
- else
- let evd, l' = List.fold_left (fun (evd, univs) l ->
+ let _, ctx = Universes.unsafe_constr_of_global gr in
+ let arr = Univ.Instance.to_array (Univ.UContext.instance ctx) in
+ let len = Array.length arr in
+ if len != List.length l then
+ user_err_loc (loc, "pretype",
+ str "Universe instance should have length " ++ int len)
+ else
+ let evd, l' = List.fold_left (fun (evd, univs) l ->
let evd, l = interp_universe_level_name evd l in
(evd, l :: univs)) (evd, []) l
- in
- evd, Some (Univ.Instance.of_array (Array.of_list (List.rev l')))
+ in
+ if List.exists (fun l -> Univ.Level.is_prop l) l' then
+ user_err_loc (loc, "pretype",
+ str "Universe instances cannot contain Prop, polymorphic" ++
+ str " universe instances must be greater or equal to Set.");
+ evd, Some (Univ.Instance.of_array (Array.of_list (List.rev l')))
in
Evd.fresh_global ~rigid ?names:instance env evd gr
@@ -440,13 +444,15 @@ let pretype_sort evdref = function
let new_type_evar env evdref loc =
let e, s =
- evd_comb0 (fun evd -> Evarutil.new_type_evar env evd univ_flexible_alg ~src:(loc,Evar_kinds.InternalHole)) evdref
+ evd_comb0 (fun evd -> Evarutil.new_type_evar env evd
+ univ_flexible_alg ~src:(loc,Evar_kinds.InternalHole)) evdref
in e
let get_projection env cst =
let cb = lookup_constant cst env in
match cb.Declarations.const_proj with
- | Some {Declarations.proj_ind = mind; proj_npars = n; proj_arg = m; proj_type = ty} ->
+ | Some {Declarations.proj_ind = mind; proj_npars = n;
+ proj_arg = m; proj_type = ty} ->
(cst,mind,n,m,ty)
| None -> raise Not_found