Benutzer

Quelle  Cluster.thy

  Sprache: Isabelle
 

theory Cluster
  imports Mapping_Code
begin

lemma these_Un[simp]: "Option.these (A ojava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  by (a simp: Option.thesedef)

lemma these_insert[simp]: "Option[simpOption>B)) = Option.these (f `A< Option.these
  by simp split.splits

lemma these_image_Un: " = S y \<Longrightarrow  X ==> y Option.these (f ` X)"
  byutoese_def

lemma 
   clusterb\Rightarrow ) ==> ('a, 'b set) mapping java.lang.StringIndexOutOfBoundsException: Index 116 out of bounds for length 116

lift_definition cluster(< 'a option) ==> ('a, 'b set) mapping
  "λf Y x. if Some x f ` Y then Some {y Y. f y = Some x} else None" .

lemma set_of_idx_cluster: "set_of_idx (cluster (Some (Some
  by (auto simp: ran_def)

lemma lookup_cluster': "Mapping.lookup  auto
  bytransfer

context
begin

definitionadd_to_rbt:"'a<> b ==> ('a, 'b set) rbt" where
  "add_to_rbt = (λa \times 'b \<\Rightarrow

abbreviation "add_option_to_rbt = (λ  SomeX<>  b} "

definition cluster_rbt :: "('b ==> 'a option) ==>"add_option_to_rbt f b _ t. case f b of Some a 🚫 ab t)"
  cluster_rbtrbtpty

end

contextis_rbt RBT_Implfold ( f) t t'"
begin

lemma is_rbt_add_to_rbt: "is_rbtis_rbt_cluster_rbt:"is_rbt (cluster_rbt f t)"
  byauto simp: add_to_rbt_def split: prod.splits option.splits)

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))"
proof      by (auto intro is_rbt_add_to_rbt[OF])
  caseEmpty
  then show ?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

lemma cluster_rbt_compdcluster_rbt
  unfolding cluster_rbt_comp_def fold_simps Some.case(2) Branch valid[OF] keys_fold_add_to_rbt Branch
  by simp

end

end

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

end

Messung V0.5 in Prozent
C=92 H=96 G=93

¤ Dauer der Verarbeitung: 0.4 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen



NIST Cobol Testsuite



Haftungshinweis

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.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

      Eigene Quellcodes
      Fremde Quellcodes
     Quellcodebibliothek
      Suchen

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge