src/HOL/Bali/AxSem.thy
changeset 61989 ba8c284d4725
parent 61424 c3658c18b7bc
child 62042 6c6ccf573479
equal deleted inserted replaced
61988:34b51f436e92 61989:ba8c284d4725
   378                              \<lparr>prg=G,cls=C,lcl=L\<rparr>\<turnstile>dom (locals (store s))\<guillemotright>t\<guillemotright>A )
   378                              \<lparr>prg=G,cls=C,lcl=L\<rparr>\<turnstile>dom (locals (store s))\<guillemotright>t\<guillemotright>A )
   379                \<and> s\<Colon>\<preceq>(G,L))"
   379                \<and> s\<Colon>\<preceq>(G,L))"
   380 
   380 
   381 datatype    'a triple = triple "('a assn)" "term" "('a assn)" (** should be
   381 datatype    'a triple = triple "('a assn)" "term" "('a assn)" (** should be
   382 something like triple = \<forall>'a. triple ('a assn) term ('a assn)   **)
   382 something like triple = \<forall>'a. triple ('a assn) term ('a assn)   **)
   383                                         ("{(1_)}/ _>/ {(1_)}"      [3,65,3]75)
   383                                         ("{(1_)}/ _\<succ>/ {(1_)}"     [3,65,3] 75)
   384 type_synonym 'a triples = "'a triple set"
   384 type_synonym 'a triples = "'a triple set"
   385 
   385 
   386 abbreviation
   386 abbreviation
   387   var_triple   :: "['a assn, var         ,'a assn] \<Rightarrow> 'a triple"
   387   var_triple   :: "['a assn, var         ,'a assn] \<Rightarrow> 'a triple"
   388                                          ("{(1_)}/ _=>/ {(1_)}"    [3,80,3] 75)
   388                                          ("{(1_)}/ _=\<succ>/ {(1_)}"    [3,80,3] 75)
   389   where "{P} e=> {Q} == {P} In2  e> {Q}"
   389   where "{P} e=\<succ> {Q} == {P} In2 e\<succ> {Q}"
   390 
   390 
   391 abbreviation
   391 abbreviation
   392   expr_triple  :: "['a assn, expr        ,'a assn] \<Rightarrow> 'a triple"
   392   expr_triple  :: "['a assn, expr        ,'a assn] \<Rightarrow> 'a triple"
   393                                          ("{(1_)}/ _->/ {(1_)}"    [3,80,3] 75)
   393                                          ("{(1_)}/ _-\<succ>/ {(1_)}"    [3,80,3] 75)
   394   where "{P} e-> {Q} == {P} In1l e> {Q}"
   394   where "{P} e-\<succ> {Q} == {P} In1l e\<succ> {Q}"
   395 
   395 
   396 abbreviation
   396 abbreviation
   397   exprs_triple :: "['a assn, expr list   ,'a assn] \<Rightarrow> 'a triple"
   397   exprs_triple :: "['a assn, expr list   ,'a assn] \<Rightarrow> 'a triple"
   398                                          ("{(1_)}/ _#>/ {(1_)}"    [3,65,3] 75)
   398                                          ("{(1_)}/ _\<doteq>\<succ>/ {(1_)}"    [3,65,3] 75)
   399   where "{P} e#> {Q} == {P} In3  e> {Q}"
   399   where "{P} e\<doteq>\<succ> {Q} == {P} In3 e\<succ> {Q}"
   400 
   400 
   401 abbreviation
   401 abbreviation
   402   stmt_triple  :: "['a assn, stmt,        'a assn] \<Rightarrow> 'a triple"
   402   stmt_triple  :: "['a assn, stmt,        'a assn] \<Rightarrow> 'a triple"
   403                                          ("{(1_)}/ ._./ {(1_)}"     [3,65,3] 75)
   403                                          ("{(1_)}/ ._./ {(1_)}"     [3,65,3] 75)
   404   where "{P} .c. {Q} == {P} In1r c> {Q}"
   404   where "{P} .c. {Q} == {P} In1r c\<succ> {Q}"
   405 
   405 
   406 notation (xsymbols)
   406 notation (ASCII)
   407   triple  ("{(1_)}/ _\<succ>/ {(1_)}"     [3,65,3] 75) and
   407   triple  ("{(1_)}/ _>/ {(1_)}"      [3,65,3]75) and
   408   var_triple  ("{(1_)}/ _=\<succ>/ {(1_)}"    [3,80,3] 75) and
   408   var_triple  ("{(1_)}/ _=>/ {(1_)}"    [3,80,3] 75) and
   409   expr_triple  ("{(1_)}/ _-\<succ>/ {(1_)}"    [3,80,3] 75) and
   409   expr_triple  ("{(1_)}/ _->/ {(1_)}"    [3,80,3] 75) and
   410   exprs_triple  ("{(1_)}/ _\<doteq>\<succ>/ {(1_)}"    [3,65,3] 75)
   410   exprs_triple  ("{(1_)}/ _#>/ {(1_)}"    [3,65,3] 75)
   411 
   411 
   412 lemma inj_triple: "inj (\<lambda>(P,t,Q). {P} t\<succ> {Q})"
   412 lemma inj_triple: "inj (\<lambda>(P,t,Q). {P} t\<succ> {Q})"
   413 apply (rule inj_onI)
   413 apply (rule inj_onI)
   414 apply auto
   414 apply auto
   415 done
   415 done
   429       (case t of {P} t\<succ> {Q} \<Rightarrow>
   429       (case t of {P} t\<succ> {Q} \<Rightarrow>
   430         \<forall>Y s Z. P Y s Z \<longrightarrow> type_ok G t s \<longrightarrow>
   430         \<forall>Y s Z. P Y s Z \<longrightarrow> type_ok G t s \<longrightarrow>
   431         (\<forall>Y' s'. G\<turnstile>s \<midarrow>t\<succ>\<midarrow>n\<rightarrow> (Y',s') \<longrightarrow> Q Y' s' Z))"
   431         (\<forall>Y' s'. G\<turnstile>s \<midarrow>t\<succ>\<midarrow>n\<rightarrow> (Y',s') \<longrightarrow> Q Y' s' Z))"
   432 
   432 
   433 abbreviation
   433 abbreviation
   434   triples_valid:: "prog \<Rightarrow> nat \<Rightarrow> 'a triples \<Rightarrow> bool"  (  "_||=_:_" [61,0, 58] 57)
   434   triples_valid:: "prog \<Rightarrow> nat \<Rightarrow> 'a triples \<Rightarrow> bool"  ("_|\<Turnstile>_:_" [61,0, 58] 57)
   435   where "G||=n:ts == Ball ts (triple_valid G n)"
   435   where "G|\<Turnstile>n:ts == Ball ts (triple_valid G n)"
   436 
   436 
   437 notation (xsymbols)
   437 notation (ASCII)
   438   triples_valid  ("_|\<Turnstile>_:_" [61,0, 58] 57)
   438   triples_valid  (  "_||=_:_" [61,0, 58] 57)
   439 
   439 
   440 
   440 
   441 definition
   441 definition
   442   ax_valids :: "prog \<Rightarrow> 'b triples \<Rightarrow> 'a triples \<Rightarrow> bool"  ("_,_|\<Turnstile>_" [61,58,58] 57)
   442   ax_valids :: "prog \<Rightarrow> 'b triples \<Rightarrow> 'a triples \<Rightarrow> bool"  ("_,_|\<Turnstile>_" [61,58,58] 57)
   443   where "(G,A|\<Turnstile>ts) = (\<forall>n. G|\<Turnstile>n:A \<longrightarrow> G|\<Turnstile>n:ts)"
   443   where "(G,A|\<Turnstile>ts) = (\<forall>n. G|\<Turnstile>n:A \<longrightarrow> G|\<Turnstile>n:ts)"
   444 
   444 
   445 abbreviation
   445 abbreviation
   446   ax_valid :: "prog \<Rightarrow> 'b triples \<Rightarrow> 'a triple \<Rightarrow> bool"  ( "_,_|=_"   [61,58,58] 57)
   446   ax_valid :: "prog \<Rightarrow> 'b triples \<Rightarrow> 'a triple \<Rightarrow> bool"  ("_,_\<Turnstile>_" [61,58,58] 57)
   447   where "G,A |=t == G,A|\<Turnstile>{t}"
   447   where "G,A \<Turnstile>t == G,A|\<Turnstile>{t}"
   448 
   448 
   449 notation (xsymbols)
   449 notation (ASCII)
   450   ax_valid  ("_,_\<Turnstile>_" [61,58,58] 57)
   450   ax_valid  ( "_,_|=_"   [61,58,58] 57)
   451 
   451 
   452 
   452 
   453 lemma triple_valid_def2: "G\<Turnstile>n:{P} t\<succ> {Q} =  
   453 lemma triple_valid_def2: "G\<Turnstile>n:{P} t\<succ> {Q} =  
   454  (\<forall>Y s Z. P Y s Z 
   454  (\<forall>Y s Z. P Y s Z 
   455   \<longrightarrow> (\<exists>L. (normal s \<longrightarrow> (\<exists> C T A. \<lparr>prg=G,cls=C,lcl=L\<rparr>\<turnstile>t\<Colon>T \<and> 
   455   \<longrightarrow> (\<exists>L. (normal s \<longrightarrow> (\<exists> C T A. \<lparr>prg=G,cls=C,lcl=L\<rparr>\<turnstile>t\<Colon>T \<and>