From a1efd8080465eb49b30b5bab61cf3861899876e4 Mon Sep 17 00:00:00 2001 From: Guillaume Melquiond Date: Tue, 12 Sep 2017 16:37:43 +0200 Subject: Port is_Set and is_Type to EConstr, as was is_Prop already. --- engine/termops.ml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'engine/termops.ml') 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 -- cgit v1.2.3