aboutsummaryrefslogtreecommitdiff
path: root/engine/eConstr.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 /engine/eConstr.ml
parent72de7e057505c45cdbf75234a9ea90465d0e19ec (diff)
Simplify vars_of_global usage
Diffstat (limited to 'engine/eConstr.ml')
-rw-r--r--engine/eConstr.ml7
1 files changed, 7 insertions, 0 deletions
diff --git a/engine/eConstr.ml b/engine/eConstr.ml
index 8ab3ce821e..cefffb315e 100644
--- a/engine/eConstr.ml
+++ b/engine/eConstr.ml
@@ -166,6 +166,13 @@ let destProj sigma c = match kind sigma c with
| Proj (p, c) -> (p, c)
| _ -> raise DestKO
+let destRef sigma c = let open GlobRef in match kind sigma c with
+ | Var x -> VarRef x, EInstance.empty
+ | Const (c,u) -> ConstRef c, u
+ | Ind (ind,u) -> IndRef ind, u
+ | Construct (c,u) -> ConstructRef c, u
+ | _ -> raise DestKO
+
let decompose_app sigma c =
match kind sigma c with
| App (f,cl) -> (f, Array.to_list cl)