diff options
author | herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2001-11-09 17:43:07 +0000 |
---|---|---|
committer | herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2001-11-09 17:43:07 +0000 |
commit | 03941e1ee40758d3e206d3e4463696bf22005d8c (patch) | |
tree | cfe921586844814f02676d4c87373b43fb532647 /library/global.ml | |
parent | eddc388071fc1d1eba06b96732f9b195b88d1054 (diff) |
Déplacement et export de type_of_global dans Global
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@2178 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'library/global.ml')
-rw-r--r-- | library/global.ml | 8 |
1 files changed, 8 insertions, 0 deletions
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 |