diff options
| author | Matthieu Sozeau | 2015-10-07 13:11:52 +0200 |
|---|---|---|
| committer | Matthieu Sozeau | 2015-10-07 13:17:11 +0200 |
| commit | d37aab528dca587127b9f9944e1521e4fc3d9cc7 (patch) | |
| tree | 3d8db828b3e6644c924a75592dded2a168fbeb59 /toplevel | |
| parent | 840155eafd9607c7656c80770de1e2819fe56a13 (diff) | |
Univs: add Strict Universe Declaration option (on by default)
This option disallows "declare at first use" semantics for universe
variables (in @{}), forcing the declaration of _all_ universes appearing
in a definition when introducing it with syntax Definition/Inductive
foo@{i j k} .. The bound universes at the end of a definition/inductive
must be exactly those ones, no extras allowed currently.
Test-suite files using the old semantics just disable the option.
Diffstat (limited to 'toplevel')
| -rw-r--r-- | toplevel/command.ml | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/toplevel/command.ml b/toplevel/command.ml index b65ff73feb..285baf3f97 100644 --- a/toplevel/command.ml +++ b/toplevel/command.ml @@ -500,12 +500,13 @@ let interp_mutual_inductive (paramsl,indl) notations poly prv finite = check_all_names_different indl; List.iter check_param paramsl; let env0 = Global.env() in - let evdref = ref Evd.(from_env env0) in + let pl = (List.hd indl).ind_univs in + let ctx = Evd.make_evar_universe_context env0 pl in + let evdref = ref Evd.(from_ctx ctx) in let _, ((env_params, ctx_params), userimpls) = interp_context_evars env0 evdref paramsl in let indnames = List.map (fun ind -> ind.ind_name) indl in - let pl = (List.hd indl).ind_univs in (* Names of parameters as arguments of the inductive type (defs removed) *) let assums = List.filter(fun (_,b,_) -> Option.is_empty b) ctx_params in |
