From 23fc1c59d78ffb524265caa1908503f50816335a Mon Sep 17 00:00:00 2001 From: Hugo Herbelin Date: Sat, 6 Oct 2018 11:04:03 +0200 Subject: A state-free version of is_polymorphic. --- kernel/environ.ml | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'kernel/environ.ml') 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*) -- cgit v1.2.3