aboutsummaryrefslogtreecommitdiff
path: root/kernel/constr.ml
diff options
context:
space:
mode:
authorGaëtan Gilbert2018-10-10 13:27:27 +0200
committerGaëtan Gilbert2018-10-16 15:52:52 +0200
commit5993c266300cca1c7ca6e8b2b8e3f77f745ca9f9 (patch)
tree3b304d51b3f1ae62441d0d63fc4245750508cc3a /kernel/constr.ml
parent72de7e057505c45cdbf75234a9ea90465d0e19ec (diff)
Simplify vars_of_global usage
Diffstat (limited to 'kernel/constr.ml')
-rw-r--r--kernel/constr.ml6
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/constr.ml b/kernel/constr.ml
index 7ffde3107b..b490aa5092 100644
--- a/kernel/constr.ml
+++ b/kernel/constr.ml
@@ -407,6 +407,12 @@ let destCoFix c = match kind c with
| CoFix cofix -> cofix
| _ -> raise DestKO
+let destRef c = let open GlobRef in match kind c with
+ | Var x -> VarRef x, Univ.Instance.empty
+ | Const (c,u) -> ConstRef c, u
+ | Ind (ind,u) -> IndRef ind, u
+ | Construct (c,u) -> ConstructRef c, u
+ | _ -> raise DestKO
(******************************************************************)
(* Flattening and unflattening of embedded applications and casts *)