aboutsummaryrefslogtreecommitdiffhomepage
path: root/engine/termops.ml
diff options
context:
space:
mode:
authorGravatar Guillaume Melquiond <guillaume.melquiond@inria.fr>2017-09-12 16:37:43 +0200
committerGravatar Guillaume Melquiond <guillaume.melquiond@inria.fr>2017-09-12 16:37:43 +0200
commita1efd8080465eb49b30b5bab61cf3861899876e4 (patch)
tree2a84202fc27b668288f3e9b6a6b6773b79522447 /engine/termops.ml
parentcc94172036789cfef28007f59510b7f17df5d45d (diff)
Port is_Set and is_Type to EConstr, as was is_Prop already.
Diffstat (limited to 'engine/termops.ml')
-rw-r--r--engine/termops.ml18
1 files changed, 18 insertions, 0 deletions
diff --git a/engine/termops.ml b/engine/termops.ml
index 2bd0c06d6..e2bdf7238 100644
--- a/engine/termops.ml
+++ b/engine/termops.ml
@@ -1165,6 +1165,24 @@ let rec is_Prop sigma c = match EConstr.kind sigma c with
| Cast (c,_,_) -> is_Prop sigma c
| _ -> false
+let rec is_Set sigma c = match EConstr.kind sigma c with
+ | Sort u ->
+ begin match EConstr.ESorts.kind sigma u with
+ | Prop Pos -> true
+ | _ -> false
+ end
+ | Cast (c,_,_) -> is_Set sigma c
+ | _ -> false
+
+let rec is_Type sigma c = match EConstr.kind sigma c with
+ | Sort u ->
+ begin match EConstr.ESorts.kind sigma u with
+ | Type _ -> true
+ | _ -> false
+ end
+ | Cast (c,_,_) -> is_Type sigma c
+ | _ -> false
+
(* eq_constr extended with universe erasure *)
let compare_constr_univ sigma f cv_pb t1 t2 =
let open EConstr in