section \<open>Multiset of Elements of Binary Tree\<close>
theory Tree_Multiset imports Multiset Tree begin
text\<open>
Kept separate fromtheory\<^theory>\<open>HOL-Library.Tree\<close> to avoid importing all of theory \<^theory>\<open>HOL-Library.Multiset\<close> into \<^theory>\<open>HOL-Library.Tree\<close>. Should be merged if \<^theory>\<open>HOL-Library.Multiset\<close> ever becomes part of \<^theory>\<open>Main\<close>. \<close>
fun mset_tree :: "'a tree \ 'a multiset" where "mset_tree Leaf = {#}" | "mset_tree (Node l a r) = {#a#} + mset_tree l + mset_tree r"
fun subtrees_mset :: "'a tree \ 'a tree multiset" where "subtrees_mset Leaf = {#Leaf#}" | "subtrees_mset (Node l x r) = add_mset (Node l x r) (subtrees_mset l + subtrees_mset r)"
lemma mset_tree_empty_iff[simp]: "mset_tree t = {#} \ t = Leaf" by (cases t) auto
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.