diff options
| author | Matthieu Sozeau | 2013-12-13 16:39:44 +0000 |
|---|---|---|
| committer | Matthieu Sozeau | 2014-05-06 09:58:57 +0200 |
| commit | 29794b8acf407518716f8c02c2ed20729f8802e5 (patch) | |
| tree | a7952e066c733ed10af5a5f43fcbff3ab960971d | |
| parent | 55e62174683f293c8f966d8bd486fcb511f66221 (diff) | |
- Fix abstract forgetting about new constraints.
| -rw-r--r-- | library/universes.ml | 3 | ||||
| -rw-r--r-- | library/universes.mli | 4 | ||||
| -rw-r--r-- | plugins/funind/functional_principles_types.ml | 2 | ||||
| -rw-r--r-- | plugins/funind/recdef.ml | 3 | ||||
| -rw-r--r-- | tactics/tactics.ml | 4 |
5 files changed, 8 insertions, 8 deletions
diff --git a/library/universes.ml b/library/universes.ml index b37970b38a..d8fa563a0e 100644 --- a/library/universes.ml +++ b/library/universes.ml @@ -144,8 +144,7 @@ let constr_of_global gr = else c let unsafe_constr_of_global gr = - let c, ctx = unsafe_global_instance (Global.env ()) gr in - c + unsafe_global_instance (Global.env ()) gr let constr_of_global_univ (gr,u) = match gr with diff --git a/library/universes.mli b/library/universes.mli index fb662d7a3d..a41b073627 100644 --- a/library/universes.mli +++ b/library/universes.mli @@ -145,9 +145,9 @@ val normalize_universe_subst : universe_subst ref -> val constr_of_global : Globnames.global_reference -> constr (** [unsafe_constr_of_global gr] turns [gr] into a constr, works on polymorphic - reference by building a "dummy" universe instance that is not recorded + references by taking the original universe instance that is not recorded anywhere. The constraints are forgotten as well. DO NOT USE in new code. *) -val unsafe_constr_of_global : Globnames.global_reference -> constr +val unsafe_constr_of_global : Globnames.global_reference -> constr in_universe_context val type_of_global : Globnames.global_reference -> types in_universe_context_set diff --git a/plugins/funind/functional_principles_types.ml b/plugins/funind/functional_principles_types.ml index 05cdd288c1..8a9c7d2e7b 100644 --- a/plugins/funind/functional_principles_types.ml +++ b/plugins/funind/functional_principles_types.ml @@ -645,7 +645,7 @@ let build_case_scheme fa = (* Constrintern.global_reference id *) (* in *) let funs = (fun (_,f,_) -> - try Universes.unsafe_constr_of_global (Nametab.global f) + try fst (Universes.unsafe_constr_of_global (Nametab.global f)) with Not_found -> Errors.error ("Cannot find "^ Libnames.string_of_reference f)) fa in let first_fun,u = destConst funs in diff --git a/plugins/funind/recdef.ml b/plugins/funind/recdef.ml index 50e7507f4d..8496bbbb35 100644 --- a/plugins/funind/recdef.ml +++ b/plugins/funind/recdef.ml @@ -75,7 +75,8 @@ let type_of_const t = Const sp -> Typeops.type_of_constant (Global.env()) sp |_ -> assert false -let constr_of_global = Universes.unsafe_constr_of_global +let constr_of_global x = + fst (Universes.unsafe_constr_of_global x) let constant sl s = constr_of_global (find_reference sl s) diff --git a/tactics/tactics.ml b/tactics/tactics.ml index 764f06a0fd..cc1096e7ca 100644 --- a/tactics/tactics.ml +++ b/tactics/tactics.ml @@ -3763,8 +3763,8 @@ let abstract_subproof id tac = (** ppedrot: seems legit to have abstracted subproofs as local*) let cst = Declare.declare_constant ~internal:Declare.KernelSilent ~local:true id decl in (* let evd, lem = Evd.fresh_global (Global.env ()) evd (ConstRef cst) in *) - (* FIXME: lem might have generated new constraints... not taken into account *) - let lem = Universes.unsafe_constr_of_global (ConstRef cst) in + let lem, ctx = Universes.unsafe_constr_of_global (ConstRef cst) in + let evd = Evd.merge_context_set Evd.univ_flexible evd (Univ.ContextSet.of_context ctx) in let open Declareops in let eff = Safe_typing.sideff_of_con (Global.safe_env ()) cst in let effs = cons_side_effects eff no_seff in |
