definition del_locs :: "state => state"where "del_locs s ≡ s (| locals := Map.empty |)"
definition init_locs :: "cname => mname => state => state"where "init_locs C m s ≡ s (| locals := locals s ++ init_vars (map_of (lcl (the (method C m)))) |)"
text‹The first parameter of 🍋‹set_locs›is of type 🍋‹state› rather than 🍋‹locals›in order to keep 🍋‹locals› private.› definition set_locs :: "state => state => state"where "set_locs s s' ≡ s' (| locals := locals s |)"
definition get_local :: "state => vname => val" (‹_🪙› [99,0] 99) where "get_local s x ≡ the (locals s x)"
🍋‹local function:› definition get_obj :: "state => loc => obj"where "get_obj s a ≡ the (heap s a)"
definition obj_class :: "state => loc => cname"where "obj_class s a ≡ fst (get_obj s a)"
definition get_field :: "state => loc => fname => val"where "get_field s a f ≡ the (snd (get_obj s a) f)"
🍋‹local function:› definition hupd :: "loc => obj => state => state" (‹hupd'(_↦_')› [10,10] 1000) where "hupd a obj s ≡ s (| heap := ((heap s)(a↦obj))|)"
definition lupd :: "vname => val => state => state" (‹lupd'(_↦_')› [10,10] 1000) where "lupd x v s ≡ s (| locals := ((locals s)(x↦v ))|)"
definition new_obj :: "loc => cname => state => state"where "new_obj a C ≡ hupd(a↦(C,init_vars (field C)))"
definition upd_obj :: "loc => fname => val => state => state"where "upd_obj a f v s ≡ let (C,fs) = the (heap s a) in hupd(a↦(C,fs(f↦v))) s"
definition new_Addr :: "state => val"where "new_Addr s == SOME v. (∃a. v = Addr a ∧ (heap s) a = None) | v = Null"
subsection"Properties not used in the meta theory"
lemma new_obj_lupd [simp]: "new_obj a C (lupd(x↦y) s) = lupd(x↦y) (new_obj a C s)" by (simp add: new_obj_def)
lemma new_obj_del_locs [simp]: "new_obj a C (del_locs s) = del_locs (new_obj a C s)" by (simp add: new_obj_def)
lemma upd_obj_lupd [simp]: "upd_obj a f v (lupd(x↦y) s) = lupd(x↦y) (upd_obj a f v s)" by (simp add: upd_obj_def Let_def split_beta)
lemma upd_obj_del_locs [simp]: "upd_obj a f v (del_locs s) = del_locs (upd_obj a f v s)" by (simp add: upd_obj_def Let_def split_beta)
lemma get_field_hupd_same [simp]: "get_field (hupd(a↦(C, fs)) s) a = the ∘ fs" apply (rule ext) by (simp add: get_field_def get_obj_def)
lemma get_field_hupd_other [simp]: "aa ≠ a ==> get_field (hupd(aa↦obj) s) a = get_field s a" apply (rule ext) by (simp add: get_field_def get_obj_def)
lemma new_AddrD: "new_Addr s = v ==> (∃a. v = Addr a ∧ heap s a = None) | v = Null" apply (unfold new_Addr_def) apply (erule subst) apply (rule someI) apply (rule disjI2) apply (rule HOL.refl) done
end
Messung V0.5 in Prozent
¤ 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.44Bemerkung:
(vorverarbeitet am 2026-04-28)
¤
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.