Commit 2cadc205 authored by Adam Chlipala's avatar Adam Chlipala

Prettify rbtree a bit more

parent c294d392
...@@ -495,40 +495,31 @@ Section insert. ...@@ -495,40 +495,31 @@ Section insert.
Section present. Section present.
Variable z : nat. Variable z : nat.
Lemma present_balance1 : forall n (a : rtree n) (y : nat) c2 (b : rbtree c2 n) , Ltac present_balance :=
present z (projT2 (balance1 a y b)) crush;
<-> rpresent z a \/ z = y \/ present z b. repeat (match goal with
destruct a; crush;
repeat match goal with
| [ H : context[match ?T with | [ H : context[match ?T with
| Leaf => _ | Leaf => _
| RedNode _ _ _ _ => _ | RedNode _ _ _ _ => _
| BlackNode _ _ _ _ _ _ => _ | BlackNode _ _ _ _ _ _ => _
end] |- _ ] => pose T; dep_destruct T; crush end] |- _ ] => dep_destruct T
| [ |- context[match ?T with | [ |- context[match ?T with
| Leaf => _ | Leaf => _
| RedNode _ _ _ _ => _ | RedNode _ _ _ _ => _
| BlackNode _ _ _ _ _ _ => _ | BlackNode _ _ _ _ _ _ => _
end] ] => pose T; dep_destruct T; crush end] ] => dep_destruct T
end. 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; present_balance.
Qed. Qed.
Lemma present_balance2 : forall n (a : rtree n) (y : nat) c2 (b : rbtree c2 n) , Lemma present_balance2 : forall n (a : rtree n) (y : nat) c2 (b : rbtree c2 n) ,
present z (projT2 (balance2 a y b)) present z (projT2 (balance2 a y b))
<-> rpresent z a \/ z = y \/ present z b. <-> rpresent z a \/ z = y \/ present z b.
destruct a; crush; destruct a; present_balance.
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.
Qed. Qed.
Definition present_insResult c n := Definition present_insResult c n :=
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment