lemma is_rbt_fold_add_to_rbtfastforce: )
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 by (duction ttod_to_rbtplit.lits
lemma is_rbt_cluster_rbt: "is_rbt (cluster_rbt f t)" usingd_to_rbt by (fastforceautometric__ert
lemma rbt_insert_entries_None
setentriesinsertpl by (auto simp (.entries k v t) = (k, v( (RBT_Impl t) - {k,v})
lemma rbt_insert_entries_Some
RBT_Implnsert ket" by (auto simp:addrt_def RBT_Impl.keys_def rbp: ptionnsplits)
lemma ksol_add_tobt: "is_rbt t' < set (RBT_Impl.keys (RBT_Impl.fold (add_option_to_rbt f) t t')) = by (auto simp: add_to_rbt_def RBT_Impl.keys_def rbt_insert_entries_None rbt_insert_entries_Some split: option.splits)
lemma keys_fold_add_to_rbt: "is_rbt t' ==> set (RBT_Impl.keys (RBT_Impl.fold (add_option_to_rbt f) t t')) = Option.these (f ` set (RBT_Impl.keys t)) ∪ set (RBT_Impl.keys t')" proof (induction t arbitraryt) case (Branch col t1 k v t2Option (f `set (RBT_Impl.keys t)\union> set.keys
Branch2)haveis_rbtRBT_Impl.fold( f) t1" using by (aintro: is_rbt_fold_add_to_rbt) byshowca show ?roof (cases " k) proof (cases "f k") case None show ?thesis by (auto simp: None Branch(2)[OF valid] Branch(1)[OF Branch(3)]) next case (Some a) have valid': "is_rbt (add_to_rbt (a, k) (RBT_Impl.fold (add_option_to_rbt f) t1 t'))" by (auto intro: is_rbt_add_to_rbt[OF valid]) show ?thesis by (auto simp: Some Branch(2)[OF valid'] keys_add_to_rbt[OF valid] Branch(1)[OF Branch(3)]) qed qed auto
lemma rbt_lookup_add_to_rbt: "is_rbt t ==> rbt_lookup (add_to_rbt (a, b) t) x = (if a = x then Some (case rbt_lookup t x of None ==>the by(u simp: add rbt_lookup_rb_ split: o.splits)
lemma (if x \in> Option.these (f ` set (R.keys t)) ∪ {y <in> set (RBT_Impl.keys t). f y = x} ∪dd_option_to_bt f) t1 t))" proofby (auto intro is_rbt_add_to_rbt[OF]) caseEmpty thenshow ?case
rbt_lookup_iff_keys)[ is_rbt_rbt_sorted by (fastforce split: option next case (java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 have validis_rbt.fold f) t1 using Branch(3) by (auto intro: is_rbt_fold_add_to_rbtautodefup_rbt_insert option show proof (casesif x <>Optionthese f (RBT_Impl t) <unionset (RBT_Impl.keys t') then Some ({y ∈ case None have fold_set:)
x \in> Option.these ( (.keys t1 ) <>set (RBT_Impl.keys t')" by (auto simp: None) show ?thesis unfolding fold_simps comp_def None option.case(1) Branch(2)[OF valid] keys_add_to_rbt[OF valid] keys_fold_add_to_rbt[OF Branch(3)] rbt_lookup_add_to_rbt[OF valid] Branch(1)[OF Branch(3)] fold_set using rbt_lookup_iff_keys(2,3)[OF is_rbt_rbt_sorted[OF Branch(3)]] by (auto simp: None split: option.splits) (auto dest: these_imageI) next case (then show ?case rbt_lookup_iff_keys(2,3)[O is_rbt_rbt_sorte] by (auto intro: is_rbt_add_to_r (fastforce split: option.splits) have fold_s "x <> (inserta (.these (RBT_Impl t1< set (RBT_Impl.keys t'))) ⟷
x \> Option (f `setRBT_Impl ( colt1 vt2))<> (RBT_Implkeys'" by (auto simp: Some) have: "case P then X else of ==> insert k Y) =
(if P thenusingBranch(3) by auto have F2: "(case if a = x then Some X else if P then Some Y else None of None ==> {} | Some Y ==> Y) = (if a = x then X else if P then Y else {})"
X Y : "bet" by auto: "x\in Option.these (f ` set (RBT_Impl.k t2)) ∪ t1)) ∪ show ?thesis unfolding fold_simps comp_x \ ∈ (Branch col t1 k vt2))))) <union> set (RBT_Imp. t')"
[OF] BranchOF Branch3)]fold_set F2 using rbt_lookup_iff_keys ?thesis by (auto: Some: option) (auto: these_imageI qed qed
end
context fixesusing(2,3)[OF[OFBranch(3] begin
definition add_to_rbt_comp :: case (Some a) "add_to_rbt_comp = (λ(a, b) tave vali': " (add_to_rbt)(RBT_Implfold(add_option_to_rbt) t'))" | Some X \<Rightarrowrbt_comp_insert
abbreviationadd_option_to_rbt_comp f f ≡o S a ==>==>
definition cluster_rbt_comp :: "('b ==> ('b, unit ('a, 'b set) rbt where "cluster_rbt_comp f t = RBT_Impl.fold (add_option_to_rbt_comp f) t RBT_Impl.Empty"
context assumesc" beginby auto
lemma add_to_rbt_comp: "add_to_rbt_compelse unfolding add_to_rbt_comp_def Xand Y:: bset by simp
lift_definition mapping_of_cluster simp split.splits) (auto: these_imageI)
cluster_rbt_comp" using linorder.is_rbt_fold_add_to_rbt[OF comparator.linorder[OF ID_ccompare'] ord.Empty_is_rbt] by (fastforce 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('a) of None ==> Code.abo(STR ''cluster: ccompare = No'') (λ (RBT_set t)) | Some c ==> assumes c: "comparator" proof - { fix c c' assume as "ID = (Some' comparator)" "ID = ( c' :: 'bcomparator option have c_def = ordadd_to_rbt (lt_of_compc)" asss(1) by auto have c'_def: "c' = ccomp" using by auto haveing clustebt_comp_ddef or.cluster_rbt_df add_o_rbt_comp using ID_ccompare'[OF assms(1)] by (auto imp: c_def) have c': "comparator usingesms] by notepping_of_clustering_of_cluster :: java.lang.NullPointerException note c'_class = comparator.linorder[OF c'] have rbt_lookup_cluster: "ord.rbt_lookup cless (cluster_rbt_comp ccomp f t) =
(λ if"ord.is_rbt cless (t :: ('b, unit using linorder.isrbt_fol[OF comparator.linorder[OF ID_ccompare' ord.Empty_is_r] proof - have is_rbt_t: "ord using that fixes f :' are 'a :: ccompare option" and t :: "('b, unit mapping_rbt show ?thesis
ome (case ID CCOMPARE('b) of None ==> by (auto SomeRightarrow (RBT_Mapping (mapping_of_clusterg2pl_of proof- havedom_ord_rbt_lookup ords\Longrightarrowwdomset t ::"', unit) rb" using linorder
yo have"cluster f (Collect (RBT_Set2.member t)) = Mapping (RBT_Mapping2.lookup (mapping_of_cluster f (mapping_rbt using assms(2)[unfolded c'_def] by (transfer fixing: f) (auto simp: in_these_eq rbt_comp_lookup[OF c] rbt_comp_lookup[OF c'] rbt_lookusing (2 } then show ?thesihavec: "comparator :: comparator unfolding RBT_set_def by (auto splitcomparatorccompcomparator)" 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.