From 03941e1ee40758d3e206d3e4463696bf22005d8c Mon Sep 17 00:00:00 2001 From: herbelin Date: Fri, 9 Nov 2001 17:43:07 +0000 Subject: Déplacement et export de type_of_global dans Global MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@2178 85f007b7-540e-0410-9357-904b9bb8a0f7 --- library/global.ml | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'library/global.ml') diff --git a/library/global.ml b/library/global.ml index 3f009d6d2..bbb77c853 100644 --- a/library/global.ml +++ b/library/global.ml @@ -68,4 +68,12 @@ let import cenv = global_env := import cenv !global_env let env_of_context hyps = reset_with_named_context hyps (env()) +open Nametab +let type_of_reference env = function + | VarRef id -> let (_,_,t) = Environ.lookup_named id env in t + | ConstRef c -> Environ.constant_type env c + | IndRef ind -> Inductive.type_of_inductive env ind + | ConstructRef cstr -> Inductive.type_of_constructor env cstr + +let type_of_global t = type_of_reference (env ()) t -- cgit v1.2.3