src/HOL/Data_Structures/Array_Braun.thy
changeset 69752 facaf96cd79e
parent 69655 2b56cbb02e8a
child 69941 423c0b571f1e
equal deleted inserted replaced
69751:6bf8ea65ea7a 69752:facaf96cd79e
   181 "del_lo (Node l a r) = merge l r"
   181 "del_lo (Node l a r) = merge l r"
   182 
   182 
   183 fun del_hi :: "nat \<Rightarrow> 'a tree \<Rightarrow> 'a tree" where
   183 fun del_hi :: "nat \<Rightarrow> 'a tree \<Rightarrow> 'a tree" where
   184 "del_hi n Leaf = Leaf" |
   184 "del_hi n Leaf = Leaf" |
   185 "del_hi n (Node l x r) =
   185 "del_hi n (Node l x r) =
   186 	(if n = 1 then Leaf
   186   (if n = 1 then Leaf
   187 	 else if even n
   187    else if even n
   188 	     then Node (del_hi (n div 2) l) x r
   188        then Node (del_hi (n div 2) l) x r
   189 	     else Node l x (del_hi (n div 2) r))"
   189        else Node l x (del_hi (n div 2) r))"
   190 
   190 
   191 
   191 
   192 subsubsection "Functional Correctness"
   192 subsubsection "Functional Correctness"
   193 
   193 
   194 
   194