aboutsummaryrefslogtreecommitdiffhomepage
path: root/vernac
diff options
context:
space:
mode:
authorGravatar Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr>2017-07-10 19:11:20 +0200
committerGravatar Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr>2017-07-11 14:50:47 +0200
commit012f5fb722a9d5dcef82c800aa54ed50c0a58957 (patch)
treefbe0e3ae6901faba4f14b8cd4dbda019ce9a7829 /vernac
parentb8a7222e670f69e024d50394afd88204e15d1b29 (diff)
Safe API for accessing universe constraints of global references.
Instead of returning either an instance or the set of constraints, we rather return the corresponding abstracted context. We also push back all uses of abstraction-breaking calls from these functions out of the kernel.
Diffstat (limited to 'vernac')
-rw-r--r--vernac/obligations.ml2
-rw-r--r--vernac/record.ml4
-rw-r--r--vernac/search.ml2
3 files changed, 4 insertions, 4 deletions
diff --git a/vernac/obligations.ml b/vernac/obligations.ml
index c0acdaf57..5a1c260b1 100644
--- a/vernac/obligations.ml
+++ b/vernac/obligations.ml
@@ -362,7 +362,7 @@ let get_body obl =
match obl.obl_body with
| None -> None
| Some (DefinedObl c) ->
- let u = Environ.constant_instance (Global.env ()) c in
+ let u = Univ.AUContext.instance (Environ.constant_context (Global.env ()) c) in
let pc = (c, u) in
Some (DefinedObl pc)
| Some (TermObl c) ->
diff --git a/vernac/record.ml b/vernac/record.ml
index d61f44cac..366f50454 100644
--- a/vernac/record.ml
+++ b/vernac/record.ml
@@ -265,7 +265,7 @@ let warn_non_primitive_record =
let declare_projections indsp ?(kind=StructureComponent) binder_name coers fieldimpls fields =
let env = Global.env() in
let (mib,mip) = Global.lookup_inductive indsp in
- let u = Declareops.inductive_polymorphic_instance mib in
+ let u = Univ.AUContext.instance (Declareops.inductive_polymorphic_context mib) in
let paramdecls = Inductive.inductive_paramdecls (mib, u) in
let poly = Declareops.inductive_is_polymorphic mib in
let ctx =
@@ -547,7 +547,7 @@ let add_inductive_class ind =
let mind, oneind = Global.lookup_inductive ind in
let k =
let ctx = oneind.mind_arity_ctxt in
- let inst = Declareops.inductive_polymorphic_instance mind in
+ let inst = Univ.AUContext.instance (Declareops.inductive_polymorphic_context mind) in
let ty = Inductive.type_of_inductive
(push_rel_context ctx (Global.env ()))
((mind,oneind),inst)
diff --git a/vernac/search.ml b/vernac/search.ml
index 00536e52e..788a2aa4a 100644
--- a/vernac/search.ml
+++ b/vernac/search.ml
@@ -85,7 +85,7 @@ let iter_declarations (fn : global_reference -> env -> constr -> unit) =
let mib = Global.lookup_mind mind in
let iter_packet i mip =
let ind = (mind, i) in
- let u = Declareops.inductive_polymorphic_instance mib in
+ let u = Univ.AUContext.instance (Declareops.inductive_polymorphic_context mib) in
let i = (ind, u) in
let typ = Inductiveops.type_of_inductive env i in
let () = fn (IndRef ind) env typ in