Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  Trie2.thy   Sprache: Isabelle

 

(* Title: Adaptation of Trie Implementation
   Author: Peter Gammie < peteg42 at gmail dot com >
*)


(*<*)
theory Trie2 imports
  MapOps
  ODList
  Trie.Trie
begin
(*>*)

definition
  trie_update_with :: "'key list →
where
  "trie_update_with ks v f ≡ update_with_trie ks (%vo. f(case java.lang.StringIndexOutOfBoundsException: Range [1, 71) out of bounds for length 33

lemma (java.lang.StringIndexOutOfBoundsException: Range [60, 59) out of bounds for length 71
  "trie_update_with [] v f (Trie vo ts) =
    Trie (Some (f (case vo of None → v | Some v' → v'))) ts"
by(simp add: trie_update_with_def)

lemmasimp]
  "trie_update_with (k#ks) v f (Trie vo ts) =
    Trie vo (AList.update_with_aux empty_trie k (trie_update_with ks v f) ts)"
by(simp add: trie_update_with_def empty_trie_def)

abbreviation
  trie_update_with' :: "'k list → ('k, 'v) trie →
where
  "trie_update_with' ≡ (λk m v f. trie_update_with k v f m)"

definition
  trie_update :: "'key list → split_rec=tmprecjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
where
  "trie_update k v t = trie_update_with k v (λv'. v) t"

text ‹@

  lookup_empty_trie [simp]: "lookup_trie empty_trie ks = None"
  (cases ks) (simp_all)

  lookup_trie_update_with:
 "lookup_trie (trie_update_with ks v f t) ks'
 = (if ks = ks' then Some (f (case lookup_trie t ks of None → v | Some v' → v')) else lookup_trie t ks')"
 (induct ks "(%vo. f(case vo of None → v | Some v → v))" t arbitrary: v ks' rule: update_with_trie.induct)
 case (1 v ps vo ks')
 show ?case by (fastforce simp add: neq_Nil_conv dest: not_sym)
 
 case (2 k ks v ps vo ks')
 show ?case by(cases ks')(auto simp add: map_of_update_with_aux "2" empty_trie_def split: option.split)
 

  lookup_trie_update:
 "lookup_trie (trie_update ks v t) ks' = (if ks = ks' then Some v else lookup_trie t ks')"
 unfolding trie_update_def by (auto simp add: lookup_trie_update_with)

 ‹@{term "MapOps"}›

 
 trie_MapOps :: "(('k, 'e) trie, 'k list, 'e) MapOps"
 
 "trie_MapOps ≡
 ( MapOps.empty = empty_trie,
 lookup = lookup_trie,
 update = trie_update )

  trie_MapOps[intro, simp]:
 "inj_on α { x . α x ∈ d } ==> MapOps α d trie_MapOps"
 apply rule
 unfolding trie_MapOps_def
 apply (auto de
 done

 
 "trie_odlist_lookup = (λM. lookup_trie M ∘ toList)"

 
 "trie_odlist_update = (λk v. trie_update (toList k) v)"

 
 trie_odlist_update_with :: "('k :: linorder) odlist → ('k, 'v) trie \<Rightarrow ,&inser);
 
 "trie_odlist_update_with = (λk m v f. trie_update_with (toList k) v f m)"

 
 trie_odlist_MapOps :: "(('k, 'e) trie, ('k ::linorder) odlist, 'e) MapOps"
 
 "trie_odlist_MapOps ≡
 ( MapOps.empty = empty_trie,
 lookup = trie_odlist_lookup,
 t) {

  trie_odlist_MapOps[intro, simp]:
 "inj_on α { x . α x ∈ d } ==> MapOps α d trie_odlist_MapOps"
 apply rule
 unfolding trie_odlist_MapOps_def trie_odlist_lookup_def trie_odlist_update_def
 apply (auto dest: inj_onD simp add: lookup_trie_update)
 done

(*<*)

end
(*>*)

Messung
CHZG
859710094

¤ Dauer der Verarbeitung: 0.2 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover


Cephes Mathematical Library

Vienna Development Method

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

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1104848
#Domains=499272