projects
/
coq-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a0f1135
)
add mapleaves to General.v
author
Adam Megacz
<megacz@cs.berkeley.edu>
Sat, 19 Mar 2011 21:15:18 +0000
(14:15 -0700)
committer
Adam Megacz
<megacz@cs.berkeley.edu>
Sat, 19 Mar 2011 21:15:18 +0000
(14:15 -0700)
src/General.v
patch
|
blob
|
history
diff --git
a/src/General.v
b/src/General.v
index
ffd0d29
..
7aefcf0
100644
(file)
--- a/
src/General.v
+++ b/
src/General.v
@@
-301,6
+301,16
@@
Fixpoint unleaves'' {A:Type}(l:list ??A) : Tree ??A :=
| (a::b) => (unleaves'' b),,(T_Leaf a)
end.
+Lemma mapleaves {T:Type}(t:Tree ??T){Q}{f:T->Q} : leaves (mapOptionTree f t) = map f (leaves t).
+ induction t.
+ destruct a; auto.
+ simpl.
+ rewrite IHt1.
+ rewrite IHt2.
+ rewrite map_app.
+ auto.
+ Qed.
+
Fixpoint filter {T:Type}(l:list ??T) : list T :=
match l with
| nil => nil