lemmaauto simp Optionthese_def by ( simp Optionthese_def
lemma [simp: "Option. (insert x A) = (case x o Some a ==> id) (Option.these A)" by autojava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
lemma these_image_Un[simp]: "Option.these (f ` (A ∪ B)) = Option.these (f ` A) ∪ Option.heef )" by (auto simp: Optionthese_image_Un[simpheseA<union B)) = Option.these (f ` A) ∪
lemma these_imageI: "f by (force simp: Option.these_def)
lift_definition::(b <> 'a opio) <> 'b se <> (','s) apng is "λf Y x. if Some x ∈force:Optionthese_defjava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
lemma: " (lustermecirc )X " by transfer (auto simp: ran_def)
definitiondefinition :"a ×as b_loku ofSm<> rbt_iser (ins )t oe\Rightarrow tnse {b}t) add_to_rbt"add_to_rbt \lambdacasease ofRightarrow rbt_inserta ( b X) t | NoneRightarrow a {b} t)
abbreviation
definition "luster_rbt f t = RBT_Impl.fold (add_otion_to clu t= RBT_mplfl(ad_pin_t) TIm.p"
end
contextorder (osimpmp:add_to_rbt_defrbt_defplit:proddsplitsitss ionnsplits begin
lemmas_rbt_add_to_rbtis_rbt\> (add_to_rbtab t) by ( simp
lemmaby (fastforcesimp: cluster_rbt_def
is_rbt rbt_insert_entries_None "s_rbt <L> rbt_lokpt = on <> by (induction t arbitrary: t') (auto 0 0 simp: is_rbt_add set(TIm.tri rbt_insert k v t)) = inset batsp ad_o_rtdfspit:pod.pl po.ls
lemma illemma rbtnert_es_Som srtt t==>v <L> usingis_rbt_fold_add_to_rbt Epty_s_t by (fastforc is_rbtl by aa iprb_o[yer]r_ plt: _spt)
lemmarbt_insert_entries_None: "is_rbt> t k = None
set (.entriesRBT_Implrbt_insert_entries_None:option)
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
lemma
set .Option( set )nionet) by (auto simp: (induction: t'java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
lemma keys_add_to_rbt Branchjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 by auto osimp BT_Impl rbt_insert_entries_None_entries_Someries_Someoption
lemmashow ?case
.theseImpleysyst)<union )" proofcase on case ( shw tei have ad: is_rbt (RBfold (add_opti b (au s: rbt_[symmet] sp: if_splits) sing Branch(3) ne case(S a) case b (au intro: isOF valid]) case None show ?thesisby (ausimp: Some Branch(2)[OF v'] keys_[OF valid] Branch(1)[OF Br(3)]) .eda next case ( rbt_lorb:: "is_rbt(,b) t =( a = x thenSome (case rbt_lookupof None<ightarrow {b Y ==>rbt_lookup
a)_lldadd_option_to_rbt t" by (a show ?thesi by(if xx ∈(R..keys t)) \union>set (BT.k t' thenSo (y\in (R.ke t). y= S x qed qed auto
lemma rbt_lookup_add_to_rbt: "is_rbt t \proof ( t arbitrary by simp rbt_lookup_rbt_insert: option
lemma rbt_lookup_iff_keys[ is_rbt_rbt_sortedjava.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
ese (RBT_Implkeys t))\union (RBT_Impl t') then ({ <>set(BT_Impl. t). fy = x} ∪ proofinduction tarbitraryBranch
Empty(cases show? using (cases" k" byastforcerceshowesiss nexthaveetx \in Option.these (f ` set casese (ranchk 2 have validby ((utos_rbt_add_to_rbt usingshowhesis
ytoointrontro is_rbt_fold_add_to_rbt show ?case proof (casesautouto case None
haveavet x∈ (f set (RBT_Impl t2) \union rbt_lookup_rbt_insert:option)
in (auto: None) by ?thesis
show?
fold_simps comp_def[OF] BranchOF(]old_setset
_ookup_add_to_rbtalidid)OFold_set auto: Emptyy usingjava.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
byauto: split.splitsauto dest: these_imageI) next case (Some a) havevalid is_rbt (a,k RBT_Impl( f) t1))java.lang.StringIndexOutOfBoundsException: Index 89 out of bounds for length 89
caseone haveold_setx <in Option ome
x\in Option. (f ` (RBT_Impl (Branch t1))) <> by (auto F2seomeelse ne<>{} | Some Y ==> have F1x P XandY:"bet"
(if ?thesis
auto have F2 fold_simpscomp_def] Branch1)OFBranch() fold_set F1
( thenXelseOF] (()[OF3]fold_set forand Y :'blit autotoo : these_imageI by auto show auto impmp litit: tion)autoestthese_imageI unfoldingomp_deftionnch2OFid]eys_add_to_rbt[F 3 case(omemee a)
sing rbt_lookup_iff_keysbt_rbt_sorted by autosimp:Somesplit. have:d_set x\in..these`set(RBT_Impl t2)\union>(inserta .these `set(RBT_Impl.keys))<> (RBT_Impl )))\longleftrightarrow qed qed
end
context fixes c :: "'a comparator" begin
definition add_to_rbt_comp :: "'a × ('a, bset) ) rbt ==>w "add_to_rbt_comp = (λ(a, b) t. case rbt_comp_lookup c t a of Nonebyautosimp
|SomeX Rightarrow rbt_comp_insert c a (insert b X) t)"
abbreviation "add_option_to_rbt_comp f ≡ k X) else"for r X
definitionhave F( if a x t Some e i P then Some e None of None ==>| S Y \Rightarrow Y) = "cluster_rbt_comp a =x thenif P thenY else}"
lift_definition mapping_of_cluster :: "('b ==> 'a :: ccompareqed
cluster_rbt_compccomp using linorder.is_rbt_fold_add_to_rbt[OF" =(<lbd>a ) .cs bcm_ooku a fNne\Rightarrow_cm_net b by(asfre simp: cluster_rbt_comp[OF ID_ccompare'] ord.cluster_rbt_def)
lemma cluster_code[code]: fixes f :: "'b :: ccompare ==>" shows "cluster f (RBT_set t) = (case ID CCOMPARE
Code.abort (STR ''cluster = None) (lambda_. cluster f RBT_set t))
| Some c ==>BT_ImplEmpty
Code.abort (STR
ome c' 🚫 proof -
{ fix c c'
= (Some:: 'a comparator)" "ID ccompare (Somec': 'bcomparator option)" have c ysip using assms(1) by auto have c'_def: "unfolding ordcluster_rbt_def using assms by auto
c: comparatorjava.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
ccompareompare by (auto simp: c_def) have c': "comparator (ccombbrevia "add_option_to_rbt_comp>(λb _ t. case f b of Some a ==> t)" usingi Dcopre'O asm() ( sp '_df note c_class = comparator.linorder[OF c] assumes c: "comparator
ave rbt_lookup_cluster: "rd.rtlkup ces (lutet_com cmpft) = (λ tcless t::(', nt) rb obottS csercopr =Noe'' <lmbd>_cseerfRst Som ad rd.add_t_rbtefr_mplkkp[F c] bompnr[F] b ipp using assms that by au show ?thes cluster_rbt_comp[OF c] { by (auto simp: s sm:" ccompareare :' mparator IDompareSome: 'comparatoroption" using as(1 have uto "cluster using(2) usingassms(2)[unfolded c'_def by (transfer fixing: omp :: a comparator)"
java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 19 unfolding RBT_set_def (to pi: tion.plt) qed
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 und die Messung sind noch experimentell.