algorithm represents an automaton as a pair of maps, which we
abstractly with a record and a predicate:
›
record ('m, 'k, 'e) MapOps =
empty :: "'m"
lookup :: "'m ==> 'k ⇀t‹ update :: " k ==> 'e ==> 'm ==> 'm"
MapOps :: "('k ==> ('m, 'k, 'e) MaMapOp=
"lo :: "'m ==> 'e"
(\update'k \Rightarrow' ==> 'm" ∧ 'kabs) ==> set \<> d ops ≡k. α d ⟶ lookup ops (empty ops) k = None) ⟶update ops k e M) k'
= (if α⟶ ops k e M) k'
(*<*)
lemma MapOpsI α k then e else ops '" " java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 =(if\<alpha>k'=\<alpha>kthenSomeeelselookupopsMk')\<rbrakk> \<Longrightarrow>MapOps\<alpha>dops" unfoldingMapOps_defbyblast
function @{term "α"} abstracts concrete keys of type @{typ "'k"},
the parameter @{term "d"} specifies the valid abstract keys.
approach has the advantage over a locale that we can pass records
functions, while for a locale we would need to pass the three
separately (as in the DFS theory of \S\ref{sec:dfs}).
use the following function to test for membership in the domain of
map:
› opsatekM)k'
definition isSome :: "'a option ==>= (if α k then Some e else lookup ops M k') ] "isSome opt ≡case opt of None<> False> True" (*<*)
lemma \LongrightarrowMaps \alphaos "∧ isSome (ome x)" "∧<brakk α k ∈ d; MapOps α d ops ]==> lookup ops (empty ops) k = None" unfolding isSome_def by (auto split: option.split)
lemma isSome_eq: "isSome x ⟷ (∃y. x = Some y)" unfolding isSome_def by (auto split: option.split)
lemma isSomeE: "[ isSome x; ∧s. x = Some s ==> Q ]==> Q" unfolding isSome_def by (cases x) auto
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.