aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Matthieu Sozeau <matthieu.sozeau@inria.fr>2016-05-27 13:51:51 +0200
committerGravatar Matthieu Sozeau <mattam@mattam.org>2016-06-29 11:52:52 +0200
commit25ffe7f97a907d3508848c81c3e8dcc89559aadd (patch)
tree35cd301165eb3659fe3f1175140479a72f41eebd
parent58b6784fee71a16719bc4f268dc42830c06a5c63 (diff)
Univs: earlier errors for strict univ decls #4527
When declaring the universes of a lemma explicitely, throw an error if after minimization the type of a lemma still refers to unbound universes. This is a fix and an incompatibility, but scripts will be backwards compatible themselves. Fix another minor bug in treating universe binders for (Co)Fixpoint.
-rw-r--r--stm/lemmas.ml5
-rw-r--r--toplevel/command.ml2
2 files changed, 6 insertions, 1 deletions
diff --git a/stm/lemmas.ml b/stm/lemmas.ml
index 50dceb8e6..6b78ce72c 100644
--- a/stm/lemmas.ml
+++ b/stm/lemmas.ml
@@ -465,6 +465,11 @@ let start_proof_com kind thms hook =
let recguard,thms,snl = look_for_possibly_mutual_statements thms in
let evd, nf = Evarutil.nf_evars_and_universes !evdref in
let thms = List.map (fun (n, (t, info)) -> (n, (nf t, info))) thms in
+ let () =
+ match levels with
+ | None -> ()
+ | Some l -> ignore (Evd.universe_context evd ?names:l)
+ in
let evd =
if pi2 kind then evd
else (* We fix the variables to ensure they won't be lowered to Set *)
diff --git a/toplevel/command.ml b/toplevel/command.ml
index ffa2484ee..2875511d3 100644
--- a/toplevel/command.ml
+++ b/toplevel/command.ml
@@ -1087,7 +1087,7 @@ let interp_recursive isfix fixl notations =
| Some ls , Some us ->
if not (CList.for_all2eq (fun x y -> Id.equal (snd x) (snd y)) ls us) then
error "(co)-recursive definitions should all have the same universe binders";
- Some (ls @ us)) fixl None in
+ Some us) fixl None in
let ctx = Evd.make_evar_universe_context env all_universes in
let evdref = ref (Evd.from_ctx ctx) in
let fixctxs, fiximppairs, fixannots =