diff options
Diffstat (limited to 'engine/termops.ml')
-rw-r--r-- | engine/termops.ml | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/engine/termops.ml b/engine/termops.ml index 5581b1656..59dbb73f5 100644 --- a/engine/termops.ml +++ b/engine/termops.ml @@ -829,6 +829,15 @@ let global_of_constr sigma c = | Var id -> VarRef id, Univ.Instance.empty | _ -> raise Not_found +let is_global sigma c t = + let open Globnames in + match c, EConstr.kind sigma t with + | ConstRef c, Const (c', _) -> Constant.equal c c' + | IndRef i, Ind (i', _) -> eq_ind i i' + | ConstructRef i, Construct (i', _) -> eq_constructor i i' + | VarRef id, Var id' -> Id.equal id id' + | _ -> false + let isGlobalRef sigma c = match EConstr.kind sigma c with | Const _ | Ind _ | Construct _ | Var _ -> true |