# HG changeset patch # User wenzelm # Date 1451502479 -3600 # Node ID 39e4a93ad36e11751b0fe4108fb18f926512144b # Parent ba8c284d47251a49482d7b5539513e1fcbf8c5bb more symbols; diff -r ba8c284d4725 -r 39e4a93ad36e src/HOL/NanoJava/AxSem.thy --- a/src/HOL/NanoJava/AxSem.thy Wed Dec 30 19:57:37 2015 +0100 +++ b/src/HOL/NanoJava/AxSem.thy Wed Dec 30 20:07:59 2015 +0100 @@ -58,7 +58,7 @@ new C {P}" | Cast: "A \\<^sub>e {P} e {\v s. (case v of Null => True - | Addr a => obj_class s a <=C C) --> Q v s} ==> + | Addr a => obj_class s a \C C) --> Q v s} ==> A \\<^sub>e {P} Cast C e {Q}" | Call: "[| A \\<^sub>e {P} e1 {Q}; \a. A \\<^sub>e {Q a} e2 {R a}; @@ -67,7 +67,7 @@ Meth (C,m) {\s. S (s) (set_locs ls s)} |] ==> A \\<^sub>e {P} {C}e1..m(e2) {S}" -| Meth: "\D. A \ {\s'. \s a. s = Addr a \ D = obj_class s a \ D <=C C \ +| Meth: "\D. A \ {\s'. \s a. s = Addr a \ D = obj_class s a \ D \C C \ P s \ s' = init_locs D m s} Impl (D,m) {Q} ==> A \ {P} Meth (C,m) {Q}" diff -r ba8c284d4725 -r 39e4a93ad36e src/HOL/NanoJava/Equivalence.thy --- a/src/HOL/NanoJava/Equivalence.thy Wed Dec 30 19:57:37 2015 +0100 +++ b/src/HOL/NanoJava/Equivalence.thy Wed Dec 30 20:07:59 2015 +0100 @@ -9,36 +9,26 @@ subsection "Validity" -definition valid :: "[assn,stmt, assn] => bool" ("|= {(1_)}/ (_)/ {(1_)}" [3,90,3] 60) where - "|= {P} c {Q} \ \s t. P s --> (\n. s -c -n\ t) --> Q t" - -definition evalid :: "[assn,expr,vassn] => bool" ("|=e {(1_)}/ (_)/ {(1_)}" [3,90,3] 60) where - "|=e {P} e {Q} \ \s v t. P s --> (\n. s -e\v-n\ t) --> Q v t" +definition valid :: "[assn,stmt, assn] => bool" ("\ {(1_)}/ (_)/ {(1_)}" [3,90,3] 60) where + "\ {P} c {Q} \ \s t. P s --> (\n. s -c -n\ t) --> Q t" -definition nvalid :: "[nat, triple ] => bool" ("|=_: _" [61,61] 60) where - "|=n: t \ let (P,c,Q) = t in \s t. s -c -n\ t --> P s --> Q t" +definition evalid :: "[assn,expr,vassn] => bool" ("\\<^sub>e {(1_)}/ (_)/ {(1_)}" [3,90,3] 60) where + "\\<^sub>e {P} e {Q} \ \s v t. P s --> (\n. s -e\v-n\ t) --> Q v t" -definition envalid :: "[nat,etriple ] => bool" ("|=_:e _" [61,61] 60) where - "|=n:e t \ let (P,e,Q) = t in \s v t. s -e\v-n\ t --> P s --> Q v t" - -definition nvalids :: "[nat, triple set] => bool" ("||=_: _" [61,61] 60) where - "||=n: T \ \t\T. |=n: t" +definition nvalid :: "[nat, triple ] => bool" ("\_: _" [61,61] 60) where + "\n: t \ let (P,c,Q) = t in \s t. s -c -n\ t --> P s --> Q t" -definition cnvalids :: "[triple set,triple set] => bool" ("_ ||=/ _" [61,61] 60) where - "A ||= C \ \n. ||=n: A --> ||=n: C" +definition envalid :: "[nat,etriple ] => bool" ("\_:\<^sub>e _" [61,61] 60) where + "\n:\<^sub>e t \ let (P,e,Q) = t in \s v t. s -e\v-n\ t --> P s --> Q v t" -definition cenvalid :: "[triple set,etriple ] => bool" ("_ ||=e/ _" [61,61] 60) where - "A ||=e t \ \n. ||=n: A --> |=n:e t" +definition nvalids :: "[nat, triple set] => bool" ("|\_: _" [61,61] 60) where + "|\n: T \ \t\T. \n: t" -notation (xsymbols) - valid ("\ {(1_)}/ (_)/ {(1_)}" [3,90,3] 60) and - evalid ("\\<^sub>e {(1_)}/ (_)/ {(1_)}" [3,90,3] 60) and - nvalid ("\_: _" [61,61] 60) and - envalid ("\_:\<^sub>e _" [61,61] 60) and - nvalids ("|\_: _" [61,61] 60) and - cnvalids ("_ |\/ _" [61,61] 60) and - cenvalid ("_ |\\<^sub>e/ _"[61,61] 60) +definition cnvalids :: "[triple set,triple set] => bool" ("_ |\/ _" [61,61] 60) where + "A |\ C \ \n. |\n: A --> |\n: C" +definition cenvalid :: "[triple set,etriple ] => bool" ("_ |\\<^sub>e/ _"[61,61] 60) where + "A |\\<^sub>e t \ \n. |\n: A --> \n:\<^sub>e t" lemma nvalid_def2: "\n: (P,c,Q) \ \s t. s -c-n\ t \ P s \ Q t" by (simp add: nvalid_def Let_def) @@ -160,11 +150,8 @@ definition MGT :: "stmt => state => triple" where "MGT c Z \ (\s. Z = s, c, \ t. \n. Z -c- n\ t)" -definition MGTe :: "expr => state => etriple" where - "MGTe e Z \ (\s. Z = s, e, \v t. \n. Z -e\v-n\ t)" - -notation (xsymbols) - MGTe ("MGT\<^sub>e") +definition MGT\<^sub>e :: "expr => state => etriple" where + "MGT\<^sub>e e Z \ (\s. Z = s, e, \v t. \n. Z -e\v-n\ t)" lemma MGF_implies_complete: "\Z. {} |\ { MGT c Z} \ \ {P} c {Q} \ {} \ {P} c {Q}" @@ -177,7 +164,7 @@ lemma eMGF_implies_complete: "\Z. {} |\\<^sub>e MGT\<^sub>e e Z \ \\<^sub>e {P} e {Q} \ {} \\<^sub>e {P} e {Q}" apply (simp only: evalid_def2) -apply (unfold MGTe_def) +apply (unfold MGT\<^sub>e_def) apply (erule hoare_ehoare.eConseq) apply (clarsimp simp add: envalid_def2) done @@ -206,7 +193,7 @@ lemma MGF_lemma: "\M Z. A |\ {MGT (Impl M) Z} \ (\Z. A |\ {MGT c Z}) \ (\Z. A |\\<^sub>e MGT\<^sub>e e Z)" -apply (simp add: MGT_def MGTe_def) +apply (simp add: MGT_def MGT\<^sub>e_def) apply (rule stmt_expr.induct) apply (rule_tac [!] allI) diff -r ba8c284d4725 -r 39e4a93ad36e src/HOL/NanoJava/State.thy --- a/src/HOL/NanoJava/State.thy Wed Dec 30 19:57:37 2015 +0100 +++ b/src/HOL/NanoJava/State.thy Wed Dec 30 20:07:59 2015 +0100 @@ -70,16 +70,12 @@ "get_field s a f \ the (snd (get_obj s a) f)" --{* local function: *} -definition hupd :: "loc => obj => state => state" ("hupd'(_|->_')" [10,10] 1000) where +definition hupd :: "loc => obj => state => state" ("hupd'(_\_')" [10,10] 1000) where "hupd a obj s \ s (| heap := ((heap s)(a\obj))|)" -definition lupd :: "vname => val => state => state" ("lupd'(_|->_')" [10,10] 1000) where +definition lupd :: "vname => val => state => state" ("lupd'(_\_')" [10,10] 1000) where "lupd x v s \ s (| locals := ((locals s)(x\v ))|)" -notation (xsymbols) - hupd ("hupd'(_\_')" [10,10] 1000) and - lupd ("lupd'(_\_')" [10,10] 1000) - definition new_obj :: "loc => cname => state => state" where "new_obj a C \ hupd(a\(C,init_vars (field C)))" diff -r ba8c284d4725 -r 39e4a93ad36e src/HOL/NanoJava/TypeRel.thy --- a/src/HOL/NanoJava/TypeRel.thy Wed Dec 30 19:57:37 2015 +0100 +++ b/src/HOL/NanoJava/TypeRel.thy Wed Dec 30 20:07:59 2015 +0100 @@ -15,15 +15,11 @@ "subcls1 \ {(C,D). C\Object \ (\c. class C = Some c \ super c=D)}" abbreviation - subcls1_syntax :: "[cname, cname] => bool" ("_ <=C1 _" [71,71] 70) - where "C <=C1 D == (C,D) \ subcls1" + subcls1_syntax :: "[cname, cname] => bool" ("_ \C1 _" [71,71] 70) + where "C \C1 D == (C,D) \ subcls1" abbreviation - subcls_syntax :: "[cname, cname] => bool" ("_ <=C _" [71,71] 70) - where "C <=C D == (C,D) \ subcls1^*" - -notation (xsymbols) - subcls1_syntax ("_ \C1 _" [71,71] 70) and - subcls_syntax ("_ \C _" [71,71] 70) + subcls_syntax :: "[cname, cname] => bool" ("_ \C _" [71,71] 70) + where "C \C D == (C,D) \ subcls1^*" subsection "Declarations and properties not used in the meta theory"