Theory Tree234_Set
theory Tree234_Set
imports
"HOL-Data_Structures.Tree234"
"HOL-Data_Structures.Cmp"
"HOL-Data_Structures.Set_Specs"
Zip_Benchmarks_Setup
begin
text ‹Note: this benchmark file is an adjusted copy of HOL-Data_Structures.Tree234_Set from the standard
distribution (dated 07.11.2025)›
text ‹Note: this theory contains slow proofs with many case distinctions. We hence increase the timeout for the benchmark.›
declare[[zip_benchmark_timeout=90]]
declare sorted_wrt.simps(2)[simp del]
subsection ‹Set operations on 2-3-4 trees›
definition empty :: "'a tree234" where
"empty = Leaf"
fun isin :: "'a::linorder tree234 ⇒ 'a ⇒ bool" where
"isin Leaf x = False" |
"isin (Node2 l a r) x =
(case cmp x a of LT ⇒ isin l x | EQ ⇒ True | GT ⇒ isin r x)" |
"isin (Node3 l a m b r) x =
(case cmp x a of LT ⇒ isin l x | EQ ⇒ True | GT ⇒ (case cmp x b of
LT ⇒ isin m x | EQ ⇒ True | GT ⇒ isin r x))" |
"isin (Node4 t1 a t2 b t3 c t4) x =
(case cmp x b of
LT ⇒
(case cmp x a of
LT ⇒ isin t1 x |
EQ ⇒ True |
GT ⇒ isin t2 x) |
EQ ⇒ True |
GT ⇒
(case cmp x c of
LT ⇒ isin t3 x |
EQ ⇒ True |
GT ⇒ isin t4 x))"