src/HOL/Bali/Example.thy
author haftmann
Fri, 27 Nov 2009 08:42:50 +0100
changeset 33965 f57c11db4ad4
parent 32960 69916a850301
child 35067 af4c18c30593
permissions -rw-r--r--
Inl and Inr now with authentic syntax
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12857
a4386cc9b1c3 tuned header;
wenzelm
parents: 12854
diff changeset
     1
(*  Title:      HOL/Bali/Example.thy
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
     2
    Author:     David von Oheimb
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
     3
*)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
     4
header {* Example Bali program *}
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
     5
33965
f57c11db4ad4 Inl and Inr now with authentic syntax
haftmann
parents: 32960
diff changeset
     6
theory Example
f57c11db4ad4 Inl and Inr now with authentic syntax
haftmann
parents: 32960
diff changeset
     7
imports Eval WellForm
f57c11db4ad4 Inl and Inr now with authentic syntax
haftmann
parents: 32960
diff changeset
     8
begin
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
     9
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    10
text {*
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    11
The following example Bali program includes:
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    12
\begin{itemize}
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    13
\item class and interface declarations with inheritance, hiding of fields,
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    14
    overriding of methods (with refined result type), array type,
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    15
\item method call (with dynamic binding), parameter access, return expressions,
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    16
\item expression statements, sequential composition, literal values, 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    17
    local assignment, local access, field assignment, type cast,
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    18
\item exception generation and propagation, try and catch statement, throw 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    19
      statement
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    20
\item instance creation and (default) static initialization
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    21
\end{itemize}
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    22
\begin{verbatim}
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    23
package java_lang
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    24
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    25
public interface HasFoo {
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    26
  public Base foo(Base z);
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    27
}
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    28
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    29
public class Base implements HasFoo {
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    30
  static boolean arr[] = new boolean[2];
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    31
  public HasFoo vee;
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    32
  public Base foo(Base z) {
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    33
    return z;
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    34
  }
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    35
}
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    36
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    37
public class Ext extends Base {
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    38
  public int vee;
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    39
  public Ext foo(Base z) {
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    40
    ((Ext)z).vee = 1;
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    41
    return null;
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    42
  }
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    43
}
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    44
12925
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
    45
public class Main {
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    46
  public static void main(String args[]) throws Throwable {
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    47
    Base e = new Ext();
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    48
    try {e.foo(null); }
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    49
    catch(NullPointerException z) { 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    50
      while(Ext.arr[2]) ;
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    51
    }
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    52
  }
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    53
}
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    54
\end{verbatim}
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    55
*}
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    56
declare widen.null [intro]
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    57
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    58
lemma wf_fdecl_def2: "\<And>fd. wf_fdecl G P fd = is_acc_type G P (type (snd fd))"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    59
apply (unfold wf_fdecl_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    60
apply (simp (no_asm))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    61
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    62
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    63
declare wf_fdecl_def2 [iff]
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    64
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    65
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    66
section "type and expression names"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    67
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    68
(** unfortunately cannot simply instantiate tnam **)
22708
fff918feff45 avoid internal names;
wenzelm
parents: 21404
diff changeset
    69
datatype tnam'  = HasFoo' | Base' | Ext' | Main'
fff918feff45 avoid internal names;
wenzelm
parents: 21404
diff changeset
    70
datatype vnam'  = arr' | vee' | z' | e'
fff918feff45 avoid internal names;
wenzelm
parents: 21404
diff changeset
    71
datatype label' = lab1'
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    72
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    73
consts
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    74
22708
fff918feff45 avoid internal names;
wenzelm
parents: 21404
diff changeset
    75
  tnam' :: "tnam'  \<Rightarrow> tnam"
fff918feff45 avoid internal names;
wenzelm
parents: 21404
diff changeset
    76
  vnam' :: "vnam'  \<Rightarrow> vname"
fff918feff45 avoid internal names;
wenzelm
parents: 21404
diff changeset
    77
  label':: "label' \<Rightarrow> label"
fff918feff45 avoid internal names;
wenzelm
parents: 21404
diff changeset
    78
axioms  (** tnam', vnam' and label are intended to be isomorphic 
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    79
            to tnam, vname and label **)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    80
22708
fff918feff45 avoid internal names;
wenzelm
parents: 21404
diff changeset
    81
  inj_tnam'  [simp]: "(tnam'  x = tnam'  y) = (x = y)"
fff918feff45 avoid internal names;
wenzelm
parents: 21404
diff changeset
    82
  inj_vnam'  [simp]: "(vnam'  x = vnam'  y) = (x = y)"
fff918feff45 avoid internal names;
wenzelm
parents: 21404
diff changeset
    83
  inj_label' [simp]: "(label' x = label' y) = (x = y)"
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    84
  
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    85
  
22708
fff918feff45 avoid internal names;
wenzelm
parents: 21404
diff changeset
    86
  surj_tnam':  "\<exists>m. n = tnam'  m"
fff918feff45 avoid internal names;
wenzelm
parents: 21404
diff changeset
    87
  surj_vnam':  "\<exists>m. n = vnam'  m"
fff918feff45 avoid internal names;
wenzelm
parents: 21404
diff changeset
    88
  surj_label':" \<exists>m. n = label' m"
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
    89
20769
5d538d3d5e2a replaced syntax/translations by abbreviation;
wenzelm
parents: 18576
diff changeset
    90
abbreviation
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20769
diff changeset
    91
  HasFoo :: qtname where
22708
fff918feff45 avoid internal names;
wenzelm
parents: 21404
diff changeset
    92
  "HasFoo == \<lparr>pid=java_lang,tid=TName (tnam' HasFoo')\<rparr>"
20769
5d538d3d5e2a replaced syntax/translations by abbreviation;
wenzelm
parents: 18576
diff changeset
    93
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20769
diff changeset
    94
abbreviation
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20769
diff changeset
    95
  Base :: qtname where
22708
fff918feff45 avoid internal names;
wenzelm
parents: 21404
diff changeset
    96
  "Base == \<lparr>pid=java_lang,tid=TName (tnam' Base')\<rparr>"
20769
5d538d3d5e2a replaced syntax/translations by abbreviation;
wenzelm
parents: 18576
diff changeset
    97
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20769
diff changeset
    98
abbreviation
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20769
diff changeset
    99
  Ext :: qtname where
22708
fff918feff45 avoid internal names;
wenzelm
parents: 21404
diff changeset
   100
  "Ext == \<lparr>pid=java_lang,tid=TName (tnam' Ext')\<rparr>"
20769
5d538d3d5e2a replaced syntax/translations by abbreviation;
wenzelm
parents: 18576
diff changeset
   101
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20769
diff changeset
   102
abbreviation
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20769
diff changeset
   103
  Main :: qtname where
22708
fff918feff45 avoid internal names;
wenzelm
parents: 21404
diff changeset
   104
  "Main == \<lparr>pid=java_lang,tid=TName (tnam' Main')\<rparr>"
20769
5d538d3d5e2a replaced syntax/translations by abbreviation;
wenzelm
parents: 18576
diff changeset
   105
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20769
diff changeset
   106
abbreviation
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20769
diff changeset
   107
  arr :: vname where
22708
fff918feff45 avoid internal names;
wenzelm
parents: 21404
diff changeset
   108
  "arr == (vnam' arr')"
20769
5d538d3d5e2a replaced syntax/translations by abbreviation;
wenzelm
parents: 18576
diff changeset
   109
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20769
diff changeset
   110
abbreviation
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20769
diff changeset
   111
  vee :: vname where
22708
fff918feff45 avoid internal names;
wenzelm
parents: 21404
diff changeset
   112
  "vee == (vnam' vee')"
20769
5d538d3d5e2a replaced syntax/translations by abbreviation;
wenzelm
parents: 18576
diff changeset
   113
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20769
diff changeset
   114
abbreviation
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20769
diff changeset
   115
  z :: vname where
22708
fff918feff45 avoid internal names;
wenzelm
parents: 21404
diff changeset
   116
  "z == (vnam' z')"
20769
5d538d3d5e2a replaced syntax/translations by abbreviation;
wenzelm
parents: 18576
diff changeset
   117
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20769
diff changeset
   118
abbreviation
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20769
diff changeset
   119
  e :: vname where
22708
fff918feff45 avoid internal names;
wenzelm
parents: 21404
diff changeset
   120
  "e == (vnam' e')"
20769
5d538d3d5e2a replaced syntax/translations by abbreviation;
wenzelm
parents: 18576
diff changeset
   121
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20769
diff changeset
   122
abbreviation
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20769
diff changeset
   123
  lab1:: label where
22708
fff918feff45 avoid internal names;
wenzelm
parents: 21404
diff changeset
   124
  "lab1 == label' lab1'"
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   125
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   126
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   127
lemma neq_Base_Object [simp]: "Base\<noteq>Object"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   128
by (simp add: Object_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   129
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   130
lemma neq_Ext_Object [simp]: "Ext\<noteq>Object"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   131
by (simp add: Object_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   132
12925
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   133
lemma neq_Main_Object [simp]: "Main\<noteq>Object"
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   134
by (simp add: Object_def)
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   135
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   136
lemma neq_Base_SXcpt [simp]: "Base\<noteq>SXcpt xn"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   137
by (simp add: SXcpt_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   138
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   139
lemma neq_Ext_SXcpt [simp]: "Ext\<noteq>SXcpt xn"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   140
by (simp add: SXcpt_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   141
13524
604d0f3622d6 *** empty log message ***
wenzelm
parents: 12925
diff changeset
   142
lemma neq_Main_SXcpt [simp]: "Main\<noteq>SXcpt xn"
12925
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   143
by (simp add: SXcpt_def)
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   144
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   145
section "classes and interfaces"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   146
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   147
defs
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   148
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   149
  Object_mdecls_def: "Object_mdecls \<equiv> []"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   150
  SXcpt_mdecls_def:  "SXcpt_mdecls  \<equiv> []"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   151
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   152
consts
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   153
  
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   154
  foo    :: mname
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   155
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   156
constdefs
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   157
  
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   158
  foo_sig   :: sig
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   159
 "foo_sig   \<equiv> \<lparr>name=foo,parTs=[Class Base]\<rparr>"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   160
  
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   161
  foo_mhead :: mhead
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   162
 "foo_mhead \<equiv> \<lparr>access=Public,static=False,pars=[z],resT=Class Base\<rparr>"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   163
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   164
constdefs
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   165
  
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   166
  Base_foo :: mdecl
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   167
 "Base_foo \<equiv> (foo_sig, \<lparr>access=Public,static=False,pars=[z],resT=Class Base,
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   168
                        mbody=\<lparr>lcls=[],stmt=Return (!!z)\<rparr>\<rparr>)"
12925
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   169
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   170
constdefs
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   171
  Ext_foo  :: mdecl
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   172
 "Ext_foo  \<equiv> (foo_sig, 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   173
              \<lparr>access=Public,static=False,pars=[z],resT=Class Ext,
32960
69916a850301 eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents: 32456
diff changeset
   174
               mbody=\<lparr>lcls=[]
12925
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   175
                     ,stmt=Expr({Ext,Ext,False}Cast (Class Ext) (!!z)..vee := 
32960
69916a850301 eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents: 32456
diff changeset
   176
                                                             Lit (Intg 1)) ;;
13688
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   177
                                Return (Lit Null)\<rparr>
32960
69916a850301 eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents: 32456
diff changeset
   178
              \<rparr>)"
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   179
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   180
constdefs
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   181
  
12925
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   182
arr_viewed_from :: "qtname \<Rightarrow> qtname \<Rightarrow> var"
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   183
"arr_viewed_from accC C \<equiv> {accC,Base,True}StatRef (ClassT C)..arr"
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   184
18551
be0705186ff5 class now an keyword, quoted where necessary
haftmann
parents: 18447
diff changeset
   185
BaseCl :: "class"
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   186
"BaseCl \<equiv> \<lparr>access=Public,
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   187
           cfields=[(arr, \<lparr>access=Public,static=True ,type=PrimT Boolean.[]\<rparr>),
32960
69916a850301 eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents: 32456
diff changeset
   188
                    (vee, \<lparr>access=Public,static=False,type=Iface HasFoo    \<rparr>)],
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   189
           methods=[Base_foo],
12925
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   190
           init=Expr(arr_viewed_from Base Base 
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   191
                     :=New (PrimT Boolean)[Lit (Intg 2)]),
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   192
           super=Object,
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   193
           superIfs=[HasFoo]\<rparr>"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   194
  
18551
be0705186ff5 class now an keyword, quoted where necessary
haftmann
parents: 18447
diff changeset
   195
ExtCl  :: "class"
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   196
"ExtCl  \<equiv> \<lparr>access=Public,
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   197
           cfields=[(vee, \<lparr>access=Public,static=False,type= PrimT Integer\<rparr>)], 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   198
           methods=[Ext_foo],
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   199
           init=Skip,
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   200
           super=Base,
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   201
           superIfs=[]\<rparr>"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   202
18551
be0705186ff5 class now an keyword, quoted where necessary
haftmann
parents: 18447
diff changeset
   203
MainCl :: "class"
12925
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   204
"MainCl \<equiv> \<lparr>access=Public,
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   205
           cfields=[], 
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   206
           methods=[], 
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   207
           init=Skip,
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   208
           super=Object,
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   209
           superIfs=[]\<rparr>"
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   210
(* The "main" method is modeled seperately (see tprg) *)
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   211
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   212
constdefs
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   213
  
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   214
  HasFooInt :: iface
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   215
 "HasFooInt \<equiv> \<lparr>access=Public,imethods=[(foo_sig, foo_mhead)],isuperIfs=[]\<rparr>"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   216
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   217
  Ifaces ::"idecl list"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   218
 "Ifaces \<equiv> [(HasFoo,HasFooInt)]"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   219
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   220
 "Classes" ::"cdecl list"
12925
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   221
 "Classes \<equiv> [(Base,BaseCl),(Ext,ExtCl),(Main,MainCl)]@standard_classes"
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   222
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   223
lemmas table_classes_defs = 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   224
     Classes_def standard_classes_def ObjectC_def SXcptC_def
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   225
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   226
lemma table_ifaces [simp]: "table_of Ifaces = empty(HasFoo\<mapsto>HasFooInt)"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   227
apply (unfold Ifaces_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   228
apply (simp (no_asm))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   229
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   230
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   231
lemma table_classes_Object [simp]: 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   232
 "table_of Classes Object = Some \<lparr>access=Public,cfields=[]
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   233
                                 ,methods=Object_mdecls
28524
644b62cf678f arbitrary is undefined
haftmann
parents: 26480
diff changeset
   234
                                 ,init=Skip,super=undefined,superIfs=[]\<rparr>"
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   235
apply (unfold table_classes_defs)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   236
apply (simp (no_asm) add:Object_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   237
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   238
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   239
lemma table_classes_SXcpt [simp]: 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   240
  "table_of Classes (SXcpt xn) 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   241
    = Some \<lparr>access=Public,cfields=[],methods=SXcpt_mdecls,
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   242
            init=Skip,
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   243
            super=if xn = Throwable then Object else SXcpt Throwable,
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   244
            superIfs=[]\<rparr>"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   245
apply (unfold table_classes_defs)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   246
apply (induct_tac xn)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   247
apply (simp add: Object_def SXcpt_def)+
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   248
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   249
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   250
lemma table_classes_HasFoo [simp]: "table_of Classes HasFoo = None"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   251
apply (unfold table_classes_defs)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   252
apply (simp (no_asm) add: Object_def SXcpt_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   253
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   254
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   255
lemma table_classes_Base [simp]: "table_of Classes Base = Some BaseCl"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   256
apply (unfold table_classes_defs )
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   257
apply (simp (no_asm) add: Object_def SXcpt_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   258
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   259
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   260
lemma table_classes_Ext [simp]: "table_of Classes Ext = Some ExtCl"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   261
apply (unfold table_classes_defs )
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   262
apply (simp (no_asm) add: Object_def SXcpt_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   263
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   264
12925
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   265
lemma table_classes_Main [simp]: "table_of Classes Main = Some MainCl"
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   266
apply (unfold table_classes_defs )
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   267
apply (simp (no_asm) add: Object_def SXcpt_def)
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   268
done
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   269
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   270
section "program"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   271
20769
5d538d3d5e2a replaced syntax/translations by abbreviation;
wenzelm
parents: 18576
diff changeset
   272
abbreviation
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20769
diff changeset
   273
  tprg :: prog where
20769
5d538d3d5e2a replaced syntax/translations by abbreviation;
wenzelm
parents: 18576
diff changeset
   274
  "tprg == \<lparr>ifaces=Ifaces,classes=Classes\<rparr>"
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   275
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   276
constdefs
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   277
  test    :: "(ty)list \<Rightarrow> stmt"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   278
 "test pTs \<equiv> e:==NewC Ext;; 
12925
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   279
           \<spacespace> Try Expr({Main,ClassT Base,IntVir}!!e\<cdot>foo({pTs}[Lit Null]))
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   280
           \<spacespace> Catch((SXcpt NullPointer) z)
12925
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   281
           (lab1\<bullet> While(Acc 
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   282
                        (Acc (arr_viewed_from Main Ext).[Lit (Intg 2)])) Skip)"
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   283
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   284
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   285
section "well-structuredness"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   286
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   287
lemma not_Object_subcls_any [elim!]: "(Object, C) \<in> (subcls1 tprg)^+ \<Longrightarrow> R"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   288
apply (auto dest!: tranclD subcls1D)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   289
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   290
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   291
lemma not_Throwable_subcls_SXcpt [elim!]: 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   292
  "(SXcpt Throwable, SXcpt xn) \<in> (subcls1 tprg)^+ \<Longrightarrow> R"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   293
apply (auto dest!: tranclD subcls1D) 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   294
apply (simp add: Object_def SXcpt_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   295
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   296
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   297
lemma not_SXcpt_n_subcls_SXcpt_n [elim!]: 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   298
  "(SXcpt xn, SXcpt xn)  \<in> (subcls1 tprg)^+ \<Longrightarrow> R"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   299
apply (auto dest!: tranclD subcls1D)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   300
apply (drule rtranclD)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   301
apply auto
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   302
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   303
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   304
lemma not_Base_subcls_Ext [elim!]: "(Base, Ext) \<in> (subcls1 tprg)^+  \<Longrightarrow> R"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   305
apply (auto dest!: tranclD subcls1D simp add: BaseCl_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   306
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   307
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   308
lemma not_TName_n_subcls_TName_n [rule_format (no_asm), elim!]: 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   309
  "(\<lparr>pid=java_lang,tid=TName tn\<rparr>, \<lparr>pid=java_lang,tid=TName tn\<rparr>) 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   310
   \<in> (subcls1 tprg)^+ \<longrightarrow> R"
22708
fff918feff45 avoid internal names;
wenzelm
parents: 21404
diff changeset
   311
apply (rule_tac n1 = "tn" in surj_tnam' [THEN exE])
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   312
apply (erule ssubst)
22708
fff918feff45 avoid internal names;
wenzelm
parents: 21404
diff changeset
   313
apply (rule tnam'.induct)
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   314
apply  safe
12925
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   315
apply (auto dest!: tranclD subcls1D simp add: BaseCl_def ExtCl_def MainCl_def)
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   316
apply (drule rtranclD)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   317
apply auto
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   318
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   319
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   320
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   321
lemma ws_idecl_HasFoo: "ws_idecl tprg HasFoo []"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   322
apply (unfold ws_idecl_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   323
apply (simp (no_asm))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   324
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   325
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   326
lemma ws_cdecl_Object: "ws_cdecl tprg Object any"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   327
apply (unfold ws_cdecl_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   328
apply auto
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   329
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   330
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   331
lemma ws_cdecl_Throwable: "ws_cdecl tprg (SXcpt Throwable) Object"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   332
apply (unfold ws_cdecl_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   333
apply auto
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   334
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   335
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   336
lemma ws_cdecl_SXcpt: "ws_cdecl tprg (SXcpt xn) (SXcpt Throwable)"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   337
apply (unfold ws_cdecl_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   338
apply auto
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   339
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   340
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   341
lemma ws_cdecl_Base: "ws_cdecl tprg Base Object"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   342
apply (unfold ws_cdecl_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   343
apply auto
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   344
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   345
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   346
lemma ws_cdecl_Ext: "ws_cdecl tprg Ext Base"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   347
apply (unfold ws_cdecl_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   348
apply auto
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   349
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   350
12925
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   351
lemma ws_cdecl_Main: "ws_cdecl tprg Main Object"
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   352
apply (unfold ws_cdecl_def)
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   353
apply auto
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   354
done
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   355
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   356
lemmas ws_cdecls = ws_cdecl_SXcpt ws_cdecl_Object ws_cdecl_Throwable
12925
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   357
                   ws_cdecl_Base ws_cdecl_Ext ws_cdecl_Main
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   358
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   359
declare not_Object_subcls_any [rule del]
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   360
          not_Throwable_subcls_SXcpt [rule del] 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   361
          not_SXcpt_n_subcls_SXcpt_n [rule del] 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   362
          not_Base_subcls_Ext [rule del] not_TName_n_subcls_TName_n [rule del]
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   363
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   364
lemma ws_idecl_all: 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   365
 "G=tprg \<Longrightarrow> (\<forall>(I,i)\<in>set Ifaces. ws_idecl G I (isuperIfs i))"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   366
apply (simp (no_asm) add: Ifaces_def HasFooInt_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   367
apply (auto intro!: ws_idecl_HasFoo)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   368
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   369
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   370
lemma ws_cdecl_all: "G=tprg \<Longrightarrow> (\<forall>(C,c)\<in>set Classes. ws_cdecl G C (super c))"
12925
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   371
apply (simp (no_asm) add: Classes_def BaseCl_def ExtCl_def MainCl_def)
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   372
apply (auto intro!: ws_cdecls simp add: standard_classes_def ObjectC_def 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   373
        SXcptC_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   374
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   375
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   376
lemma ws_tprg: "ws_prog tprg"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   377
apply (unfold ws_prog_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   378
apply (auto intro!: ws_idecl_all ws_cdecl_all)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   379
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   380
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   381
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   382
section "misc program properties (independent of well-structuredness)"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   383
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   384
lemma single_iface [simp]: "is_iface tprg I = (I = HasFoo)"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   385
apply (unfold Ifaces_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   386
apply (simp (no_asm))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   387
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   388
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   389
lemma empty_subint1 [simp]: "subint1 tprg = {}"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   390
apply (unfold subint1_def Ifaces_def HasFooInt_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   391
apply auto
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   392
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   393
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   394
lemma unique_ifaces: "unique Ifaces"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   395
apply (unfold Ifaces_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   396
apply (simp (no_asm))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   397
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   398
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   399
lemma unique_classes: "unique Classes"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   400
apply (unfold table_classes_defs )
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   401
apply (simp )
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   402
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   403
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   404
lemma SXcpt_subcls_Throwable [simp]: "tprg\<turnstile>SXcpt xn\<preceq>\<^sub>C SXcpt Throwable"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   405
apply (rule SXcpt_subcls_Throwable_lemma)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   406
apply auto
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   407
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   408
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   409
lemma Ext_subclseq_Base [simp]: "tprg\<turnstile>Ext \<preceq>\<^sub>C Base"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   410
apply (rule subcls_direct1)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   411
apply  (simp (no_asm) add: ExtCl_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   412
apply  (simp add: Object_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   413
apply (simp (no_asm))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   414
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   415
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   416
lemma Ext_subcls_Base [simp]: "tprg\<turnstile>Ext \<prec>\<^sub>C Base"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   417
apply (rule subcls_direct2)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   418
apply  (simp (no_asm) add: ExtCl_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   419
apply  (simp add: Object_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   420
apply (simp (no_asm))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   421
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   422
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   423
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   424
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   425
section "fields and method lookup"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   426
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   427
lemma fields_tprg_Object [simp]: "DeclConcepts.fields tprg Object = []"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   428
by (rule ws_tprg [THEN fields_emptyI], force+)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   429
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   430
lemma fields_tprg_Throwable [simp]: 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   431
  "DeclConcepts.fields tprg (SXcpt Throwable) = []"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   432
by (rule ws_tprg [THEN fields_emptyI], force+)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   433
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   434
lemma fields_tprg_SXcpt [simp]: "DeclConcepts.fields tprg (SXcpt xn) = []"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   435
apply (case_tac "xn = Throwable")
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   436
apply  (simp (no_asm_simp))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   437
by (rule ws_tprg [THEN fields_emptyI], force+)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   438
22708
fff918feff45 avoid internal names;
wenzelm
parents: 21404
diff changeset
   439
lemmas fields_rec' = fields_rec [OF _ ws_tprg]
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   440
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   441
lemma fields_Base [simp]: 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   442
"DeclConcepts.fields tprg Base 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   443
  = [((arr,Base), \<lparr>access=Public,static=True ,type=PrimT Boolean.[]\<rparr>),
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   444
     ((vee,Base), \<lparr>access=Public,static=False,type=Iface HasFoo    \<rparr>)]"
22708
fff918feff45 avoid internal names;
wenzelm
parents: 21404
diff changeset
   445
apply (subst fields_rec')
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   446
apply   (auto simp add: BaseCl_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   447
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   448
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   449
lemma fields_Ext [simp]: 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   450
 "DeclConcepts.fields tprg Ext  
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   451
  = [((vee,Ext), \<lparr>access=Public,static=False,type= PrimT Integer\<rparr>)] 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   452
    @ DeclConcepts.fields tprg Base"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   453
apply (rule trans)
22708
fff918feff45 avoid internal names;
wenzelm
parents: 21404
diff changeset
   454
apply (rule fields_rec')
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   455
apply   (auto simp add: ExtCl_def Object_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   456
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   457
22708
fff918feff45 avoid internal names;
wenzelm
parents: 21404
diff changeset
   458
lemmas imethds_rec' = imethds_rec [OF _ ws_tprg]
fff918feff45 avoid internal names;
wenzelm
parents: 21404
diff changeset
   459
lemmas methd_rec'  = methd_rec  [OF _ ws_tprg]
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   460
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   461
lemma imethds_HasFoo [simp]: 
30235
58d147683393 Made Option a separate theory and renamed option_map to Option.map
nipkow
parents: 28524
diff changeset
   462
  "imethds tprg HasFoo = Option.set \<circ> empty(foo_sig\<mapsto>(HasFoo, foo_mhead))"
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   463
apply (rule trans)
22708
fff918feff45 avoid internal names;
wenzelm
parents: 21404
diff changeset
   464
apply (rule imethds_rec')
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   465
apply  (auto simp add: HasFooInt_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   466
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   467
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   468
lemma methd_tprg_Object [simp]: "methd tprg Object = empty"
22708
fff918feff45 avoid internal names;
wenzelm
parents: 21404
diff changeset
   469
apply (subst methd_rec')
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   470
apply (auto simp add: Object_mdecls_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   471
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   472
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   473
lemma methd_Base [simp]: 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   474
  "methd tprg Base = table_of [(\<lambda>(s,m). (s, Base, m)) Base_foo]"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   475
apply (rule trans)
22708
fff918feff45 avoid internal names;
wenzelm
parents: 21404
diff changeset
   476
apply (rule methd_rec')
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   477
apply   (auto simp add: BaseCl_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   478
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   479
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   480
lemma memberid_Base_foo_simp [simp]:
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   481
 "memberid (mdecl Base_foo) = mid foo_sig"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   482
by (simp add: Base_foo_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   483
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   484
lemma memberid_Ext_foo_simp [simp]:
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   485
 "memberid (mdecl Ext_foo) = mid foo_sig"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   486
by (simp add: Ext_foo_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   487
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   488
lemma Base_declares_foo:
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   489
  "tprg\<turnstile>mdecl Base_foo declared_in Base"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   490
by (auto simp add: declared_in_def cdeclaredmethd_def BaseCl_def Base_foo_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   491
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   492
lemma foo_sig_not_undeclared_in_Base:
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   493
  "\<not> tprg\<turnstile>mid foo_sig undeclared_in Base"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   494
proof -
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   495
  from Base_declares_foo
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   496
  show ?thesis
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   497
    by (auto dest!: declared_not_undeclared )
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   498
qed
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   499
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   500
lemma Ext_declares_foo:
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   501
  "tprg\<turnstile>mdecl Ext_foo declared_in Ext"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   502
by (auto simp add: declared_in_def cdeclaredmethd_def ExtCl_def Ext_foo_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   503
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   504
lemma foo_sig_not_undeclared_in_Ext:
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   505
  "\<not> tprg\<turnstile>mid foo_sig undeclared_in Ext"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   506
proof -
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   507
  from Ext_declares_foo
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   508
  show ?thesis
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   509
    by (auto dest!: declared_not_undeclared )
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   510
qed
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   511
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   512
lemma Base_foo_not_inherited_in_Ext:
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   513
 "\<not> tprg \<turnstile> Ext inherits (Base,mdecl Base_foo)"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   514
by (auto simp add: inherits_def foo_sig_not_undeclared_in_Ext)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   515
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   516
lemma Ext_method_inheritance:
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   517
 "filter_tab (\<lambda>sig m. tprg \<turnstile> Ext inherits method sig m)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   518
     (empty(fst ((\<lambda>(s, m). (s, Base, m)) Base_foo)\<mapsto>
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   519
      snd ((\<lambda>(s, m). (s, Base, m)) Base_foo)))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   520
  = empty"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   521
proof -
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   522
  from Base_foo_not_inherited_in_Ext
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   523
  show ?thesis
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   524
    by (auto intro: filter_tab_all_False simp add: Base_foo_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   525
qed
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   526
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   527
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   528
lemma methd_Ext [simp]: "methd tprg Ext =   
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   529
  table_of [(\<lambda>(s,m). (s, Ext, m)) Ext_foo]"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   530
apply (rule trans)
22708
fff918feff45 avoid internal names;
wenzelm
parents: 21404
diff changeset
   531
apply (rule methd_rec')
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   532
apply   (auto simp add: ExtCl_def Object_def Ext_method_inheritance)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   533
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   534
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   535
section "accessibility"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   536
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   537
lemma classesDefined: 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   538
 "\<lbrakk>class tprg C = Some c; C\<noteq>Object\<rbrakk> \<Longrightarrow> \<exists> sc. class tprg (super c) = Some sc"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   539
apply (auto simp add: Classes_def standard_classes_def 
12925
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   540
                      BaseCl_def ExtCl_def MainCl_def
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   541
                      SXcptC_def ObjectC_def) 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   542
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   543
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   544
lemma superclassesBase [simp]: "superclasses tprg Base={Object}"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   545
proof -
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   546
  have ws: "ws_prog tprg" by (rule ws_tprg)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   547
  then show ?thesis
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   548
    by (auto simp add: superclasses_rec  BaseCl_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   549
qed
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   550
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   551
lemma superclassesExt [simp]: "superclasses tprg Ext={Base,Object}"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   552
proof -
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   553
  have ws: "ws_prog tprg" by (rule ws_tprg)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   554
  then show ?thesis
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   555
    by (auto simp add: superclasses_rec  ExtCl_def BaseCl_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   556
qed
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   557
12925
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   558
lemma superclassesMain [simp]: "superclasses tprg Main={Object}"
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   559
proof -
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   560
  have ws: "ws_prog tprg" by (rule ws_tprg)
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   561
  then show ?thesis
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   562
    by (auto simp add: superclasses_rec  MainCl_def)
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   563
qed
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   564
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   565
lemma HasFoo_accessible[simp]:"tprg\<turnstile>(Iface HasFoo) accessible_in P" 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   566
by (simp add: accessible_in_RefT_simp is_public_def HasFooInt_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   567
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   568
lemma HasFoo_is_acc_iface[simp]: "is_acc_iface tprg P HasFoo"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   569
by (simp add: is_acc_iface_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   570
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   571
lemma HasFoo_is_acc_type[simp]: "is_acc_type tprg P (Iface HasFoo)"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   572
by (simp add: is_acc_type_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   573
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   574
lemma Base_accessible[simp]:"tprg\<turnstile>(Class Base) accessible_in P" 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   575
by (simp add: accessible_in_RefT_simp is_public_def BaseCl_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   576
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   577
lemma Base_is_acc_class[simp]: "is_acc_class tprg P Base"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   578
by (simp add: is_acc_class_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   579
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   580
lemma Base_is_acc_type[simp]: "is_acc_type tprg P (Class Base)"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   581
by (simp add: is_acc_type_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   582
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   583
lemma Ext_accessible[simp]:"tprg\<turnstile>(Class Ext) accessible_in P" 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   584
by (simp add: accessible_in_RefT_simp is_public_def ExtCl_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   585
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   586
lemma Ext_is_acc_class[simp]: "is_acc_class tprg P Ext"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   587
by (simp add: is_acc_class_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   588
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   589
lemma Ext_is_acc_type[simp]: "is_acc_type tprg P (Class Ext)"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   590
by (simp add: is_acc_type_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   591
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   592
lemma accmethd_tprg_Object [simp]: "accmethd tprg S Object = empty"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   593
apply (unfold accmethd_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   594
apply (simp)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   595
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   596
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   597
lemma  snd_special_simp: "snd ((\<lambda>(s, m). (s, a, m)) x) = (a,snd x)"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   598
by (cases x) (auto)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   599
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   600
lemma  fst_special_simp: "fst ((\<lambda>(s, m). (s, a, m)) x) = fst x"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   601
by (cases x) (auto)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   602
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   603
lemma foo_sig_undeclared_in_Object:
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   604
  "tprg\<turnstile>mid foo_sig undeclared_in Object"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   605
by (auto simp add: undeclared_in_def cdeclaredmethd_def Object_mdecls_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   606
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   607
lemma unique_sig_Base_foo:
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   608
 "tprg\<turnstile> mdecl (sig, snd Base_foo) declared_in Base \<Longrightarrow> sig=foo_sig"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   609
by (auto simp add: declared_in_def cdeclaredmethd_def 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   610
                   Base_foo_def BaseCl_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   611
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   612
lemma Base_foo_no_override:
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   613
 "tprg,sig\<turnstile>(Base,(snd Base_foo)) overrides old \<Longrightarrow> P"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   614
apply (drule overrides_commonD)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   615
apply (clarsimp)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   616
apply (frule subclsEval)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   617
apply    (rule ws_tprg)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   618
apply    (simp)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   619
apply    (rule classesDefined) 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   620
apply    assumption+
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   621
apply (frule unique_sig_Base_foo) 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   622
apply (auto dest!: declared_not_undeclared intro: foo_sig_undeclared_in_Object
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   623
            dest: unique_sig_Base_foo)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   624
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   625
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   626
lemma Base_foo_no_stat_override:
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   627
 "tprg,sig\<turnstile>(Base,(snd Base_foo)) overrides\<^sub>S old \<Longrightarrow> P"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   628
apply (drule stat_overrides_commonD)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   629
apply (clarsimp)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   630
apply (frule subclsEval)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   631
apply    (rule ws_tprg)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   632
apply    (simp)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   633
apply    (rule classesDefined) 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   634
apply    assumption+
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   635
apply (frule unique_sig_Base_foo) 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   636
apply (auto dest!: declared_not_undeclared intro: foo_sig_undeclared_in_Object
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   637
            dest: unique_sig_Base_foo)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   638
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   639
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   640
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   641
lemma Base_foo_no_hide:
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   642
 "tprg,sig\<turnstile>(Base,(snd Base_foo)) hides old \<Longrightarrow> P"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   643
by (auto dest: hidesD simp add: Base_foo_def member_is_static_simp)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   644
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   645
lemma Ext_foo_no_hide:
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   646
 "tprg,sig\<turnstile>(Ext,(snd Ext_foo)) hides old \<Longrightarrow> P"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   647
by (auto dest: hidesD simp add: Ext_foo_def member_is_static_simp)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   648
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   649
lemma unique_sig_Ext_foo:
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   650
 "tprg\<turnstile> mdecl (sig, snd Ext_foo) declared_in Ext \<Longrightarrow> sig=foo_sig"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   651
by (auto simp add: declared_in_def cdeclaredmethd_def 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   652
                   Ext_foo_def ExtCl_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   653
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   654
lemma Ext_foo_override:
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   655
 "tprg,sig\<turnstile>(Ext,(snd Ext_foo)) overrides old 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   656
  \<Longrightarrow> old = (Base,(snd Base_foo))"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   657
apply (drule overrides_commonD)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   658
apply (clarsimp)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   659
apply (frule subclsEval)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   660
apply    (rule ws_tprg)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   661
apply    (simp)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   662
apply    (rule classesDefined) 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   663
apply    assumption+
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   664
apply (frule unique_sig_Ext_foo) 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   665
apply (case_tac "old")
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   666
apply (insert Base_declares_foo foo_sig_undeclared_in_Object) 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   667
apply (auto simp add: ExtCl_def Ext_foo_def
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   668
                      BaseCl_def Base_foo_def Object_mdecls_def
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   669
                      split_paired_all
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   670
                      member_is_static_simp
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   671
           dest: declared_not_undeclared unique_declaration)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   672
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   673
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   674
lemma Ext_foo_stat_override:
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   675
 "tprg,sig\<turnstile>(Ext,(snd Ext_foo)) overrides\<^sub>S old 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   676
  \<Longrightarrow> old = (Base,(snd Base_foo))"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   677
apply (drule stat_overrides_commonD)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   678
apply (clarsimp)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   679
apply (frule subclsEval)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   680
apply    (rule ws_tprg)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   681
apply    (simp)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   682
apply    (rule classesDefined) 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   683
apply    assumption+
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   684
apply (frule unique_sig_Ext_foo) 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   685
apply (case_tac "old")
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   686
apply (insert Base_declares_foo foo_sig_undeclared_in_Object) 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   687
apply (auto simp add: ExtCl_def Ext_foo_def
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   688
                      BaseCl_def Base_foo_def Object_mdecls_def
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   689
                      split_paired_all
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   690
                      member_is_static_simp
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   691
           dest: declared_not_undeclared unique_declaration)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   692
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   693
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   694
lemma Base_foo_member_of_Base: 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   695
  "tprg\<turnstile>(Base,mdecl Base_foo) member_of Base"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   696
by (auto intro!: members.Immediate Base_declares_foo)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   697
12925
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   698
lemma Base_foo_member_in_Base: 
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   699
  "tprg\<turnstile>(Base,mdecl Base_foo) member_in Base"
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   700
by (rule member_of_to_member_in [OF Base_foo_member_of_Base])
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   701
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   702
lemma Ext_foo_member_of_Ext: 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   703
  "tprg\<turnstile>(Ext,mdecl Ext_foo) member_of Ext"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   704
by (auto intro!: members.Immediate Ext_declares_foo)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   705
12925
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   706
lemma Ext_foo_member_in_Ext: 
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   707
  "tprg\<turnstile>(Ext,mdecl Ext_foo) member_in Ext"
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   708
by (rule member_of_to_member_in [OF Ext_foo_member_of_Ext])
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   709
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   710
lemma Base_foo_permits_acc:
14030
cd928c0ac225 Adapted to changes in Map.thy
schirmer
parents: 13688
diff changeset
   711
 "tprg \<turnstile> (Base, mdecl Base_foo) in Base permits_acc_from S"
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   712
by ( simp add: permits_acc_def Base_foo_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   713
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   714
lemma Base_foo_accessible [simp]:
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   715
 "tprg\<turnstile>(Base,mdecl Base_foo) of Base accessible_from S"
12925
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   716
by (auto intro: accessible_fromR.Immediate 
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   717
                Base_foo_member_of_Base Base_foo_permits_acc)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   718
12925
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   719
lemma Base_foo_dyn_accessible [simp]:
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   720
 "tprg\<turnstile>(Base,mdecl Base_foo) in Base dyn_accessible_from S"
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   721
apply (rule dyn_accessible_fromR.Immediate)
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   722
apply   (rule Base_foo_member_in_Base)
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   723
apply   (rule Base_foo_permits_acc)
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   724
done
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   725
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   726
lemma accmethd_Base [simp]: 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   727
  "accmethd tprg S Base = methd tprg Base"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   728
apply (simp add: accmethd_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   729
apply (rule filter_tab_all_True)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   730
apply (simp add: snd_special_simp fst_special_simp)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   731
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   732
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   733
lemma Ext_foo_permits_acc:
14030
cd928c0ac225 Adapted to changes in Map.thy
schirmer
parents: 13688
diff changeset
   734
 "tprg \<turnstile> (Ext, mdecl Ext_foo) in Ext permits_acc_from S"
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   735
by ( simp add: permits_acc_def Ext_foo_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   736
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   737
lemma Ext_foo_accessible [simp]:
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   738
 "tprg\<turnstile>(Ext,mdecl Ext_foo) of Ext accessible_from S"
12925
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   739
by (auto intro: accessible_fromR.Immediate 
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   740
                Ext_foo_member_of_Ext Ext_foo_permits_acc)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   741
12925
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   742
lemma Ext_foo_dyn_accessible [simp]:
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   743
 "tprg\<turnstile>(Ext,mdecl Ext_foo) in Ext dyn_accessible_from S"
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   744
apply (rule dyn_accessible_fromR.Immediate) 
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   745
apply   (rule Ext_foo_member_in_Ext)
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   746
apply   (rule Ext_foo_permits_acc)
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   747
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   748
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   749
lemma Ext_foo_overrides_Base_foo:
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   750
 "tprg\<turnstile>(Ext,Ext_foo) overrides (Base,Base_foo)"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   751
proof (rule overridesR.Direct, simp_all)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   752
  show "\<not> is_static Ext_foo" 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   753
    by (simp add: member_is_static_simp Ext_foo_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   754
  show "\<not> is_static Base_foo"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   755
    by (simp add: member_is_static_simp Base_foo_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   756
  show "accmodi Ext_foo \<noteq> Private"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   757
    by (simp add: Ext_foo_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   758
  show "msig (Ext, Ext_foo) = msig (Base, Base_foo)"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   759
    by (simp add: Ext_foo_def Base_foo_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   760
  show "tprg\<turnstile>mdecl Ext_foo declared_in Ext"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   761
    by (auto intro: Ext_declares_foo)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   762
  show "tprg\<turnstile>mdecl Base_foo declared_in Base"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   763
    by (auto intro: Base_declares_foo)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   764
  show "tprg \<turnstile>(Base, mdecl Base_foo) inheritable_in java_lang"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   765
    by (simp add: inheritable_in_def Base_foo_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   766
  show "tprg\<turnstile>resTy Ext_foo\<preceq>resTy Base_foo"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   767
    by (simp add: Ext_foo_def Base_foo_def mhead_resTy_simp)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   768
qed
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   769
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   770
lemma accmethd_Ext [simp]: 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   771
  "accmethd tprg S Ext = methd tprg Ext"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   772
apply (simp add: accmethd_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   773
apply (rule filter_tab_all_True)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   774
apply (auto simp add: snd_special_simp fst_special_simp)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   775
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   776
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   777
lemma cls_Ext: "class tprg Ext = Some ExtCl"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   778
by simp
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   779
lemma dynmethd_Ext_foo:
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   780
 "dynmethd tprg Base Ext \<lparr>name = foo, parTs = [Class Base]\<rparr> 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   781
  = Some (Ext,snd Ext_foo)"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   782
proof -
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   783
  have "methd tprg Base \<lparr>name = foo, parTs = [Class Base]\<rparr> 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   784
          = Some (Base,snd Base_foo)" and
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   785
       "methd tprg Ext \<lparr>name = foo, parTs = [Class Base]\<rparr> 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   786
          = Some (Ext,snd Ext_foo)" 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   787
    by (auto simp add: Ext_foo_def Base_foo_def foo_sig_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   788
  with cls_Ext ws_tprg Ext_foo_overrides_Base_foo
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   789
  show ?thesis
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   790
    by (auto simp add: dynmethd_rec simp add: Ext_foo_def Base_foo_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   791
qed
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   792
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   793
lemma Base_fields_accessible[simp]:
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   794
 "accfield tprg S Base 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   795
  = table_of((map (\<lambda>((n,d),f).(n,(d,f)))) (DeclConcepts.fields tprg Base))"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   796
apply (auto simp add: accfield_def expand_fun_eq Let_def 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   797
                      accessible_in_RefT_simp
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   798
                      is_public_def
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   799
                      BaseCl_def
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   800
                      permits_acc_def
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   801
                      declared_in_def 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   802
                      cdeclaredfield_def
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   803
               intro!: filter_tab_all_True_Some filter_tab_None
12925
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   804
                       accessible_fromR.Immediate
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   805
               intro: members.Immediate)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   806
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   807
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   808
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   809
lemma arr_member_of_Base:
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   810
  "tprg\<turnstile>(Base, fdecl (arr, 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   811
                 \<lparr>access = Public, static = True, type = PrimT Boolean.[]\<rparr>))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   812
          member_of Base"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   813
by (auto intro: members.Immediate 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   814
       simp add: declared_in_def cdeclaredfield_def BaseCl_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   815
 
12925
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   816
lemma arr_member_in_Base:
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   817
  "tprg\<turnstile>(Base, fdecl (arr, 
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   818
                 \<lparr>access = Public, static = True, type = PrimT Boolean.[]\<rparr>))
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   819
          member_in Base"
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   820
by (rule member_of_to_member_in [OF arr_member_of_Base])
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   821
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   822
lemma arr_member_of_Ext:
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   823
  "tprg\<turnstile>(Base, fdecl (arr, 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   824
                    \<lparr>access = Public, static = True, type = PrimT Boolean.[]\<rparr>))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   825
             member_of Ext"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   826
apply (rule members.Inherited)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   827
apply   (simp add: inheritable_in_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   828
apply   (simp add: undeclared_in_def cdeclaredfield_def ExtCl_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   829
apply   (auto intro: arr_member_of_Base simp add: subcls1_def ExtCl_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   830
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   831
12925
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   832
lemma arr_member_in_Ext:
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   833
  "tprg\<turnstile>(Base, fdecl (arr, 
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   834
                 \<lparr>access = Public, static = True, type = PrimT Boolean.[]\<rparr>))
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   835
          member_in Ext"
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   836
by (rule member_of_to_member_in [OF arr_member_of_Ext])
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   837
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   838
lemma Ext_fields_accessible[simp]:
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   839
"accfield tprg S Ext 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   840
  = table_of((map (\<lambda>((n,d),f).(n,(d,f)))) (DeclConcepts.fields tprg Ext))"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   841
apply (auto simp add: accfield_def expand_fun_eq Let_def 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   842
                      accessible_in_RefT_simp
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   843
                      is_public_def
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   844
                      BaseCl_def
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   845
                      ExtCl_def
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   846
                      permits_acc_def
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   847
               intro!: filter_tab_all_True_Some filter_tab_None
12925
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   848
                       accessible_fromR.Immediate)
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   849
apply (auto intro: members.Immediate arr_member_of_Ext
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   850
            simp add: declared_in_def cdeclaredfield_def ExtCl_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   851
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   852
12925
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   853
lemma arr_Base_dyn_accessible [simp]:
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   854
"tprg\<turnstile>(Base, fdecl (arr, \<lparr>access=Public,static=True ,type=PrimT Boolean.[]\<rparr>)) 
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   855
       in Base dyn_accessible_from S"
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   856
apply (rule dyn_accessible_fromR.Immediate)
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   857
apply   (rule arr_member_in_Base)
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   858
apply   (simp add: permits_acc_def)
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   859
done
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   860
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   861
lemma arr_Ext_dyn_accessible[simp]:
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   862
"tprg\<turnstile>(Base, fdecl (arr, \<lparr>access=Public,static=True ,type=PrimT Boolean.[]\<rparr>)) 
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   863
       in Ext dyn_accessible_from S"
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   864
apply (rule dyn_accessible_fromR.Immediate)
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   865
apply   (rule arr_member_in_Ext)
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   866
apply   (simp add: permits_acc_def)
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   867
done
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   868
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   869
lemma array_of_PrimT_acc [simp]:
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   870
 "is_acc_type tprg java_lang (PrimT t.[])"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   871
apply (simp add: is_acc_type_def accessible_in_RefT_simp)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   872
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   873
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   874
lemma PrimT_acc [simp]: 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   875
 "is_acc_type tprg java_lang (PrimT t)"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   876
apply (simp add: is_acc_type_def accessible_in_RefT_simp)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   877
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   878
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   879
lemma Object_acc [simp]:
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   880
 "is_acc_class tprg java_lang Object"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   881
apply (auto simp add: is_acc_class_def accessible_in_RefT_simp is_public_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   882
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   883
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   884
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   885
section "well-formedness"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   886
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   887
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   888
lemma wf_HasFoo: "wf_idecl tprg (HasFoo, HasFooInt)"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   889
apply (unfold wf_idecl_def HasFooInt_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   890
apply (auto intro!: wf_mheadI ws_idecl_HasFoo 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   891
            simp add: foo_sig_def foo_mhead_def mhead_resTy_simp
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   892
                      member_is_static_simp )
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   893
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   894
12925
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   895
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
   896
declare member_is_static_simp [simp]
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   897
declare wt.Skip [rule del] wt.Init [rule del]
26480
544cef16045b replaced 'ML_setup' by 'ML';
wenzelm
parents: 26342
diff changeset
   898
ML {* bind_thms ("wt_intros", map (rewrite_rule @{thms id_def}) @{thms wt.intros}) *}
13688
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   899
lemmas wtIs = wt_Call wt_Super wt_FVar wt_StatRef wt_intros
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   900
lemmas daIs = assigned.select_convs da_Skip da_NewC da_Lit da_Super da.intros
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   901
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   902
lemmas Base_foo_defs = Base_foo_def foo_sig_def foo_mhead_def
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   903
lemmas Ext_foo_defs  = Ext_foo_def  foo_sig_def
13688
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   904
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   905
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   906
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   907
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   908
lemma wf_Base_foo: "wf_mdecl tprg Base Base_foo"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   909
apply (unfold Base_foo_defs )
13688
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   910
apply (auto intro!: wf_mdeclI wf_mheadI intro!: wtIs 
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   911
            simp add: mhead_resTy_simp)
13688
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   912
(* for definite assignment *)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   913
apply (rule exI)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   914
apply (simp add: parameters_def)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   915
apply (rule conjI)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   916
apply  (rule da.Comp)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   917
apply     (rule da.Expr)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   918
apply     (rule da.AssLVar)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   919
apply       (rule da.AccLVar)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   920
apply         (simp)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   921
apply        (rule assigned.select_convs)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   922
apply       (simp)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   923
apply      (rule assigned.select_convs)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   924
apply     (simp)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   925
apply    (simp)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   926
apply    (rule da.Jmp)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   927
apply      (simp)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   928
apply     (rule assigned.select_convs)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   929
apply    (simp)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   930
apply   (rule assigned.select_convs)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   931
apply  (simp)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   932
apply (simp)
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   933
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   934
13688
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   935
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   936
lemma wf_Ext_foo: "wf_mdecl tprg Ext Ext_foo"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   937
apply (unfold Ext_foo_defs )
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   938
apply (auto intro!: wf_mdeclI wf_mheadI intro!: wtIs 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   939
            simp add: mhead_resTy_simp )
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   940
apply  (rule wt.Cast)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   941
prefer 2
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   942
apply    simp
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   943
apply   (rule_tac [2] narrow.subcls [THEN cast.narrow])
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   944
apply   (auto intro!: wtIs)
13688
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   945
(* for definite assignment *)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   946
apply (rule exI)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   947
apply (simp add: parameters_def)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   948
apply (rule conjI)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   949
apply  (rule da.Comp)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   950
apply     (rule da.Expr)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   951
apply     (rule da.Ass)   
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   952
apply       simp
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   953
apply      (rule da.FVar)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   954
apply      (rule da.Cast)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   955
apply      (rule da.AccLVar)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   956
apply        simp
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   957
apply       (rule assigned.select_convs)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   958
apply      simp
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   959
apply     (rule da_Lit)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   960
apply     (simp)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   961
apply    (rule da.Comp)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   962
apply       (rule da.Expr)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   963
apply       (rule da.AssLVar)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   964
apply         (rule da.Lit)                  
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   965
apply        (rule assigned.select_convs)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   966
apply       simp
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   967
apply      (rule da.Jmp)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   968
apply        simp
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   969
apply       (rule assigned.select_convs)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   970
apply      simp
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   971
apply     (rule assigned.select_convs)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   972
apply    (simp)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   973
apply   (rule assigned.select_convs)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   974
apply  simp
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   975
apply simp
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   976
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   977
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   978
declare mhead_resTy_simp [simp add]
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   979
declare member_is_static_simp [simp add]
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   980
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   981
lemma wf_BaseC: "wf_cdecl tprg (Base,BaseCl)"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   982
apply (unfold wf_cdecl_def BaseCl_def arr_viewed_from_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   983
apply (auto intro!: wf_Base_foo)
13688
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   984
apply        (auto intro!: ws_cdecl_Base simp add: Base_foo_def foo_mhead_def)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   985
apply   (auto intro!: wtIs)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   986
(* for definite assignment *)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   987
apply   (rule exI)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   988
apply   (rule da.Expr)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   989
apply  (rule da.Ass)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   990
apply    (simp)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   991
apply   (rule da.FVar)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   992
apply   (rule da.Cast)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   993
apply   (rule da_Lit)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   994
apply   simp
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   995
apply  (rule da.NewA)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   996
apply  (rule da.Lit)
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   997
apply (auto simp add: Base_foo_defs entails_def Let_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
   998
apply   (insert Base_foo_no_stat_override, simp add: Base_foo_def,blast)+
13688
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
   999
apply (insert Base_foo_no_hide         , simp add: Base_foo_def,blast)
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1000
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1001
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1002
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1003
lemma wf_ExtC: "wf_cdecl tprg (Ext,ExtCl)"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1004
apply (unfold wf_cdecl_def ExtCl_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1005
apply (auto intro!: wf_Ext_foo ws_cdecl_Ext)
13688
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1006
apply  (auto simp add: entails_def snd_special_simp)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1007
apply      (insert Ext_foo_stat_override)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1008
apply      (rule exI,rule da.Skip)      
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1009
apply     (force simp add: qmdecl_def Ext_foo_def Base_foo_def)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1010
apply    (force simp add: qmdecl_def Ext_foo_def Base_foo_def)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1011
apply   (force simp add: qmdecl_def Ext_foo_def Base_foo_def)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1012
apply  (insert Ext_foo_no_hide)
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1013
apply  (simp_all add: qmdecl_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1014
apply  blast+
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1015
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1016
12925
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
  1017
lemma wf_MainC: "wf_cdecl tprg (Main,MainCl)"
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
  1018
apply (unfold wf_cdecl_def MainCl_def)
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
  1019
apply (auto intro: ws_cdecl_Main)
13688
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1020
apply (rule exI,rule da.Skip)
12925
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
  1021
done
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
  1022
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1023
lemma wf_idecl_all: "p=tprg \<Longrightarrow> Ball (set Ifaces) (wf_idecl p)"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1024
apply (simp (no_asm) add: Ifaces_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1025
apply (simp (no_asm_simp))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1026
apply (rule wf_HasFoo)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1027
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1028
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1029
lemma wf_cdecl_all_standard_classes: 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1030
  "Ball (set standard_classes) (wf_cdecl tprg)"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1031
apply (unfold standard_classes_def Let_def 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1032
       ObjectC_def SXcptC_def Object_mdecls_def SXcpt_mdecls_def)
18576
8d98b7711e47 Reversed Larry's option/iff change.
nipkow
parents: 18551
diff changeset
  1033
apply (simp (no_asm) add: wf_cdecl_def ws_cdecls)
13688
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1034
apply (auto simp add:is_acc_class_def accessible_in_RefT_simp SXcpt_def 
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1035
            intro: da.Skip)
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1036
apply (auto simp add: Object_def Classes_def standard_classes_def 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1037
                      SXcptC_def SXcpt_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1038
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1039
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1040
lemma wf_cdecl_all: "p=tprg \<Longrightarrow> Ball (set Classes) (wf_cdecl p)"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1041
apply (simp (no_asm) add: Classes_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1042
apply (simp (no_asm_simp))
12925
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
  1043
apply    (rule wf_BaseC [THEN conjI])
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
  1044
apply   (rule wf_ExtC [THEN conjI])
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
  1045
apply  (rule wf_MainC [THEN conjI])
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1046
apply (rule wf_cdecl_all_standard_classes)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1047
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1048
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1049
theorem wf_tprg: "wf_prog tprg"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1050
apply (unfold wf_prog_def Let_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1051
apply (simp (no_asm) add: unique_ifaces unique_classes)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1052
apply (rule conjI)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1053
apply  ((simp (no_asm) add: Classes_def standard_classes_def))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1054
apply (rule conjI)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1055
apply (simp add: Object_mdecls_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1056
apply safe
13688
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1057
apply  (cut_tac xn_cases)   
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1058
apply  (simp (no_asm_simp) add: Classes_def standard_classes_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1059
apply  (insert wf_idecl_all)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1060
apply  (insert wf_cdecl_all)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1061
apply  auto
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1062
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1063
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1064
section "max spec"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1065
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1066
lemma appl_methds_Base_foo: 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1067
"appl_methds tprg S (ClassT Base) \<lparr>name=foo, parTs=[NT]\<rparr> =  
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1068
  {((ClassT Base, \<lparr>access=Public,static=False,pars=[z],resT=Class Base\<rparr>)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1069
    ,[Class Base])}"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1070
apply (unfold appl_methds_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1071
apply (simp (no_asm))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1072
apply (subgoal_tac "tprg\<turnstile>NT\<preceq> Class Base")
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1073
apply  (auto simp add: cmheads_def Base_foo_defs)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1074
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1075
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1076
lemma max_spec_Base_foo: "max_spec tprg S (ClassT Base) \<lparr>name=foo,parTs=[NT]\<rparr> = 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1077
  {((ClassT Base, \<lparr>access=Public,static=False,pars=[z],resT=Class Base\<rparr>)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1078
   , [Class Base])}"
31197
c1c163ec6c44 fine-tuned elimination of comprehensions involving x=t.
nipkow
parents: 31166
diff changeset
  1079
by (simp add: max_spec_def appl_methds_Base_foo Collect_conv_if)
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1080
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1081
section "well-typedness"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1082
12925
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
  1083
lemma wt_test: "\<lparr>prg=tprg,cls=Main,lcl=empty(VName e\<mapsto>Class Base)\<rparr>\<turnstile>test ?pTs\<Colon>\<surd>"
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1084
apply (unfold test_def arr_viewed_from_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1085
(* ?pTs = [Class Base] *)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1086
apply (rule wtIs (* ;; *))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1087
apply  (rule wtIs (* Ass *))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1088
apply  (rule wtIs (* NewC *))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1089
apply     (rule wtIs (* LVar *))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1090
apply      (simp)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1091
apply     (simp)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1092
apply    (simp)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1093
apply   (rule wtIs (* NewC *))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1094
apply   (simp)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1095
apply  (simp)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1096
apply (rule wtIs (* Try *))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1097
prefer 4
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1098
apply    (simp)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1099
defer
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1100
apply    (rule wtIs (* Expr *))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1101
apply    (rule wtIs (* Call *))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1102
apply       (rule wtIs (* Acc *))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1103
apply       (rule wtIs (* LVar *))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1104
apply        (simp)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1105
apply       (simp)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1106
apply      (rule wtIs (* Cons *))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1107
apply       (rule wtIs (* Lit *))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1108
apply       (simp)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1109
apply      (rule wtIs (* Nil *))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1110
apply     (simp)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1111
apply     (rule max_spec_Base_foo)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1112
apply    (simp)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1113
apply   (simp)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1114
apply  (simp)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1115
apply  (simp)
12925
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
  1116
apply  (simp)
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1117
apply (rule wtIs (* While *))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1118
apply  (rule wtIs (* Acc *))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1119
apply   (rule wtIs (* AVar *))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1120
apply   (rule wtIs (* Acc *))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1121
apply   (rule wtIs (* FVar *))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1122
apply    (rule wtIs (* StatRef *))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1123
apply    (simp)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1124
apply   (simp)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1125
apply   (simp )
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1126
apply   (simp)
12925
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
  1127
apply   (simp)
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1128
apply  (rule wtIs (* LVar *))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1129
apply  (simp)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1130
apply (rule wtIs (* Skip *))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1131
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1132
13688
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1133
section "definite assignment"
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1134
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1135
lemma da_test: "\<lparr>prg=tprg,cls=Main,lcl=empty(VName e\<mapsto>Class Base)\<rparr>
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1136
                  \<turnstile>{} \<guillemotright>\<langle>test ?pTs\<rangle>\<guillemotright> \<lparr>nrm={VName e},brk=\<lambda> l. UNIV\<rparr>"
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1137
apply (unfold test_def arr_viewed_from_def)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1138
apply (rule da.Comp)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1139
apply    (rule da.Expr)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1140
apply    (rule da.AssLVar)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1141
apply      (rule da.NewC)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1142
apply     (rule assigned.select_convs)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1143
apply    (simp)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1144
apply   (rule da.Try)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1145
apply      (rule da.Expr)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1146
apply      (rule da.Call)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1147
apply       (rule da.AccLVar)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1148
apply         (simp)   
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1149
apply        (rule assigned.select_convs)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1150
apply       (simp)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1151
apply      (rule da.Cons)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1152
apply       (rule da.Lit)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1153
apply      (rule da.Nil)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1154
apply     (rule da.Loop)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1155
apply        (rule da.Acc)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1156
apply         (simp)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1157
apply        (rule da.AVar)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1158
apply         (rule da.Acc)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1159
apply          simp
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1160
apply         (rule da.FVar)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1161
apply         (rule da.Cast)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1162
apply         (rule da.Lit)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1163
apply        (rule da.Lit)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1164
apply       (rule da_Skip)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1165
apply       (simp)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1166
apply      (simp,rule assigned.select_convs)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1167
apply     (simp)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1168
apply    (simp,rule assigned.select_convs)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1169
apply   (simp)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1170
apply  simp
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1171
apply simp
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1172
apply (simp add: intersect_ts_def)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1173
done
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1174
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1175
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1176
section "execution"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1177
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1178
lemma alloc_one: "\<And>a obj. \<lbrakk>the (new_Addr h) = a; atleast_free h (Suc n)\<rbrakk> \<Longrightarrow>  
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1179
  new_Addr h = Some a \<and> atleast_free (h(a\<mapsto>obj)) n"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1180
apply (frule atleast_free_SucD)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1181
apply (drule atleast_free_Suc [THEN iffD1])
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1182
apply clarsimp
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1183
apply (frule new_Addr_SomeI)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1184
apply force
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1185
done
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1186
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1187
declare fvar_def2 [simp] avar_def2 [simp] init_lvars_def2 [simp]
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1188
declare init_obj_def [simp] var_tys_def [simp] fields_table_def [simp]
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1189
declare BaseCl_def [simp] ExtCl_def [simp] Ext_foo_def [simp]
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1190
        Base_foo_defs  [simp]
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1191
26480
544cef16045b replaced 'ML_setup' by 'ML';
wenzelm
parents: 26342
diff changeset
  1192
ML {* bind_thms ("eval_intros", map 
26342
0f65fa163304 more antiquotations;
wenzelm
parents: 24019
diff changeset
  1193
        (simplify (@{simpset} delsimps @{thms Skip_eq}
24019
67bde7cfcf10 tuned ML/simproc declarations;
wenzelm
parents: 22708
diff changeset
  1194
                             addsimps @{thms lvar_def}) o 
67bde7cfcf10 tuned ML/simproc declarations;
wenzelm
parents: 22708
diff changeset
  1195
         rewrite_rule [@{thm assign_def}, @{thm Let_def}]) @{thms eval.intros}) *}
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1196
lemmas eval_Is = eval_Init eval_StatRef AbruptIs eval_intros
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1197
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1198
consts
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1199
  a :: loc
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1200
  b :: loc
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1201
  c :: loc
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1202
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20769
diff changeset
  1203
abbreviation "one == Suc 0"
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20769
diff changeset
  1204
abbreviation "two == Suc one"
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20769
diff changeset
  1205
abbreviation "tree == Suc two"
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20769
diff changeset
  1206
abbreviation "four == Suc tree"
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1207
20769
5d538d3d5e2a replaced syntax/translations by abbreviation;
wenzelm
parents: 18576
diff changeset
  1208
syntax
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1209
  obj_a :: obj
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1210
  obj_b :: obj
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1211
  obj_c :: obj
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1212
  arr_N :: "(vn, val) table"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1213
  arr_a :: "(vn, val) table"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1214
  globs1 :: globs
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1215
  globs2 :: globs
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1216
  globs3 :: globs
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1217
  globs8 :: globs
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1218
  locs3 :: locals
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1219
  locs4 :: locals
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1220
  locs8 :: locals
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1221
  s0  :: state
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1222
  s0' :: state
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1223
  s9' :: state
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1224
  s1  :: state
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1225
  s1' :: state
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1226
  s2  :: state
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1227
  s2' :: state
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1228
  s3  :: state
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1229
  s3' :: state
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1230
  s4  :: state
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1231
  s4' :: state
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1232
  s6' :: state
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1233
  s7' :: state
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1234
  s8  :: state
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1235
  s8' :: state
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1236
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1237
translations
20769
5d538d3d5e2a replaced syntax/translations by abbreviation;
wenzelm
parents: 18576
diff changeset
  1238
  "obj_a"   <= "\<lparr>tag=Arr (PrimT Boolean) (CONST two)
33965
f57c11db4ad4 Inl and Inr now with authentic syntax
haftmann
parents: 32960
diff changeset
  1239
                ,values=CONST empty(CONST Inr 0\<mapsto>Bool False)(CONST Inr (CONST one)\<mapsto>Bool False)\<rparr>"
20769
5d538d3d5e2a replaced syntax/translations by abbreviation;
wenzelm
parents: 18576
diff changeset
  1240
  "obj_b"   <= "\<lparr>tag=CInst (CONST Ext)
33965
f57c11db4ad4 Inl and Inr now with authentic syntax
haftmann
parents: 32960
diff changeset
  1241
                ,values=(CONST empty(CONST Inl (CONST vee, CONST Base)\<mapsto>Null   ) 
f57c11db4ad4 Inl and Inr now with authentic syntax
haftmann
parents: 32960
diff changeset
  1242
                              (CONST Inl (CONST vee, CONST Ext )\<mapsto>Intg 0))\<rparr>"
20769
5d538d3d5e2a replaced syntax/translations by abbreviation;
wenzelm
parents: 18576
diff changeset
  1243
  "obj_c"   == "\<lparr>tag=CInst (SXcpt NullPointer),values=CONST empty\<rparr>"
33965
f57c11db4ad4 Inl and Inr now with authentic syntax
haftmann
parents: 32960
diff changeset
  1244
  "arr_N"   == "CONST empty(CONST Inl (CONST arr, CONST Base)\<mapsto>Null)"
f57c11db4ad4 Inl and Inr now with authentic syntax
haftmann
parents: 32960
diff changeset
  1245
  "arr_a"   == "CONST empty(CONST Inl (CONST arr, CONST Base)\<mapsto>Addr a)"
f57c11db4ad4 Inl and Inr now with authentic syntax
haftmann
parents: 32960
diff changeset
  1246
  "globs1"  == "CONST empty(CONST Inr (CONST Ext)   \<mapsto>\<lparr>tag=CONST undefined, values=CONST empty\<rparr>)
f57c11db4ad4 Inl and Inr now with authentic syntax
haftmann
parents: 32960
diff changeset
  1247
                     (CONST Inr (CONST Base)  \<mapsto>\<lparr>tag=CONST undefined, values=arr_N\<rparr>)
f57c11db4ad4 Inl and Inr now with authentic syntax
haftmann
parents: 32960
diff changeset
  1248
                     (CONST Inr Object\<mapsto>\<lparr>tag=CONST undefined, values=CONST empty\<rparr>)"
f57c11db4ad4 Inl and Inr now with authentic syntax
haftmann
parents: 32960
diff changeset
  1249
  "globs2"  == "CONST empty(CONST Inr (CONST Ext)   \<mapsto>\<lparr>tag=CONST undefined, values=CONST empty\<rparr>)
f57c11db4ad4 Inl and Inr now with authentic syntax
haftmann
parents: 32960
diff changeset
  1250
                     (CONST Inr Object\<mapsto>\<lparr>tag=CONST undefined, values=CONST empty\<rparr>)
f57c11db4ad4 Inl and Inr now with authentic syntax
haftmann
parents: 32960
diff changeset
  1251
                     (CONST Inl a\<mapsto>obj_a)
f57c11db4ad4 Inl and Inr now with authentic syntax
haftmann
parents: 32960
diff changeset
  1252
                     (CONST Inr (CONST Base)  \<mapsto>\<lparr>tag=CONST undefined, values=arr_a\<rparr>)"
f57c11db4ad4 Inl and Inr now with authentic syntax
haftmann
parents: 32960
diff changeset
  1253
  "globs3"  == "globs2(CONST Inl b\<mapsto>obj_b)"
f57c11db4ad4 Inl and Inr now with authentic syntax
haftmann
parents: 32960
diff changeset
  1254
  "globs8"  == "globs3(CONST Inl c\<mapsto>obj_c)"
20769
5d538d3d5e2a replaced syntax/translations by abbreviation;
wenzelm
parents: 18576
diff changeset
  1255
  "locs3"   == "CONST empty(VName (CONST e)\<mapsto>Addr b)"
33965
f57c11db4ad4 Inl and Inr now with authentic syntax
haftmann
parents: 32960
diff changeset
  1256
  "locs4"   == "CONST empty(VName (CONST z)\<mapsto>Null)(CONST Inr()\<mapsto>Addr b)"
20769
5d538d3d5e2a replaced syntax/translations by abbreviation;
wenzelm
parents: 18576
diff changeset
  1257
  "locs8"   == "locs3(VName (CONST z)\<mapsto>Addr c)"
5d538d3d5e2a replaced syntax/translations by abbreviation;
wenzelm
parents: 18576
diff changeset
  1258
  "s0"  == "       st (CONST empty) (CONST empty)"
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1259
  "s0'" == " Norm  s0"
20769
5d538d3d5e2a replaced syntax/translations by abbreviation;
wenzelm
parents: 18576
diff changeset
  1260
  "s1"  == "       st globs1 (CONST empty)"
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1261
  "s1'" == " Norm  s1"
20769
5d538d3d5e2a replaced syntax/translations by abbreviation;
wenzelm
parents: 18576
diff changeset
  1262
  "s2"  == "       st globs2 (CONST empty)"
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1263
  "s2'" == " Norm  s2"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1264
  "s3"  == "       st globs3 locs3 "
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1265
  "s3'" == " Norm  s3"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1266
  "s4"  == "       st globs3 locs4"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1267
  "s4'" == " Norm  s4"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1268
  "s6'" == "(Some (Xcpt (Std NullPointer)), s4)"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1269
  "s7'" == "(Some (Xcpt (Std NullPointer)), s3)"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1270
  "s8"  == "       st globs8 locs8"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1271
  "s8'" == " Norm  s8"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1272
  "s9'" == "(Some (Xcpt (Std IndOutBound)), s8)"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1273
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1274
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1275
declare Pair_eq [simp del]
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1276
lemma exec_test: 
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1277
"\<lbrakk>the (new_Addr (heap  s1)) = a;  
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1278
  the (new_Addr (heap ?s2)) = b;  
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1279
  the (new_Addr (heap ?s3)) = c\<rbrakk> \<Longrightarrow>  
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1280
  atleast_free  (heap s0) four \<Longrightarrow>  
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1281
  tprg\<turnstile>s0' \<midarrow>test [Class Base]\<rightarrow> ?s9'"
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1282
apply (unfold test_def arr_viewed_from_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1283
(* ?s9' = s9' *)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1284
apply (simp (no_asm_use))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1285
apply (drule (1) alloc_one,clarsimp)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1286
apply (rule eval_Is (* ;; *))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1287
apply  (erule_tac V = "the (new_Addr ?h) = c" in thin_rl)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1288
apply  (erule_tac [2] V = "new_Addr ?h = Some a" in thin_rl)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1289
apply  (erule_tac [2] V = "atleast_free ?h four" in thin_rl)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1290
apply  (rule eval_Is (* Expr *))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1291
apply  (rule eval_Is (* Ass *))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1292
apply   (rule eval_Is (* LVar *))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1293
apply  (rule eval_Is (* NewC *))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1294
      (* begin init Ext *)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1295
apply   (erule_tac V = "the (new_Addr ?h) = b" in thin_rl)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1296
apply   (erule_tac V = "atleast_free ?h tree" in thin_rl)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1297
apply   (erule_tac [2] V = "atleast_free ?h four" in thin_rl)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1298
apply   (erule_tac [2] V = "new_Addr ?h = Some a" in thin_rl)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1299
apply   (rule eval_Is (* Init Ext *))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1300
apply   (simp)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1301
apply   (rule conjI)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1302
prefer 2 apply (rule conjI HOL.refl)+
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1303
apply   (rule eval_Is (* Init Base *))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1304
apply   (simp add: arr_viewed_from_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1305
apply   (rule conjI)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1306
apply    (rule eval_Is (* Init Object *))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1307
apply    (simp)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1308
apply    (rule conjI, rule HOL.refl)+
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1309
apply    (rule HOL.refl)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1310
apply   (simp)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1311
apply   (rule conjI, rule_tac [2] HOL.refl)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1312
apply   (rule eval_Is (* Expr *))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1313
apply   (rule eval_Is (* Ass *))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1314
apply    (rule eval_Is (* FVar *))
12925
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
  1315
apply         (rule init_done, simp)
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
  1316
apply        (rule eval_Is (* StatRef *))
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
  1317
apply       (simp)
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
  1318
apply     (simp add: check_field_access_def Let_def) 
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1319
apply   (rule eval_Is (* NewA *))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1320
apply     (simp)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1321
apply    (rule eval_Is (* Lit *))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1322
apply   (simp)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1323
apply   (rule halloc.New)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1324
apply    (simp (no_asm_simp))
13688
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1325
apply   (drule atleast_free_weaken,drule atleast_free_weaken)
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1326
apply   (simp (no_asm_simp))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1327
apply  (simp add: upd_gobj_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1328
      (* end init Ext *)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1329
apply  (rule halloc.New)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1330
apply   (drule alloc_one)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1331
prefer 2 apply fast
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1332
apply   (simp (no_asm_simp))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1333
apply  (drule atleast_free_weaken)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1334
apply  force
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1335
apply (simp)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1336
apply (drule alloc_one)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1337
apply  (simp (no_asm_simp))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1338
apply clarsimp
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1339
apply (erule_tac V = "atleast_free ?h tree" in thin_rl)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1340
apply (drule_tac x = "a" in new_AddrD2 [THEN spec])
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1341
apply (simp (no_asm_use))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1342
apply (rule eval_Is (* Try *))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1343
apply   (rule eval_Is (* Expr *))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1344
      (* begin method call *)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1345
apply   (rule eval_Is (* Call *))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1346
apply      (rule eval_Is (* Acc *))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1347
apply      (rule eval_Is (* LVar *))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1348
apply     (rule eval_Is (* Cons *))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1349
apply      (rule eval_Is (* Lit *))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1350
apply     (rule eval_Is (* Nil *))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1351
apply    (simp)
12925
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
  1352
apply    (simp)
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
  1353
apply    (subgoal_tac
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
  1354
             "tprg\<turnstile>(Ext,mdecl Ext_foo) in Ext dyn_accessible_from Main")
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
  1355
apply      (simp add: check_method_access_def Let_def
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
  1356
                      invocation_declclass_def dynlookup_def dynmethd_Ext_foo)
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
  1357
apply      (rule Ext_foo_dyn_accessible)
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1358
apply   (rule eval_Is (* Methd *))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1359
apply   (simp add: body_def Let_def)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1360
apply   (rule eval_Is (* Body *))
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1361
apply     (rule init_done, simp)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1362
apply       (simp add: invocation_declclass_def dynlookup_def dynmethd_Ext_foo)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1363
apply    (simp add: invocation_declclass_def dynlookup_def dynmethd_Ext_foo)
13688
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1364
apply    (rule eval_Is (* Comp *))
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1365
apply     (rule eval_Is (* Expr *))
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1366
apply     (rule eval_Is (* Ass *))
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1367
apply      (rule eval_Is (* FVar *))
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1368
apply         (rule init_done, simp)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1369
apply        (rule eval_Is (* Cast *))
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1370
apply         (rule eval_Is (* Acc *))
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1371
apply         (rule eval_Is (* LVar *))
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1372
apply        (simp)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1373
apply       (simp split del: split_if)
12925
99131847fb93 Added check for field/method access to operational semantics and proved the acesses valid.
schirmer
parents: 12858
diff changeset
  1374
apply      (simp add: check_field_access_def Let_def)
13688
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1375
apply     (rule eval_Is (* XcptE *))
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1376
apply    (simp)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1377
apply    (rule conjI)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1378
apply     (simp)
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1379
apply    (rule eval_Is (* Comp *))
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1380
apply   (simp)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1381
      (* end method call *)
13688
a0b16d42d489 "Definite Assignment Analysis" included, with proof of correctness. Large adjustments of type safety proof and soundness proof of the axiomatic semantics were necessary. Completeness proof of the loop rule of the axiomatic semantic was altered. So the additional polymorphic variants of some rules could be removed.
schirmer
parents: 13524
diff changeset
  1382
apply  simp
12854
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1383
apply  (rule sxalloc.intros)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1384
apply  (rule halloc.New)
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1385
apply   (erule alloc_one [THEN conjunct1])
00d4a435777f Isabelle/Bali sources;
schirmer
parents:
diff changeset
  1386
apply   (simp (no_asm_s