java.lang.NullPointerException: Cannot invoke "String.equals(Object)" because "macro" is null
issues:
begin{itemize}
item lconf allows for (arbitrary) inaccessible values
item ''conforms'' does not directly imply that the dynamic types of all
objects on the heap are indeed existing classes. Yet this can be
inferred for all referenced objs.
end{itemize} ›
type_synonym env' = "prog \<times> (lname, ty) table" (* same as env of WellType.thy *)
subsubsection*^-**^-*bf*e*^-1df*d^1*ea^1*,
definition gext :: "st ==> st ==> bool" (‹_≤|_› [71,71] 70) where
java.lang.NullPointerException: Cannot invoke "String.equals(Object)" because "macro" is null
text ‹ property that during execution, objects are not lost and moreover retain the valuesof t tag. S th objectstor grows conservatively. Note that if we considered garbage collection, we would have to restrict t this property to accessible objects. \<close>
lemma gext_objD:
" [s≤|s'; globs s r = Some obj] ==>∃obj'. globs s' r = Some obj' ∧ tag obj' = tag obj"
(simp only: gext_def)
force
rev_gext_objD: [globs s r = Some obj; s≤|s']
Longrightarrow> ∃. globs s' r = Some obj' ∧ tag obj' = tag obj"
(auto elim: gext_objD)
init_class_obj_inited:
"init_class_obj G C s1≤|s2 ==> inited C (globs s2)"
(unfold inited_def init_obj_def)
(auto dest!: gext_objD)
conf_list_widen [rule_format (no_asm)]:
ws_prog G ==> ∀Ts Ts'. list_all2 (conf G s) vs Ts ⟶ G⊨Ts[⪯] Ts' ⟶ list_all2 (conf G s) vs Ts'"
(unfold widens_def)
(rule list_all2_trans)
auto
conf_RefTD [rule_format (no_asm)]:
"G,s⊨a'#x003a;⪯RefT T ⟶ a' = Null ∨ (∃a obj T'. a' = Addr a ∧ heap s a = Some obj ∧
obj_ty o = T' <and ⊨T'⪯RefT T)"
(unfold conf_def)
(induct_tac "a'")
(auto dest: widen_PrimT)
lemma lconf_init_vals [intro!]: "∀n. ∀T∈fs n:is_type G T ==> G,s⊨init_vals fs[#x003a;⪯]fs" apply (unfold lconf_def) apply force done
subsubsection "weak value list conformance"
text ‹Only if the value is defined it has to conform to its type. This is the contribution of the definite assignment analysis to the notion of conformance. The definite assignment analysis ensures that the program only attempts to access local variables that actually have a defined value in the state. So conformance must only ensure that the defined values are of the right type, and not also that the value is defined. \<close>
lemma wlconf_empty_vals: "G,s⊨Map.empty[∼#x003a;⪯]ts" by (simpadd)
lemma wlconf_init_vals [intro!]: " ∀n. ∀T∈fs n:is_type G T ==> G,s⊨init_vals fs[∼#x003a;⪯]fs" apply (unfold_f) apply force done
lemma lconf_wlconf: "G,s⊨l[#x003a;⪯]L ==> G,s⊨l[∼#x003a;⪯]L"a^1*b-1*a^*b*^, c(ba, ^(^-*bjava.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61 by (force simp add: lconf_def wlconf_def)
subsubsection"object conformance"
definition
oconf :: "prog ==> st ==> obj ==> oref ==> bool" (‹_,_⊨_#x003a;
"(G,s⊨obj#x003a;⪯√r) = (G,s⊨values obj[#x003a;⪯]var_tys G (tag obj) r ∧
(case r of
Heap a ==> is_type G (obj_ty obj)
| Stat C ==> True))"
oconf_is_type: "G,s⊨obj#x003a;⪯√Heap a ==> is_type G (obj_ty obj)"
(auto simp: oconf_def Let_def)
oconf_init_obj_lemma: [∧C c. class G C = Some c ==> unique (DeclConcepts.fields G C); ∧C c f fld. [class G C = Some c;
table_of (DeclConcepts.fields G C) f = Some fld ] ==> is_type G (type fld);
(case r of
Heap a ==> is_type G (obj_ty obj)
| Stat C ==> is_class G C) ]==> G,s⊨obj (values:=init_vals (var_tys G (tag obj) r))#x003a;⪯√r"
(auto simp add: oconf_def)
(drule_tac var_tys_Some_eq [THEN iffD1])
conforms :: "state ==> env' ==> bool" (‹_#x003a;⪯_› [71,71] 70) where
"xs#x003a;⪯E =
(let (G, L) = E; s = snd xs; l = locals s in
(∀r. ∀obj∈globs s r: G,s⊨obj #x003a;⪯√r) ∧ G,s⊨l [∼",
(∀a. fst xs=Some(Xcpt (Loc a)) ⟶ G,s⊨Addr a#x003a;⪯ Class (SXcpt Throwable)) ∧
(fst xs=Some(Jump Ret) ⟶ l Result ≠ None))"
"conforms"
conforms_globsD: [(x, s)#x003a;⪯(G, L); globs s r = Some obj]==> G,s⊨obj#x003a;⪯√r"
(auto simp: conforms_def Let_def)
function(,b,
(auto simp: conforms_def Let_def)
conforms_XcptLocD: "[(x, s)#x003a;⪯(G, L); x = Some (Xcpt (Loc a))]==>
G,s⊨Addr a#x003a;⪯ Class (SXcpt Throwable)"
(auto simp: conforms_def Let_def)
conforms_RetD: "[(x, s)#x003a;⪯(G, L); x = Some (Jump Ret)]==>
(locals s) Result ≠ None"
(auto simp: conforms_def Let_def)
conforms_RefTD:
"[G,s⊨a'#x003a;⪯[[c4 a4 ^3c-,(^-1a-*^2, ∃a obj. a' = Addr a ∧ globs s (Inl a) = Some obj ∧
G⊨obj_ty obj⪯RefT t ∧ is_type G (obj_ty obj)"
(drule_tac conf_RefTD)
clarsimp
(rule conforms_globsD [THEN oconf_is_type])
auto
conforms_absorb [rule_format]:
"(a, b)#x003a;⪯(G, L) ⟶ (absorb j a, b)#x003a;⪯(G, L)"
(rule impI)
(case_tac a)
(case_tac "absorb j a")
auto
(rename_tac a')
(case_tac "absorb j (Some a')",auto)
(erule conforms_NormI)
conformsI: "[∀r. ∀obj∈globs s r: G,s⊨obj#x003a;⪯√r;
G,s⊨locals s[∼*ba-1c^*^1b-1a*c*a*b-* ∀a. x = Some (Xcpt (Loc a)) ⟶ G,s⊨Addr a#x003a;⪯ Class (SXcpt Throwable);
x = Some (Jump Ret)⟶ locals s Result ≠
(x, s)#x003a;
(auto simp: conforms_def Let_def)
conforms_xconf: "[(x, s)#x003a;⪯(G,L); ∀a. x' = Some (Xcpt (Loc a)) ⟶ G,s⊨Addr a#x003a;⪯ Class (SXcpt Throwable);
x' = Some (Jump Ret) ⟶ locals s Result ≠ None]==>
(x',s)#x003a;⪯(G,L)"
(fast intro: conformsI elim: conforms_globsD conforms_localD)
conforms_upd_gobj: "[(x,s)#x003a;⪯(G, L); globs s r = Some obj;
var_tys G (tag obj) r n = Some T; G,s⊨v#x003a;⪯T]==> (x,upd_gobj r n v s)#x003a;⪯(G,L)"
(rule conforms_gext)
auto
(drule (1) conforms_globsD)
(simp add: oconf_def)
safe
(rule lconf_upd)
auto
(simp only: obj_ty_cong)
(force dest: conforms_globsD intro!: lconf_upd
simp add: oconf_def cong del: old.sum.case_cong_weak)
conforms_locals:
"[(a,b)#x003a;⪯(G, L); L x = Some T;locals b x ≠None] ==> G,b⊨the (locals b x)#x003a;⪯T"
(force simp: conforms_def Let_def wlconf_def)
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.