diff options
author | Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr> | 2016-09-01 17:52:44 +0200 |
---|---|---|
committer | Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr> | 2016-11-08 18:35:12 +0100 |
commit | a42795cc1c2a8ed3efa9960af920ff7b16d928f0 (patch) | |
tree | 94afab156f907e5576091fdebe4b227346440dba /kernel | |
parent | 6b99de706e37c75407373e756e24f2256b848815 (diff) |
Introducing a new EConstr.t type to perform the nf_evar operation on demand.
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/constr.ml | 6 | ||||
-rw-r--r-- | kernel/constr.mli | 10 |
2 files changed, 16 insertions, 0 deletions
diff --git a/kernel/constr.ml b/kernel/constr.ml index ce20751ab..0ae3fb474 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 7095dbe6f..c8be89fe2 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 |