# HG changeset patch # User Adam Chlipala # Date 1223432079 14400 # Node ID 696726af9530c767fbaa1fd78b8a38a0faca7a30 # Parent e579e1e64bde11c5127b1de13a584d714a526125 Prettify rbtree a bit more diff -r e579e1e64bde -r 696726af9530 src/MoreDep.v --- a/src/MoreDep.v Tue Oct 07 22:05:37 2008 -0400 +++ b/src/MoreDep.v Tue Oct 07 22:14:39 2008 -0400 @@ -495,40 +495,31 @@ Section present. Variable z : nat. + Ltac present_balance := + crush; + repeat (match goal with + | [ H : context[match ?T with + | Leaf => _ + | RedNode _ _ _ _ => _ + | BlackNode _ _ _ _ _ _ => _ + end] |- _ ] => dep_destruct T + | [ |- context[match ?T with + | Leaf => _ + | RedNode _ _ _ _ => _ + | BlackNode _ _ _ _ _ _ => _ + end] ] => dep_destruct T + end; crush). + Lemma present_balance1 : forall n (a : rtree n) (y : nat) c2 (b : rbtree c2 n) , present z (projT2 (balance1 a y b)) <-> rpresent z a \/ z = y \/ present z b. - destruct a; crush; - repeat match goal with - | [ H : context[match ?T with - | Leaf => _ - | RedNode _ _ _ _ => _ - | BlackNode _ _ _ _ _ _ => _ - end] |- _ ] => pose T; dep_destruct T; crush - | [ |- context[match ?T with - | Leaf => _ - | RedNode _ _ _ _ => _ - | BlackNode _ _ _ _ _ _ => _ - end] ] => pose T; dep_destruct T; crush - end. + destruct a; present_balance. Qed. Lemma present_balance2 : forall n (a : rtree n) (y : nat) c2 (b : rbtree c2 n) , present z (projT2 (balance2 a y b)) <-> rpresent z a \/ z = y \/ present z b. - destruct a; crush; - repeat match goal with - | [ H : context[match ?T with - | Leaf => _ - | RedNode _ _ _ _ => _ - | BlackNode _ _ _ _ _ _ => _ - end] |- _ ] => pose T; dep_destruct T; crush - | [ |- context[match ?T with - | Leaf => _ - | RedNode _ _ _ _ => _ - | BlackNode _ _ _ _ _ _ => _ - end] ] => pose T; dep_destruct T; crush - end. + destruct a; present_balance. Qed. Definition present_insResult c n :=