diff options
author | puech <puech@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2011-07-29 14:27:07 +0000 |
---|---|---|
committer | puech <puech@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2011-07-29 14:27:07 +0000 |
commit | 3db210383967687e8252ba39ac3ecc971d898cbe (patch) | |
tree | 7dccb5214c63e23e75e00a1ac003e0475410dca5 /plugins/cc/ccalgo.ml | |
parent | 5e4afc4cd404446701c5ede02041a3beec8d0975 (diff) |
Ccproof: generic equality on term replaced by term_equal
... and define term_equal
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@14342 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'plugins/cc/ccalgo.ml')
-rw-r--r-- | plugins/cc/ccalgo.ml | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/plugins/cc/ccalgo.ml b/plugins/cc/ccalgo.ml index 18dbecb66..b7acaf5b6 100644 --- a/plugins/cc/ccalgo.ml +++ b/plugins/cc/ccalgo.ml @@ -103,6 +103,17 @@ type term= | Appli of term*term | Constructor of cinfo (* constructor arity + nhyps *) +let rec term_equal t1 t2 = + match t1, t2 with + | Symb c1, Symb c2 -> eq_constr c1 c2 + | Product (s1, t1), Product (s2, t2) -> s1 = s2 && t1 = t2 + | Eps i1, Eps i2 -> id_ord i1 i2 = 0 + | Appli (t1, u1), Appli (t2, u2) -> term_equal t1 t2 && term_equal u1 u2 + | Constructor {ci_constr=c1; ci_arity=i1; ci_nhyps=j1}, + Constructor {ci_constr=c2; ci_arity=i2; ci_nhyps=j2} -> + i1 = i2 && j1 = j2 && eq_constructor c1 c2 + | _ -> t1 = t2 + type ccpattern = PApp of term * ccpattern list (* arguments are reversed *) | PVar of int |