# HG changeset patch # User wenzelm # Date 1159479759 -7200 # Node ID 5d538d3d5e2afda4c97b80aa0fa46e9505e7082a # Parent 1d478c2d621fea5710792af8b08de060af311195 replaced syntax/translations by abbreviation; fixed translations: CONST; diff -r 1d478c2d621f -r 5d538d3d5e2a src/HOL/Bali/Example.thy --- a/src/HOL/Bali/Example.thy Thu Sep 28 23:42:35 2006 +0200 +++ b/src/HOL/Bali/Example.thy Thu Sep 28 23:42:39 2006 +0200 @@ -86,28 +86,33 @@ surj_vnam_: "\m. n = vnam_ m" surj_label_:" \m. n = label_ m" -syntax - +abbreviation HasFoo :: qtname - Base :: qtname - Ext :: qtname - Main :: qtname - arr :: ename - vee :: ename - z :: ename - e :: ename + "HasFoo == \pid=java_lang,tid=TName (tnam_ HasFoo_)\" + + Base :: qtname + "Base == \pid=java_lang,tid=TName (tnam_ Base_)\" + + Ext :: qtname + "Ext == \pid=java_lang,tid=TName (tnam_ Ext_)\" + + Main :: qtname + "Main == \pid=java_lang,tid=TName (tnam_ Main_)\" + + arr :: vname + "arr == (vnam_ arr_)" + + vee :: vname + "vee == (vnam_ vee_)" + + z :: vname + "z == (vnam_ z_)" + + e :: vname + "e == (vnam_ e_)" + lab1:: label -translations - - "HasFoo" == "\pid=java_lang,tid=TName (tnam_ HasFoo_)\" - "Base" == "\pid=java_lang,tid=TName (tnam_ Base_)\" - "Ext" == "\pid=java_lang,tid=TName (tnam_ Ext_)\" - "Main" == "\pid=java_lang,tid=TName (tnam_ Main_)\" - "arr" == "(vnam_ arr_)" - "vee" == "(vnam_ vee_)" - "z" == "(vnam_ z_)" - "e" == "(vnam_ e_)" - "lab1" == "label_ lab1_" + "lab1 == label_ lab1_" lemma neq_Base_Object [simp]: "Base\Object" @@ -255,11 +260,9 @@ section "program" -syntax +abbreviation tprg :: prog - -translations - "tprg" == "\ifaces=Ifaces,classes=Classes\" + "tprg == \ifaces=Ifaces,classes=Classes\" constdefs test :: "(ty)list \ stmt" @@ -1191,11 +1194,14 @@ a :: loc b :: loc c :: loc - -syntax - tprg :: prog +abbreviation + "one == Suc 0" + "two == Suc one" + "tree == Suc two" + "four == Suc tree" +syntax obj_a :: obj obj_b :: obj obj_c :: obj @@ -1225,34 +1231,31 @@ s8' :: state translations - - "tprg" == "\ifaces=Ifaces,classes=Classes\" - - "obj_a" <= "\tag=Arr (PrimT Boolean) two - ,values=empty(Inr 0\Bool False)(Inr one\Bool False)\" - "obj_b" <= "\tag=CInst Ext - ,values=(empty(Inl (vee, Base)\Null ) - (Inl (vee, Ext )\Intg 0))\" - "obj_c" == "\tag=CInst (SXcpt NullPointer),values=empty\" - "arr_N" == "empty(Inl (arr, Base)\Null)" - "arr_a" == "empty(Inl (arr, Base)\Addr a)" - "globs1" == "empty(Inr Ext \\tag=arbitrary, values=empty\) - (Inr Base \\tag=arbitrary, values=arr_N\) - (Inr Object\\tag=arbitrary, values=empty\)" - "globs2" == "empty(Inr Ext \\tag=arbitrary, values=empty\) - (Inr Object\\tag=arbitrary, values=empty\) - (Inl a\obj_a) - (Inr Base \\tag=arbitrary, values=arr_a\)" + "obj_a" <= "\tag=Arr (PrimT Boolean) (CONST two) + ,values=CONST empty(Inr 0\Bool False)(Inr (CONST one)\Bool False)\" + "obj_b" <= "\tag=CInst (CONST Ext) + ,values=(CONST empty(Inl (CONST vee, CONST Base)\Null ) + (Inl (CONST vee, CONST Ext )\Intg 0))\" + "obj_c" == "\tag=CInst (SXcpt NullPointer),values=CONST empty\" + "arr_N" == "CONST empty(Inl (CONST arr, CONST Base)\Null)" + "arr_a" == "CONST empty(Inl (CONST arr, CONST Base)\Addr a)" + "globs1" == "CONST empty(Inr (CONST Ext) \\tag=arbitrary, values=CONST empty\) + (Inr (CONST Base) \\tag=arbitrary, values=arr_N\) + (Inr Object\\tag=arbitrary, values=CONST empty\)" + "globs2" == "CONST empty(Inr (CONST Ext) \\tag=arbitrary, values=CONST empty\) + (Inr Object\\tag=arbitrary, values=CONST empty\) + (Inl a\obj_a) + (Inr (CONST Base) \\tag=arbitrary, values=arr_a\)" "globs3" == "globs2(Inl b\obj_b)" "globs8" == "globs3(Inl c\obj_c)" - "locs3" == "empty(VName e\Addr b)" - "locs4" == "empty(VName z\Null)(Inr()\Addr b)" - "locs8" == "locs3(VName z\Addr c)" - "s0" == " st empty empty" + "locs3" == "CONST empty(VName (CONST e)\Addr b)" + "locs4" == "CONST empty(VName (CONST z)\Null)(Inr()\Addr b)" + "locs8" == "locs3(VName (CONST z)\Addr c)" + "s0" == " st (CONST empty) (CONST empty)" "s0'" == " Norm s0" - "s1" == " st globs1 empty" + "s1" == " st globs1 (CONST empty)" "s1'" == " Norm s1" - "s2" == " st globs2 empty" + "s2" == " st globs2 (CONST empty)" "s2'" == " Norm s2" "s3" == " st globs3 locs3 " "s3'" == " Norm s3" @@ -1265,16 +1268,6 @@ "s9'" == "(Some (Xcpt (Std IndOutBound)), s8)" -syntax "four"::nat - "tree"::nat - "two" ::nat - "one" ::nat -translations - "one" == "Suc 0" - "two" == "Suc one" - "tree" == "Suc two" - "four" == "Suc tree" - declare Pair_eq [simp del] lemma exec_test: "\the (new_Addr (heap s1)) = a;