427 |
427 |
428 corollary no_type_errors_initial: |
428 corollary no_type_errors_initial: |
429 fixes G ("\<Gamma>") and Phi ("\<Phi>") |
429 fixes G ("\<Gamma>") and Phi ("\<Phi>") |
430 assumes wt: "wt_jvm_prog \<Gamma> \<Phi>" |
430 assumes wt: "wt_jvm_prog \<Gamma> \<Phi>" |
431 assumes is_class: "is_class \<Gamma> C" |
431 assumes is_class: "is_class \<Gamma> C" |
432 and method: "method (\<Gamma>,C) (m,[]) = Some (C, b)" |
432 and "method": "method (\<Gamma>,C) (m,[]) = Some (C, b)" |
433 and m: "m \<noteq> init" |
433 and m: "m \<noteq> init" |
434 defines start: "s \<equiv> start_state \<Gamma> C m" |
434 defines start: "s \<equiv> start_state \<Gamma> C m" |
435 |
435 |
436 assumes s: "\<Gamma> \<turnstile> (Normal s) \<midarrow>jvmd\<rightarrow> t" |
436 assumes s: "\<Gamma> \<turnstile> (Normal s) \<midarrow>jvmd\<rightarrow> t" |
437 shows "t \<noteq> TypeError" |
437 shows "t \<noteq> TypeError" |
438 proof - |
438 proof - |
439 from wt is_class method have "\<Gamma>,\<Phi> \<turnstile>JVM s \<surd>" |
439 from wt is_class "method" have "\<Gamma>,\<Phi> \<turnstile>JVM s \<surd>" |
440 unfolding start by (rule BV_correct_initial) |
440 unfolding start by (rule BV_correct_initial) |
441 from wt this s show ?thesis by (rule no_type_errors) |
441 from wt this s show ?thesis by (rule no_type_errors) |
442 qed |
442 qed |
443 |
443 |
444 text {* |
444 text {* |
459 |
459 |
460 corollary welltyped_initial_commutes: |
460 corollary welltyped_initial_commutes: |
461 fixes G ("\<Gamma>") and Phi ("\<Phi>") |
461 fixes G ("\<Gamma>") and Phi ("\<Phi>") |
462 assumes wt: "wt_jvm_prog \<Gamma> \<Phi>" |
462 assumes wt: "wt_jvm_prog \<Gamma> \<Phi>" |
463 assumes is_class: "is_class \<Gamma> C" |
463 assumes is_class: "is_class \<Gamma> C" |
464 and method: "method (\<Gamma>,C) (m,[]) = Some (C, b)" |
464 and "method": "method (\<Gamma>,C) (m,[]) = Some (C, b)" |
465 and m: "m \<noteq> init" |
465 and m: "m \<noteq> init" |
466 defines start: "s \<equiv> start_state \<Gamma> C m" |
466 defines start: "s \<equiv> start_state \<Gamma> C m" |
467 shows "\<Gamma> \<turnstile> (Normal s) \<midarrow>jvmd\<rightarrow> (Normal t) = \<Gamma> \<turnstile> s \<midarrow>jvm\<rightarrow> t" |
467 shows "\<Gamma> \<turnstile> (Normal s) \<midarrow>jvmd\<rightarrow> (Normal t) = \<Gamma> \<turnstile> s \<midarrow>jvm\<rightarrow> t" |
468 proof - |
468 proof - |
469 from wt is_class method have "\<Gamma>,\<Phi> \<turnstile>JVM s \<surd>" |
469 from wt is_class "method" have "\<Gamma>,\<Phi> \<turnstile>JVM s \<surd>" |
470 unfolding start by (rule BV_correct_initial) |
470 unfolding start by (rule BV_correct_initial) |
471 with wt show ?thesis by (rule welltyped_commutes) |
471 with wt show ?thesis by (rule welltyped_commutes) |
472 qed |
472 qed |
473 |
473 |
474 end |
474 end |