aboutsummaryrefslogtreecommitdiff
path: root/kernel/environ.ml
diff options
context:
space:
mode:
authorHugo Herbelin2018-10-06 11:04:03 +0200
committerHugo Herbelin2018-10-11 23:07:42 +0200
commit23fc1c59d78ffb524265caa1908503f50816335a (patch)
tree5fa5f94db7c8453179f574480029884724d932f6 /kernel/environ.ml
parentc4d3daaeb75a746b2a2717d2aaf21a65ebcc7775 (diff)
A state-free 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*)