diff options
author | 2016-11-12 01:52:15 +0100 | |
---|---|---|
committer | 2017-02-14 17:28:48 +0100 | |
commit | 771be16883c8c47828f278ce49545716918764c4 (patch) | |
tree | f3c0427596d447677c54c23455fcfbe7e3337b49 /engine/termops.ml | |
parent | 45562afa065aadc207dca4e904e309d835cb66ef (diff) |
Hipattern API using EConstr.
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 |