diff -r 4ea19e5dc67e -r e3ba2578ad9d src/HOL/Library/Tree.thy --- a/src/HOL/Library/Tree.thy Thu Oct 22 15:18:08 2020 +0200 +++ b/src/HOL/Library/Tree.thy Thu Nov 12 12:44:17 2020 +0100 @@ -28,7 +28,7 @@ fun subtrees :: "'a tree \ 'a tree set" where "subtrees \\ = {\\}" | -"subtrees (\l, a, r\) = insert \l, a, r\ (subtrees l \ subtrees r)" +"subtrees (\l, a, r\) = {\l, a, r\} \ subtrees l \ subtrees r" fun mirror :: "'a tree \ 'a tree" where "mirror \\ = Leaf" | @@ -53,7 +53,7 @@ fun complete :: "'a tree \ bool" where "complete Leaf = True" | -"complete (Node l x r) = (complete l \ complete r \ height l = height r)" +"complete (Node l x r) = (height l = height r \ complete l \ complete r)" text \Almost complete:\ definition acomplete :: "'a tree \ bool" where @@ -90,7 +90,7 @@ fun bst_wrt :: "('a \ 'a \ bool) \ 'a tree \ bool" where "bst_wrt P \\ \ True" | "bst_wrt P \l, a, r\ \ - bst_wrt P l \ bst_wrt P r \ (\x\set_tree l. P x a) \ (\x\set_tree r. P a x)" + (\x\set_tree l. P x a) \ (\x\set_tree r. P a x) \ bst_wrt P l \ bst_wrt P r" abbreviation bst :: "('a::linorder) tree \ bool" where "bst \ bst_wrt (<)" @@ -98,7 +98,7 @@ fun (in linorder) heap :: "'a tree \ bool" where "heap Leaf = True" | "heap (Node l m r) = - (heap l \ heap r \ (\x \ set_tree l \ set_tree r. m \ x))" + ((\x \ set_tree l \ set_tree r. m \ x) \ heap l \ heap r)" subsection \\<^const>\map_tree\\