equal
deleted
inserted
replaced
17 "baliL (R (R t1 a1 t2) a2 t3) a3 t4 = R (B t1 a1 t2) a2 (B t3 a3 t4)" | |
17 "baliL (R (R t1 a1 t2) a2 t3) a3 t4 = R (B t1 a1 t2) a2 (B t3 a3 t4)" | |
18 "baliL (R t1 a1 (R t2 a2 t3)) a3 t4 = R (B t1 a1 t2) a2 (B t3 a3 t4)" | |
18 "baliL (R t1 a1 (R t2 a2 t3)) a3 t4 = R (B t1 a1 t2) a2 (B t3 a3 t4)" | |
19 "baliL t1 a t2 = B t1 a t2" |
19 "baliL t1 a t2 = B t1 a t2" |
20 |
20 |
21 fun baliR :: "'a rbt \<Rightarrow> 'a \<Rightarrow> 'a rbt \<Rightarrow> 'a rbt" where |
21 fun baliR :: "'a rbt \<Rightarrow> 'a \<Rightarrow> 'a rbt \<Rightarrow> 'a rbt" where |
|
22 "baliR t1 a1 (R t2 a2 (R t3 a3 t4)) = R (B t1 a1 t2) a2 (B t3 a3 t4)" | |
22 "baliR t1 a1 (R (R t2 a2 t3) a3 t4) = R (B t1 a1 t2) a2 (B t3 a3 t4)" | |
23 "baliR t1 a1 (R (R t2 a2 t3) a3 t4) = R (B t1 a1 t2) a2 (B t3 a3 t4)" | |
23 "baliR t1 a1 (R t2 a2 (R t3 a3 t4)) = R (B t1 a1 t2) a2 (B t3 a3 t4)" | |
|
24 "baliR t1 a t2 = B t1 a t2" |
24 "baliR t1 a t2 = B t1 a t2" |
25 |
25 |
26 fun paint :: "color \<Rightarrow> 'a rbt \<Rightarrow> 'a rbt" where |
26 fun paint :: "color \<Rightarrow> 'a rbt \<Rightarrow> 'a rbt" where |
27 "paint c Leaf = Leaf" | |
27 "paint c Leaf = Leaf" | |
28 "paint c (Node _ l a r) = Node c l a r" |
28 "paint c (Node _ l a r) = Node c l a r" |