aboutsummaryrefslogtreecommitdiff
path: root/kernel/environ.ml
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2018-10-16 10:50:51 +0200
committerPierre-Marie Pédrot2018-10-16 10:50:51 +0200
commit697a59de8a39f3a4b253ced93ece1209b7f0eb1b (patch)
tree60fe9cb964ee6a1be68c0333270f29f996af0574 /kernel/environ.ml
parent1b4e757a90d8c0a5fc8599fffcda75618b468032 (diff)
parent23fc1c59d78ffb524265caa1908503f50816335a (diff)
Merge PR #8695: Adding a functional version of constant- and mind_of_delta_kn + functional version of is_polymorphic
Diffstat (limited to 'kernel/environ.ml')
-rw-r--r--kernel/environ.ml10
1 files changed, 10 insertions, 0 deletions
diff --git a/kernel/environ.ml b/kernel/environ.ml
index dffcd70282..2fa33eb1cd 100644
--- a/kernel/environ.ml
+++ b/kernel/environ.ml
@@ -680,6 +680,16 @@ let remove_hyps ids check_context check_value ctxt =
in
fst (remove_hyps ctxt)
+(* A general request *)
+
+let is_polymorphic env r =
+ let open Names.GlobRef in
+ match r with
+ | VarRef _id -> false
+ | ConstRef c -> polymorphic_constant c env
+ | IndRef ind -> polymorphic_ind ind env
+ | ConstructRef cstr -> polymorphic_ind (inductive_of_constructor cstr) env
+
(*spiwack: the following functions assemble the pieces of the retroknowledge
note that the "consistent" register function is available in the module
Safetyping, Environ only synchronizes the proactive and the reactive parts*)