# HG changeset patch # User wenzelm # Date 1376426278 -7200 # Node ID e0968e1f6fe93a599af681520380afc75c00fa88 # Parent f127e949389f173abc8699af55bccaf4c5a7a5e2 more symbolic notation; diff -r f127e949389f -r e0968e1f6fe9 src/HOL/MicroJava/BV/BVNoTypeError.thy --- a/src/HOL/MicroJava/BV/BVNoTypeError.thy Tue Aug 13 22:25:24 2013 +0200 +++ b/src/HOL/MicroJava/BV/BVNoTypeError.thy Tue Aug 13 22:37:58 2013 +0200 @@ -397,8 +397,8 @@ one (after arbitrarily many steps). *} theorem welltyped_aggressive_imp_defensive: - "wt_jvm_prog G Phi \ G,Phi \JVM s \ \ G \ s -jvm\ t - \ G \ (Normal s) -jvmd\ (Normal t)" + "wt_jvm_prog G Phi \ G,Phi \JVM s \ \ G \ s \jvm\ t + \ G \ (Normal s) \jvmd\ (Normal t)" apply (unfold exec_all_def) apply (erule rtrancl_induct) apply (simp add: exec_all_d_def) @@ -417,7 +417,7 @@ theorem no_type_errors: "wt_jvm_prog G Phi \ G,Phi \JVM s \ - \ G \ (Normal s) -jvmd\ t \ t \ TypeError" + \ G \ (Normal s) \jvmd\ t \ t \ TypeError" apply (unfold exec_all_d_def) apply (erule rtrancl_induct) apply simp @@ -433,7 +433,7 @@ and m: "m \ init" defines start: "s \ start_state \ C m" - assumes s: "\ \ (Normal s) -jvmd\ t" + assumes s: "\ \ (Normal s) \jvmd\ t" shows "t \ TypeError" proof - from wt is_class method have "\,\ \JVM s \" @@ -449,7 +449,7 @@ corollary welltyped_commutes: fixes G ("\") and Phi ("\") assumes wt: "wt_jvm_prog \ \" and *: "\,\ \JVM s \" - shows "\ \ (Normal s) -jvmd\ (Normal t) = \ \ s -jvm\ t" + shows "\ \ (Normal s) \jvmd\ (Normal t) = \ \ s \jvm\ t" apply rule apply (erule defensive_imp_aggressive, rule welltyped_aggressive_imp_defensive) apply (rule wt) @@ -464,7 +464,7 @@ and method: "method (\,C) (m,[]) = Some (C, b)" and m: "m \ init" defines start: "s \ start_state \ C m" - shows "\ \ (Normal s) -jvmd\ (Normal t) = \ \ s -jvm\ t" + shows "\ \ (Normal s) \jvmd\ (Normal t) = \ \ s \jvm\ t" proof - from wt is_class method have "\,\ \JVM s \" unfolding start by (rule BV_correct_initial) diff -r f127e949389f -r e0968e1f6fe9 src/HOL/MicroJava/BV/BVSpecTypeSafe.thy --- a/src/HOL/MicroJava/BV/BVSpecTypeSafe.thy Tue Aug 13 22:25:24 2013 +0200 +++ b/src/HOL/MicroJava/BV/BVSpecTypeSafe.thy Tue Aug 13 22:37:58 2013 +0200 @@ -1304,7 +1304,7 @@ done theorem BV_correct [rule_format]: -"\ wt_jvm_prog G phi; G \ s -jvm\ t \ \ G,phi \JVM s\ \ G,phi \JVM t\" +"\ wt_jvm_prog G phi; G \ s \jvm\ t \ \ G,phi \JVM s\ \ G,phi \JVM t\" apply (unfold exec_all_def) apply (erule rtrancl_induct) apply simp @@ -1314,7 +1314,7 @@ theorem BV_correct_implies_approx: "\ wt_jvm_prog G phi; - G \ s0 -jvm\ (None,hp,(stk,loc,C,sig,pc)#frs); G,phi \JVM s0 \\ + G \ s0 \jvm\ (None,hp,(stk,loc,C,sig,pc)#frs); G,phi \JVM s0 \\ \ approx_stk G hp stk (fst (the (phi C sig ! pc))) \ approx_loc G hp loc (snd (the (phi C sig ! pc)))" apply (drule BV_correct) @@ -1356,12 +1356,12 @@ assumes welltyped: "wt_jvm_prog \ \" and main_method: "is_class \ C" "method (\,C) (m,[]) = Some (C, b)" shows typesafe: - "G \ start_state \ C m -jvm\ s \ \,\ \JVM s \" + "G \ start_state \ C m \jvm\ s \ \,\ \JVM s \" proof - from welltyped main_method have "\,\ \JVM start_state \ C m \" by (rule BV_correct_initial) moreover - assume "G \ start_state \ C m -jvm\ s" + assume "G \ start_state \ C m \jvm\ s" ultimately show "\,\ \JVM s \" using welltyped by - (rule BV_correct) qed diff -r f127e949389f -r e0968e1f6fe9 src/HOL/MicroJava/Comp/CorrComp.thy --- a/src/HOL/MicroJava/Comp/CorrComp.thy Tue Aug 13 22:25:24 2013 +0200 +++ b/src/HOL/MicroJava/Comp/CorrComp.thy Tue Aug 13 22:37:58 2013 +0200 @@ -59,7 +59,7 @@ theorem exec_instr_in_exec_all: "\ exec_instr i G hp stk lvars C S pc frs = (None, hp', frs'); gis (gmb G C S) ! pc = i\ \ - G \ (None, hp, (stk, lvars, C, S, pc) # frs) -jvm\ (None, hp', frs')" + G \ (None, hp, (stk, lvars, C, S, pc) # frs) \jvm\ (None, hp', frs')" apply (simp only: exec_all_def) apply (rule rtrancl_refl [THEN rtrancl_into_rtrancl]) apply (simp add: gis_def gmb_def) @@ -71,7 +71,7 @@ (exec_instr i G hp0 stk0 lvars0 C S pc0 frs) = (None, hp1, (stk1,lvars1,C,S, Suc pc0)#frs) \ \ - G \ (None, hp0, (stk0,lvars0,C,S, pc0)#frs) -jvm\ + G \ (None, hp0, (stk0,lvars0,C,S, pc0)#frs) \jvm\ (None, hp1, (stk1,lvars1,C,S, Suc pc0)#frs)" apply (unfold exec_all_def) apply (rule r_into_rtrancl) @@ -90,7 +90,7 @@ "{G,C,S} \ {hp0, os0, lvars0} >- instrs \ {hp1, os1, lvars1} == \ pre post frs. (gis (gmb G C S) = pre @ instrs @ post) \ - G \ (None,hp0,(os0,lvars0,C,S,length pre)#frs) -jvm\ + G \ (None,hp0,(os0,lvars0,C,S,length pre)#frs) \jvm\ (None,hp1,(os1,lvars1,C,S,(length pre) + (length instrs))#frs)" diff -r f127e949389f -r e0968e1f6fe9 src/HOL/MicroJava/JVM/JVMDefensive.thy --- a/src/HOL/MicroJava/JVM/JVMDefensive.thy Tue Aug 13 22:25:24 2013 +0200 +++ b/src/HOL/MicroJava/JVM/JVMDefensive.thy Tue Aug 13 22:37:58 2013 +0200 @@ -119,14 +119,11 @@ definition exec_all_d :: "jvm_prog \ jvm_state type_error \ jvm_state type_error \ bool" - ("_ |- _ -jvmd-> _" [61,61,61]60) where - "G |- s -jvmd-> t \ + ("_ \ _ \jvmd\ _" [61,61,61]60) where + "G \ s \jvmd\ t \ (s,t) \ ({(s,t). exec_d G s = TypeError \ t = TypeError} \ {(s,t). \t'. exec_d G s = Normal (Some t') \ t = Normal t'})\<^sup>*" -notation (xsymbols) - exec_all_d ("_ \ _ -jvmd\ _" [61,61,61]60) - declare split_paired_All [simp del] declare split_paired_Ex [simp del] @@ -146,9 +143,9 @@ lemma defensive_imp_aggressive: - "G \ (Normal s) -jvmd\ (Normal t) \ G \ s -jvm\ t" + "G \ (Normal s) \jvmd\ (Normal t) \ G \ s \jvm\ t" proof - - have "\x y. G \ x -jvmd\ y \ \s t. x = Normal s \ y = Normal t \ G \ s -jvm\ t" + have "\x y. G \ x \jvmd\ y \ \s t. x = Normal s \ y = Normal t \ G \ s \jvm\ t" apply (unfold exec_all_d_def) apply (erule rtrancl_induct) apply (simp add: exec_all_def) @@ -163,9 +160,9 @@ apply blast done moreover - assume "G \ (Normal s) -jvmd\ (Normal t)" + assume "G \ (Normal s) \jvmd\ (Normal t)" ultimately - show "G \ s -jvm\ t" by blast + show "G \ s \jvm\ t" by blast qed end \ No newline at end of file diff -r f127e949389f -r e0968e1f6fe9 src/HOL/MicroJava/JVM/JVMExec.thy --- a/src/HOL/MicroJava/JVM/JVMExec.thy Tue Aug 13 22:25:24 2013 +0200 +++ b/src/HOL/MicroJava/JVM/JVMExec.thy Tue Aug 13 22:37:58 2013 +0200 @@ -24,13 +24,10 @@ definition exec_all :: "[jvm_prog,jvm_state,jvm_state] => bool" - ("_ |- _ -jvm-> _" [61,61,61]60) where - "G |- s -jvm-> t == (s,t) \ {(s,t). exec(G,s) = Some t}^*" + ("_ \ _ \jvm\ _" [61,61,61]60) where + "G \ s \jvm\ t == (s,t) \ {(s,t). exec(G,s) = Some t}^*" -notation (xsymbols) - exec_all ("_ \ _ -jvm\ _" [61,61,61]60) - text {* The start configuration of the JVM: in the start heap, we call a method @{text m} of class @{text C} in program @{text G}. The