aboutsummaryrefslogtreecommitdiff
path: root/library
diff options
context:
space:
mode:
Diffstat (limited to 'library')
-rw-r--r--library/declare.ml7
-rw-r--r--library/declare.mli2
2 files changed, 9 insertions, 0 deletions
diff --git a/library/declare.ml b/library/declare.ml
index 2220632c66..ff006625a1 100644
--- a/library/declare.ml
+++ b/library/declare.ml
@@ -172,6 +172,13 @@ let global_reference kind id =
let ids = ids_of_sign hyps in
DOPN(oper, Array.of_list (List.map (fun id -> VAR id) ids))
+let is_global id =
+ try
+ let osp = Nametab.sp_of_id CCI id in
+ prefix_of (dirpath osp) (Lib.cwd())
+ with Not_found ->
+ false
+
let mind_path = function
| DOPN(MutInd (sp,0),_) -> sp
| DOPN(MutInd (sp,tyi),_) ->
diff --git a/library/declare.mli b/library/declare.mli
index 3a1e7884fb..c2944c330a 100644
--- a/library/declare.mli
+++ b/library/declare.mli
@@ -36,4 +36,6 @@ val declare_mind : mutual_inductive_entry -> unit
val global_reference : path_kind -> identifier -> constr
+val is_global : identifier -> bool
+
val mind_path : constr -> section_path