diff -r 894e82be8d05 -r af4c18c30593 src/HOL/Bali/Example.thy --- a/src/HOL/Bali/Example.thy Tue Feb 09 16:07:09 2010 +0100 +++ b/src/HOL/Bali/Example.thy Wed Feb 10 00:45:16 2010 +0100 @@ -1202,74 +1202,52 @@ abbreviation "one == Suc 0" abbreviation "two == Suc one" -abbreviation "tree == Suc two" -abbreviation "four == Suc tree" +abbreviation "three == Suc two" +abbreviation "four == Suc three" + +abbreviation + "obj_a == \tag=Arr (PrimT Boolean) 2 + ,values= empty(Inr 0\Bool False)(Inr 1\Bool False)\" -syntax - obj_a :: obj - obj_b :: obj - obj_c :: obj - arr_N :: "(vn, val) table" - arr_a :: "(vn, val) table" - globs1 :: globs - globs2 :: globs - globs3 :: globs - globs8 :: globs - locs3 :: locals - locs4 :: locals - locs8 :: locals - s0 :: state - s0' :: state - s9' :: state - s1 :: state - s1' :: state - s2 :: state - s2' :: state - s3 :: state - s3' :: state - s4 :: state - s4' :: state - s6' :: state - s7' :: state - s8 :: state - s8' :: state +abbreviation + "obj_b == \tag=CInst Ext + ,values=(empty(Inl (vee, Base)\Null ) + (Inl (vee, Ext )\Intg 0))\" + +abbreviation + "obj_c == \tag=CInst (SXcpt NullPointer),values=CONST empty\" + +abbreviation "arr_N == empty(Inl (arr, Base)\Null)" +abbreviation "arr_a == empty(Inl (arr, Base)\Addr a)" + +abbreviation + "globs1 == empty(Inr Ext \\tag=undefined, values=empty\) + (Inr Base \\tag=undefined, values=arr_N\) + (Inr Object\\tag=undefined, values=empty\)" -translations - "obj_a" <= "\tag=Arr (PrimT Boolean) (CONST two) - ,values=CONST empty(CONST Inr 0\Bool False)(CONST Inr (CONST one)\Bool False)\" - "obj_b" <= "\tag=CInst (CONST Ext) - ,values=(CONST empty(CONST Inl (CONST vee, CONST Base)\Null ) - (CONST Inl (CONST vee, CONST Ext )\Intg 0))\" - "obj_c" == "\tag=CInst (SXcpt NullPointer),values=CONST empty\" - "arr_N" == "CONST empty(CONST Inl (CONST arr, CONST Base)\Null)" - "arr_a" == "CONST empty(CONST Inl (CONST arr, CONST Base)\Addr a)" - "globs1" == "CONST empty(CONST Inr (CONST Ext) \\tag=CONST undefined, values=CONST empty\) - (CONST Inr (CONST Base) \\tag=CONST undefined, values=arr_N\) - (CONST Inr Object\\tag=CONST undefined, values=CONST empty\)" - "globs2" == "CONST empty(CONST Inr (CONST Ext) \\tag=CONST undefined, values=CONST empty\) - (CONST Inr Object\\tag=CONST undefined, values=CONST empty\) - (CONST Inl a\obj_a) - (CONST Inr (CONST Base) \\tag=CONST undefined, values=arr_a\)" - "globs3" == "globs2(CONST Inl b\obj_b)" - "globs8" == "globs3(CONST Inl c\obj_c)" - "locs3" == "CONST empty(VName (CONST e)\Addr b)" - "locs4" == "CONST empty(VName (CONST z)\Null)(CONST Inr()\Addr b)" - "locs8" == "locs3(VName (CONST z)\Addr c)" - "s0" == " st (CONST empty) (CONST empty)" - "s0'" == " Norm s0" - "s1" == " st globs1 (CONST empty)" - "s1'" == " Norm s1" - "s2" == " st globs2 (CONST empty)" - "s2'" == " Norm s2" - "s3" == " st globs3 locs3 " - "s3'" == " Norm s3" - "s4" == " st globs3 locs4" - "s4'" == " Norm s4" - "s6'" == "(Some (Xcpt (Std NullPointer)), s4)" - "s7'" == "(Some (Xcpt (Std NullPointer)), s3)" - "s8" == " st globs8 locs8" - "s8'" == " Norm s8" - "s9'" == "(Some (Xcpt (Std IndOutBound)), s8)" +abbreviation + "globs2 == empty(Inr Ext \\tag=undefined, values=empty\) + (Inr Object\\tag=undefined, values=empty\) + (Inl a\obj_a) + (Inr Base \\tag=undefined, values=arr_a\)" + +abbreviation "globs3 == globs2(Inl b\obj_b)" +abbreviation "globs8 == globs3(Inl c\obj_c)" +abbreviation "locs3 == empty(VName e\Addr b)" +abbreviation "locs8 == locs3(VName z\Addr c)" + +abbreviation "s0 == st empty empty" +abbreviation "s0' == Norm s0" +abbreviation "s1 == st globs1 empty" +abbreviation "s1' == Norm s1" +abbreviation "s2 == st globs2 empty" +abbreviation "s2' == Norm s2" +abbreviation "s3 == st globs3 locs3" +abbreviation "s3' == Norm s3" +abbreviation "s7' == (Some (Xcpt (Std NullPointer)), s3)" +abbreviation "s8 == st globs8 locs8" +abbreviation "s8' == Norm s8" +abbreviation "s9' == (Some (Xcpt (Std IndOutBound)), s8)" declare Pair_eq [simp del] @@ -1293,7 +1271,7 @@ apply (rule eval_Is (* NewC *)) (* begin init Ext *) apply (erule_tac V = "the (new_Addr ?h) = b" in thin_rl) -apply (erule_tac V = "atleast_free ?h tree" in thin_rl) +apply (erule_tac V = "atleast_free ?h three" in thin_rl) apply (erule_tac [2] V = "atleast_free ?h four" in thin_rl) apply (erule_tac [2] V = "new_Addr ?h = Some a" in thin_rl) apply (rule eval_Is (* Init Ext *)) @@ -1336,7 +1314,7 @@ apply (drule alloc_one) apply (simp (no_asm_simp)) apply clarsimp -apply (erule_tac V = "atleast_free ?h tree" in thin_rl) +apply (erule_tac V = "atleast_free ?h three" in thin_rl) apply (drule_tac x = "a" in new_AddrD2 [THEN spec]) apply (simp (no_asm_use)) apply (rule eval_Is (* Try *))