aboutsummaryrefslogtreecommitdiff
path: root/engine/termops.ml
diff options
context:
space:
mode:
Diffstat (limited to 'engine/termops.ml')
-rw-r--r--engine/termops.ml9
1 files changed, 9 insertions, 0 deletions
diff --git a/engine/termops.ml b/engine/termops.ml
index f191e2dc12..e5db3c085b 100644
--- a/engine/termops.ml
+++ b/engine/termops.ml
@@ -818,6 +818,15 @@ let is_section_variable id =
try let _ = Global.lookup_named id in true
with Not_found -> false
+let global_of_constr sigma c =
+ let open Globnames in
+ match EConstr.kind sigma c with
+ | Const (c, u) -> ConstRef c, u
+ | Ind (i, u) -> IndRef i, u
+ | Construct (c, u) -> ConstructRef c, u
+ | Var id -> VarRef id, Univ.Instance.empty
+ | _ -> raise Not_found
+
let isGlobalRef sigma c =
match EConstr.kind sigma c with
| Const _ | Ind _ | Construct _ | Var _ -> true