equal
deleted
inserted
replaced
144 "heap Leaf = True" | |
144 "heap Leaf = True" | |
145 "heap (Node l m r) = |
145 "heap (Node l m r) = |
146 (heap l \<and> heap r \<and> (\<forall>x \<in> set_tree l \<union> set_tree r. m \<le> x))" |
146 (heap l \<and> heap r \<and> (\<forall>x \<in> set_tree l \<union> set_tree r. m \<le> x))" |
147 |
147 |
148 |
148 |
149 subsection "Function @{text mirror}" |
149 subsection "Function \<open>mirror\<close>" |
150 |
150 |
151 fun mirror :: "'a tree \<Rightarrow> 'a tree" where |
151 fun mirror :: "'a tree \<Rightarrow> 'a tree" where |
152 "mirror \<langle>\<rangle> = Leaf" | |
152 "mirror \<langle>\<rangle> = Leaf" | |
153 "mirror \<langle>l,x,r\<rangle> = \<langle>mirror r, x, mirror l\<rangle>" |
153 "mirror \<langle>l,x,r\<rangle> = \<langle>mirror r, x, mirror l\<rangle>" |
154 |
154 |