diff -r 84eb6c75cfe3 -r 0c4fd7529467 src/HOL/Bali/TypeSafe.thy --- a/src/HOL/Bali/TypeSafe.thy Mon Feb 25 20:46:09 2002 +0100 +++ b/src/HOL/Bali/TypeSafe.thy Mon Feb 25 20:48:14 2002 +0100 @@ -10,9 +10,9 @@ section "error free" lemma error_free_halloc: - (assumes halloc: "G\s0 \halloc oi\a\ s1" and + assumes halloc: "G\s0 \halloc oi\a\ s1" and error_free_s0: "error_free s0" - ) "error_free s1" + shows "error_free s1" proof - from halloc error_free_s0 obtain abrupt0 store0 abrupt1 store1 @@ -37,8 +37,8 @@ qed lemma error_free_sxalloc: - (assumes sxalloc: "G\s0 \sxalloc\ s1" and error_free_s0: "error_free s0") - "error_free s1" + assumes sxalloc: "G\s0 \sxalloc\ s1" and error_free_s0: "error_free s0" + shows "error_free s1" proof - from sxalloc error_free_s0 obtain abrupt0 store0 abrupt1 store1 @@ -857,17 +857,17 @@ (* #### stat raus und gleich is_static f schreiben *) theorem dynamic_field_access_ok: - (assumes wf: "wf_prog G" and - not_Null: "\ stat \ a\Null" and - conform_a: "G,(store s)\a\\ Class statC" and - conform_s: "s\\(G, L)" and - normal_s: "normal s" and - wt_e: "\prg=G,cls=accC,lcl=L\\e\-Class statC" and - f: "accfield G accC statC fn = Some f" and - dynC: "if stat then dynC=declclass f - else dynC=obj_class (lookup_obj (store s) a)" and - stat: "if stat then (is_static f) else (\ is_static f)" - ) "table_of (DeclConcepts.fields G dynC) (fn,declclass f) = Some (fld f) \ + assumes wf: "wf_prog G" and + not_Null: "\ stat \ a\Null" and + conform_a: "G,(store s)\a\\ Class statC" and + conform_s: "s\\(G, L)" and + normal_s: "normal s" and + wt_e: "\prg=G,cls=accC,lcl=L\\e\-Class statC" and + f: "accfield G accC statC fn = Some f" and + dynC: "if stat then dynC=declclass f + else dynC=obj_class (lookup_obj (store s) a)" and + stat: "if stat then (is_static f) else (\ is_static f)" + shows "table_of (DeclConcepts.fields G dynC) (fn,declclass f) = Some (fld f) \ G\Field fn f in dynC dyn_accessible_from accC" proof (cases "stat") case True @@ -1017,7 +1017,7 @@ *) lemma error_free_field_access: - (assumes accfield: "accfield G accC statC fn = Some (statDeclC, f)" and + assumes accfield: "accfield G accC statC fn = Some (statDeclC, f)" and wt_e: "\prg = G, cls = accC, lcl = L\\e\-Class statC" and eval_init: "G\Norm s0 \Init statDeclC\ s1" and eval_e: "G\s1 \e-\a\ s2" and @@ -1025,7 +1025,7 @@ conf_a: "normal s2 \ G, store s2\a\\Class statC" and fvar: "(v,s2')=fvar statDeclC (is_static f) fn a s2" and wf: "wf_prog G" - ) "check_field_access G accC statDeclC fn (is_static f) a s2' = s2'" + shows "check_field_access G accC statDeclC fn (is_static f) a s2' = s2'" proof - from fvar have store_s2': "store s2'=store s2" @@ -1066,12 +1066,12 @@ qed lemma call_access_ok: -(assumes invC_prop: "G\invmode statM e\invC\statT" - and wf: "wf_prog G" - and wt_e: "\prg=G,cls=C,lcl=L\\e\-RefT statT" - and statM: "(statDeclT,statM) \ mheads G accC statT sig" - and invC: "invC = invocation_class (invmode statM e) s a statT" -)"\ dynM. dynlookup G statT invC sig = Some dynM \ + assumes invC_prop: "G\invmode statM e\invC\statT" + and wf: "wf_prog G" + and wt_e: "\prg=G,cls=C,lcl=L\\e\-RefT statT" + and statM: "(statDeclT,statM) \ mheads G accC statT sig" + and invC: "invC = invocation_class (invmode statM e) s a statT" + shows "\ dynM. dynlookup G statT invC sig = Some dynM \ G\Methd sig dynM in invC dyn_accessible_from accC" proof - from wt_e wf have type_statT: "is_type G (RefT statT)" @@ -1123,7 +1123,7 @@ qed lemma error_free_call_access: - (assumes + assumes eval_args: "G\s1 \args\\vs\ s2" and wt_e: "\prg = G, cls = accC, lcl = L\\e\-(RefT statT)" and statM: "max_spec G accC statT \name = mn, parTs = pTs\ @@ -1138,7 +1138,7 @@ invDeclC: "invDeclC = invocation_declclass G (invmode statM e) (store s2) a statT \name = mn, parTs = pTs'\" and wf: "wf_prog G" - )"check_method_access G accC statT (invmode statM e) \name=mn,parTs=pTs'\ a s3 + shows "check_method_access G accC statT (invmode statM e) \name=mn,parTs=pTs'\ a s3 = s3" proof (cases "normal s2") case False @@ -1198,11 +1198,11 @@ section "main proof of type safety" lemma eval_type_sound: - (assumes eval: "G\s0 \t\\ (v,s1)" and - wt: "\prg=G,cls=accC,lcl=L\\t\T" and - wf: "wf_prog G" and - conf_s0: "s0\\(G,L)" - ) "s1\\(G,L) \ (normal s1 \ G,L,store s1\t\v\\T) \ + assumes eval: "G\s0 \t\\ (v,s1)" and + wt: "\prg=G,cls=accC,lcl=L\\t\T" and + wf: "wf_prog G" and + conf_s0: "s0\\(G,L)" + shows "s1\\(G,L) \ (normal s1 \ G,L,store s1\t\v\\T) \ (error_free s0 = error_free s1)" proof - from eval