aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/constr.ml6
-rw-r--r--kernel/constr.mli10
2 files changed, 16 insertions, 0 deletions
diff --git a/kernel/constr.ml b/kernel/constr.ml
index ce20751abc..0ae3fb474d 100644
--- a/kernel/constr.ml
+++ b/kernel/constr.ml
@@ -235,6 +235,12 @@ let mkVar id = Var id
let kind c = c
+(* The other way around. We treat specifically smart constructors *)
+let of_kind = function
+| App (f, a) -> mkApp (f, a)
+| Cast (c, knd, t) -> mkCast (c, knd, t)
+| k -> k
+
(****************************************************************************)
(* Functions to recur through subterms *)
(****************************************************************************)
diff --git a/kernel/constr.mli b/kernel/constr.mli
index 7095dbe6f9..c8be89fe2b 100644
--- a/kernel/constr.mli
+++ b/kernel/constr.mli
@@ -223,6 +223,7 @@ type ('constr, 'types) kind_of_term =
term *)
val kind : constr -> (constr, types) kind_of_term
+val of_kind : (constr, types) kind_of_term -> constr
(** [equal a b] is true if [a] equals [b] modulo alpha, casts,
and application grouping *)
@@ -310,6 +311,15 @@ val compare_head_gen : (bool -> Univ.Instance.t -> Univ.Instance.t -> bool) ->
(constr -> constr -> bool) ->
constr -> constr -> bool
+val compare_head_gen_leq_with :
+ (constr -> (constr,types) kind_of_term) ->
+ (constr -> (constr,types) kind_of_term) ->
+ (bool -> Univ.Instance.t -> Univ.Instance.t -> bool) ->
+ (Sorts.t -> Sorts.t -> bool) ->
+ (constr -> constr -> bool) ->
+ (constr -> constr -> bool) ->
+ constr -> constr -> bool
+
(** [compare_head_gen_with k1 k2 u s f c1 c2] compares [c1] and [c2]
like [compare_head_gen u s f c1 c2], except that [k1] (resp. [k2])
is used,rather than {!kind}, to expose the immediate subterms of