src/HOL/MicroJava/J/Example.thy
changeset 68451 c34aa23a1fb6
parent 67613 ce654b0e6d69
child 77645 7edbb16bc60f
equal deleted inserted replaced
68450:41de07c7a0f3 68451:c34aa23a1fb6
   118   tprg  ::"java_mb prog" where
   118   tprg  ::"java_mb prog" where
   119   "tprg == [ObjectC, BaseC, ExtC, ClassCastC, NullPointerC, OutOfMemoryC]"
   119   "tprg == [ObjectC, BaseC, ExtC, ClassCastC, NullPointerC, OutOfMemoryC]"
   120 
   120 
   121 abbreviation
   121 abbreviation
   122   obj1  :: obj where
   122   obj1  :: obj where
   123   "obj1 == (Ext, empty((vee, Base)\<mapsto>Bool False) ((vee, Ext )\<mapsto>Intg 0))"
   123   "obj1 == (Ext, Map.empty((vee, Base)\<mapsto>Bool False) ((vee, Ext )\<mapsto>Intg 0))"
   124 
   124 
   125 abbreviation "s0 == Norm    (empty, empty)"
   125 abbreviation "s0 == Norm    (Map.empty, Map.empty)"
   126 abbreviation "s1 == Norm    (empty(a\<mapsto>obj1),empty(e\<mapsto>Addr a))"
   126 abbreviation "s1 == Norm    (Map.empty(a\<mapsto>obj1),Map.empty(e\<mapsto>Addr a))"
   127 abbreviation "s2 == Norm    (empty(a\<mapsto>obj1),empty(x\<mapsto>Null)(This\<mapsto>Addr a))"
   127 abbreviation "s2 == Norm    (Map.empty(a\<mapsto>obj1),Map.empty(x\<mapsto>Null)(This\<mapsto>Addr a))"
   128 abbreviation "s3 == (Some NP, empty(a\<mapsto>obj1),empty(e\<mapsto>Addr a))"
   128 abbreviation "s3 == (Some NP, Map.empty(a\<mapsto>obj1),Map.empty(e\<mapsto>Addr a))"
   129 
   129 
   130 lemmas map_of_Cons = map_of.simps(2)
   130 lemmas map_of_Cons = map_of.simps(2)
   131 
   131 
   132 lemma map_of_Cons1 [simp]: "map_of ((aa,bb)#ps) aa = Some bb"
   132 lemma map_of_Cons1 [simp]: "map_of ((aa,bb)#ps) aa = Some bb"
   133 apply (simp (no_asm))
   133 apply (simp (no_asm))
   373 apply (unfold max_spec_def)
   373 apply (unfold max_spec_def)
   374 apply (auto simp add: appl_methds_foo_Base)
   374 apply (auto simp add: appl_methds_foo_Base)
   375 done
   375 done
   376 
   376 
   377 lemmas t = ty_expr_ty_exprs_wt_stmt.intros
   377 lemmas t = ty_expr_ty_exprs_wt_stmt.intros
   378 schematic_goal wt_test: "(tprg, empty(e\<mapsto>Class Base))\<turnstile>  
   378 schematic_goal wt_test: "(tprg, Map.empty(e\<mapsto>Class Base))\<turnstile>  
   379   Expr(e::=NewC Ext);; Expr({Base}LAcc e..foo({?pTs'}[Lit Null]))\<surd>"
   379   Expr(e::=NewC Ext);; Expr({Base}LAcc e..foo({?pTs'}[Lit Null]))\<surd>"
   380 apply (rule ty_expr_ty_exprs_wt_stmt.intros) \<comment> \<open>;;\<close>
   380 apply (rule ty_expr_ty_exprs_wt_stmt.intros) \<comment> \<open>;;\<close>
   381 apply  (rule t) \<comment> \<open>Expr\<close>
   381 apply  (rule t) \<comment> \<open>Expr\<close>
   382 apply  (rule t) \<comment> \<open>LAss\<close>
   382 apply  (rule t) \<comment> \<open>LAss\<close>
   383 apply    simp \<comment> \<open>\<open>e \<noteq> This\<close>\<close>
   383 apply    simp \<comment> \<open>\<open>e \<noteq> This\<close>\<close>