From e99b4c66cf38bb5b6ccb76b69ebd7e7a44ed295d Mon Sep 17 00:00:00 2001 From: Gaƫtan Gilbert Date: Wed, 10 Oct 2018 14:11:22 +0200 Subject: UnivGen.extend_context -> Univ.extend_in_context_set Such a basic function can live in Univ rather than the higher level UnivGen. --- engine/univGen.ml | 3 +-- engine/univGen.mli | 1 + kernel/univ.ml | 3 +++ kernel/univ.mli | 3 +++ tactics/eqschemes.ml | 2 +- 5 files changed, 9 insertions(+), 3 deletions(-) diff --git a/engine/univGen.ml b/engine/univGen.ml index 443ef22844..23ab30eb75 100644 --- a/engine/univGen.ml +++ b/engine/univGen.ml @@ -141,8 +141,7 @@ let fresh_sort_in_family = function let new_sort_in_family sf = fst (fresh_sort_in_family sf) -let extend_context (a, ctx) (ctx') = - (a, ContextSet.union ctx ctx') +let extend_context = Univ.extend_in_context_set let new_global_univ () = let u = fresh_level () in diff --git a/engine/univGen.mli b/engine/univGen.mli index 136c04f969..c2e9d0c696 100644 --- a/engine/univGen.mli +++ b/engine/univGen.mli @@ -71,6 +71,7 @@ val constr_of_global_univ : GlobRef.t puniverses -> constr val extend_context : 'a in_universe_context_set -> ContextSet.t -> 'a in_universe_context_set +[@@ocaml.deprecated "Use [Univ.extend_in_context_set]"] (** Create a fresh global in the global environment, without side effects. BEWARE: this raises an ANOMALY on polymorphic constants/inductives: diff --git a/kernel/univ.ml b/kernel/univ.ml index fa37834a23..d09b54e7ec 100644 --- a/kernel/univ.ml +++ b/kernel/univ.ml @@ -1065,6 +1065,9 @@ type universe_context_set = ContextSet.t type 'a in_universe_context = 'a * universe_context type 'a in_universe_context_set = 'a * universe_context_set +let extend_in_context_set (a, ctx) ctx' = + (a, ContextSet.union ctx ctx') + (** Substitutions. *) let empty_subst = LMap.empty diff --git a/kernel/univ.mli b/kernel/univ.mli index 1aa53b8aa8..7ac8247ca4 100644 --- a/kernel/univ.mli +++ b/kernel/univ.mli @@ -433,6 +433,9 @@ end type 'a in_universe_context = 'a * UContext.t type 'a in_universe_context_set = 'a * ContextSet.t +val extend_in_context_set : 'a in_universe_context_set -> ContextSet.t -> + 'a in_universe_context_set + val empty_level_subst : universe_level_subst val is_empty_level_subst : universe_level_subst -> bool diff --git a/tactics/eqschemes.ml b/tactics/eqschemes.ml index 16b94cd154..b12018cd66 100644 --- a/tactics/eqschemes.ml +++ b/tactics/eqschemes.ml @@ -785,7 +785,7 @@ let build_congr env (eq,refl,ctx) ind = let varH = fresh env (Id.of_string "H") in let varf = fresh env (Id.of_string "f") in let ci = make_case_info (Global.env()) ind RegularStyle in - let uni, ctx = UnivGen.extend_context (UnivGen.new_global_univ ()) ctx in + let uni, ctx = Univ.extend_in_context_set (UnivGen.new_global_univ ()) ctx in let ctx = (fst ctx, Univ.enforce_leq uni (univ_of_eq env eq) (snd ctx)) in let c = my_it_mkLambda_or_LetIn paramsctxt -- cgit v1.2.3