From 4f3ead754a96b1817993a90b3058d6df9583cb18 Mon Sep 17 00:00:00 2001 From: Dominic Orchard Date: Tue, 10 Nov 2026 09:34:05 +0000 Subject: [PATCH] checking formatting tweaks for paper don't break things --- examples/Example_tree_weight.thy | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/examples/Example_tree_weight.thy b/examples/Example_tree_weight.thy index 74f32bf..b0d5b57 100644 --- a/examples/Example_tree_weight.thy +++ b/examples/Example_tree_weight.thy @@ -12,13 +12,16 @@ fun ins :: "'a::linorder \ 'a tree \ 'a tree" where else Node l y r)" definition root_or :: "'a \ 'a tree \ 'a list" where - "root_or d t = [case t of Leaf \ d | Node _ x _ \ x]" + "root_or d t = [case t of Leaf \ d + | Node _ x _ \ x]" -fun fold_tree :: "('b \ 'a \ 'b \ 'b) \ 'b \ 'a tree \ 'b" where +fun fold_tree :: "('b \ 'a \ 'b \ 'b) \ 'b \ 'a tree + \ 'b" where "fold_tree f e Leaf = e" | "fold_tree f e (Node l x r) = f (fold_tree f e l) x (fold_tree f e r)" -definition from_list :: "'a::linorder list \ 'a tree" where +definition from_list :: "'a::linorder list + \ 'a tree" where "from_list xs = foldr ins xs Leaf" class weight = @@ -39,7 +42,8 @@ begin end definition example_weight :: nat where - "example_weight = calc_weight (Node Leaf (Node Leaf (7::nat) Leaf) Leaf)" + "example_weight = calc_weight (Node Leaf + (Node Leaf (7::nat) Leaf) Leaf)" export_code ins root_or fold_tree from_list example_weight