diff options
author | Matthieu Sozeau <matthieu.sozeau@inria.fr> | 2014-09-30 01:18:24 +0200 |
---|---|---|
committer | Matthieu Sozeau <matthieu.sozeau@inria.fr> | 2014-09-30 01:21:02 +0200 |
commit | 2bbf1305a080667d8547c44b2684010aba3d8d45 (patch) | |
tree | 42d2575fa01cc6f13eda2fb08ab26967f7834c04 /kernel | |
parent | 09d13ea251ba9f271fd698edd0d6560b88996a65 (diff) |
Simplify evarconv thanks to new delta status of projections,
using whd_state_gen to handle unfolding. Add an isProj/destProj
in term. Use the proper environment everywhere in unification.ml.
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/term.ml | 6 | ||||
-rw-r--r-- | kernel/term.mli | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/kernel/term.ml b/kernel/term.ml index ab678666f..734b7853f 100644 --- a/kernel/term.ml +++ b/kernel/term.ml @@ -310,6 +310,12 @@ let destCase c = match kind_of_term c with let isCase c = match kind_of_term c with Case _ -> true | _ -> false +let isProj c = match kind_of_term c with Proj _ -> true | _ -> false + +let destProj c = match kind_of_term c with + | Proj (p, c) -> (p, c) + | _ -> raise DestKO + let destFix c = match kind_of_term c with | Fix fix -> fix | _ -> raise DestKO diff --git a/kernel/term.mli b/kernel/term.mli index 28ebc41e2..50cd433e9 100644 --- a/kernel/term.mli +++ b/kernel/term.mli @@ -112,6 +112,7 @@ val isConstruct : constr -> bool val isFix : constr -> bool val isCoFix : constr -> bool val isCase : constr -> bool +val isProj : constr -> bool val is_Prop : constr -> bool val is_Set : constr -> bool @@ -183,6 +184,9 @@ return P in t1], or [if c then t1 else t2]) where [info] is pretty-printing information *) val destCase : constr -> case_info * constr * constr * constr array +(** Destructs a projection *) +val destProj : constr -> projection * constr + (** Destructs the {% $ %}i{% $ %}th function of the block [Fixpoint f{_ 1} ctx{_ 1} = b{_ 1} with f{_ 2} ctx{_ 2} = b{_ 2} |