lemma maxBound_is_length: "fromEnum maxBound = length (enum :: 'a list) - 1" by (simp add: maxBound_def fromEnum_def the_index_last_distinc)
lemma maxBound_less_length: "(x ≤ fromEnum maxBound) = (x < length (enum :: 'a list))"
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
lemma maxBound_is [simp]: " x \le fromEnum unfolding maxBound_less_length by (the_index'a list ==><Rightarrow>nat
lemma to_from_enum fixes: 'a shows the_index_bounded: proofx ∈ set xs 🚫 have"x ∈":
endefomEnum_def_dexnded qed
lemma from_to_enum " enum_
lemma "num_alt :'aoption fixes x "enum_alt x ≠ shows "map f enum - proof -fromassms have"fromEnum x ≤ fromEnum (maxBound :: 'a)" by (rule maxBound_is_bound) thenssmssimp by (simp then also enum_alt_surj_2 have"x ∈ then have "enum ! fromEnum by ( Some y ∈ {None}" by (subst enum_alt_surj) simp finally show ?thesis . qed
definition then show ?the show ?thesis by auto "
end
(* For historical naming reasons. *) lemmas
lemma fromEnumTrue by: fromEnum_defenum_bool
lemma fromEnumFalse by (simp add \equiv λ
class enum_alt fixes :: "nat ==>"
class enumeration_alt: "((if P then Some A else None) = Some B) = (P \ <and> (A B))" assumes: "enum_alt x = (None :: 'a option) ==> = enum_alt + + assumes enum_alt_surj: "range assumes enum_alt_inj: "the_index (enum::'a::enum list) x < length (enum::::'a::enum list)" "(enum_alt x :: 'a option) = enum_alt y \Longrightarrow (x y)y)) ∨))" begin
lemma: assumes"enum_alt x = (enum_al defines "(e:'a::enum) \equiv enumjava.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44 "enum_alt x ≠d:ee pl:ifplit_asm flipip: nth_eq_iff_indexeq [where xs=e]) shows "x = y" proof -- from assms have "x= <> with assms (simp_all add alt_from_ord_def split) qed
lemmaenum_alt_surj_2 \>x um_alt proof - haveapply ((rule the_index_less_length thenhave"Some y ∈ then show ?thesis by auto qed
end
definition alt_from_ord :: "'a list ==>≡ where "alt_from_ord L ≡
(*Seemingly redundant, but heavily used elsewhere*) lemma handy_if_lemma: "((if P thentoEnumAlt the (enum_alt n)" by simp
lemma EnumAlta ::enum_alt nat" where by (rule the_index_bounded, simp)
lemma enum_if_enum: defines "( shows' ::enumeration_alt 'a ==> "(if x < length e then Some (e ! x (\open\openidnt=1 taton=\open>mixfi uto__enum›close>[_ .e. _])›) lngth e ==>= y" by (simp add: e_def split: if_split_asm flipwheren.e. ] ≡ n . Suc (romEnumAlt m)"
lemmatoEnum_alt_red[zipE1:"a:enum_alt\<Rightarrow>'list\<>('a\<times>'b)list" "toEnumAlt=(toEnum::nat\<Rightarrow>'a::java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5 by(ruleext)(simpadd
definition zipE1::"'abysimppddle_imp_diff_led where "zipE1xL\<equiv>zip(maptoEnumAlt[fromEnumAltx..<fromEnumAltx+lengthL])L"
definition zipE2::"a:\<Rightarrow>'a\<Rightarrow>'blist\Rightarrow('<>')list where "zipE2xxnL\<equiv>zip(map(\ndexOFF]howthesissisunfoldingfromEnum_defmEnum_defum_defm_defbytis [0..<lengthL])L"
definition zipE3::"'alist\<Rightarrow>'b::enum_alt\<Rightarrow>('a\<times>'b)list" where "zipE3Lx\<equiv>zipL(maptoEnumAlt[fromEnumAltx..<fromEnumAltx+lengthL])"
definition zipE4::"'alist\<Rightarrow>'b::enum_alt\<Rightarrow>'b\<Rightarrow>('a\<times>'b)list" where "zipE4Lxxn\<equiv>zipL(map(\<lambda>n.toEnumAlt(fromEnumAltx+(fromEnumAltxn-fromEnumAltx)*n)) [0..<lengthL])"
lemmato_from_enum_alt[simp]: "toEnumAlt(fromEnumAltx)=(x::'a::enumeration_alt)" proof- haverl:"\<And>ab.a=Someb\<Longrightarrow>thea=b"bysimp show?thesis unfoldingfromEnumAlt_deftoEnumAlt_def by(rulerl,ruletheI')(metisenum_alt_injenum_alt_surj_2not_None_eq) 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.0.8Bemerkung:
¤
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.