src/HOL/MicroJava/BV/StepMono.thy
author kleing
Mon, 20 Nov 2000 16:37:42 +0100
changeset 10496 f2d304bdf3cc
parent 10042 7164dc0d24d8
child 10592 fc0b575a2cf7
permissions -rw-r--r--
BCV integration (first step)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9580
kleing
parents: 9559
diff changeset
     1
(*  Title:      HOL/MicroJava/BV/StepMono.thy
9559
kleing
parents:
diff changeset
     2
    ID:         $Id$
kleing
parents:
diff changeset
     3
    Author:     Gerwin Klein
kleing
parents:
diff changeset
     4
    Copyright   2000 Technische Universitaet Muenchen
kleing
parents:
diff changeset
     5
*)
kleing
parents:
diff changeset
     6
9594
42d11e0a7a8b Convert.thy now in Isar, tuned
kleing
parents: 9585
diff changeset
     7
header {* Monotonicity of step and app *}
9559
kleing
parents:
diff changeset
     8
9594
42d11e0a7a8b Convert.thy now in Isar, tuned
kleing
parents: 9585
diff changeset
     9
theory StepMono = Step:
9559
kleing
parents:
diff changeset
    10
kleing
parents:
diff changeset
    11
9580
kleing
parents: 9559
diff changeset
    12
lemma PrimT_PrimT: "(G \<turnstile> xb \<preceq> PrimT p) = (xb = PrimT p)"
9594
42d11e0a7a8b Convert.thy now in Isar, tuned
kleing
parents: 9585
diff changeset
    13
  by (auto elim: widen.elims)
9559
kleing
parents:
diff changeset
    14
kleing
parents:
diff changeset
    15
9941
fe05af7ec816 renamed atts: rulify to rule_format, elimify to elim_format;
wenzelm
parents: 9906
diff changeset
    16
lemma sup_loc_some [rule_format]:
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents: 10042
diff changeset
    17
"\<forall> y n. (G \<turnstile> b <=l y) --> n < length y --> y!n = OK t --> 
f2d304bdf3cc BCV integration (first step)
kleing
parents: 10042
diff changeset
    18
  (\<exists>t. b!n = OK t \<and> (G \<turnstile> (b!n) <=o (y!n)))" (is "?P b")
9664
4cae97480a6d open cases;
wenzelm
parents: 9594
diff changeset
    19
proof (induct (open) ?P b)
9559
kleing
parents:
diff changeset
    20
  show "?P []" by simp
kleing
parents:
diff changeset
    21
kleing
parents:
diff changeset
    22
  case Cons
kleing
parents:
diff changeset
    23
  show "?P (a#list)"
kleing
parents:
diff changeset
    24
  proof (clarsimp simp add: list_all2_Cons1 sup_loc_def)
kleing
parents:
diff changeset
    25
    fix z zs n
kleing
parents:
diff changeset
    26
    assume * : 
9580
kleing
parents: 9559
diff changeset
    27
      "G \<turnstile> a <=o z" "list_all2 (sup_ty_opt G) list zs" 
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents: 10042
diff changeset
    28
      "n < Suc (length zs)" "(z # zs) ! n = OK t"
9559
kleing
parents:
diff changeset
    29
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents: 10042
diff changeset
    30
    show "(\<exists>t. (a # list) ! n = OK t) \<and> G \<turnstile>(a # list) ! n <=o OK t" 
9559
kleing
parents:
diff changeset
    31
    proof (cases n) 
kleing
parents:
diff changeset
    32
      case 0
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents: 10042
diff changeset
    33
      with * show ?thesis by (simp add: sup_ty_opt_OK)
9559
kleing
parents:
diff changeset
    34
    next
kleing
parents:
diff changeset
    35
      case Suc
kleing
parents:
diff changeset
    36
      with Cons *
kleing
parents:
diff changeset
    37
      show ?thesis by (simp add: sup_loc_def)
kleing
parents:
diff changeset
    38
    qed
kleing
parents:
diff changeset
    39
  qed
kleing
parents:
diff changeset
    40
qed
kleing
parents:
diff changeset
    41
   
kleing
parents:
diff changeset
    42
kleing
parents:
diff changeset
    43
lemma all_widen_is_sup_loc:
10042
7164dc0d24d8 unsymbolized
kleing
parents: 9941
diff changeset
    44
"\<forall>b. length a = length b --> 
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents: 10042
diff changeset
    45
     (\<forall>x\<in>set (zip a b). x \<in> widen G) = (G \<turnstile> (map OK a) <=l (map OK b))" 
10042
7164dc0d24d8 unsymbolized
kleing
parents: 9941
diff changeset
    46
 (is "\<forall>b. length a = length b --> ?Q a b" is "?P a")
9559
kleing
parents:
diff changeset
    47
proof (induct "a")
kleing
parents:
diff changeset
    48
  show "?P []" by simp
kleing
parents:
diff changeset
    49
kleing
parents:
diff changeset
    50
  fix l ls assume Cons: "?P ls"
kleing
parents:
diff changeset
    51
kleing
parents:
diff changeset
    52
  show "?P (l#ls)" 
kleing
parents:
diff changeset
    53
  proof (intro allI impI)
kleing
parents:
diff changeset
    54
    fix b 
kleing
parents:
diff changeset
    55
    assume "length (l # ls) = length (b::ty list)" 
kleing
parents:
diff changeset
    56
    with Cons
kleing
parents:
diff changeset
    57
    show "?Q (l # ls) b" by - (cases b, auto)
kleing
parents:
diff changeset
    58
  qed
kleing
parents:
diff changeset
    59
qed
kleing
parents:
diff changeset
    60
 
kleing
parents:
diff changeset
    61
9941
fe05af7ec816 renamed atts: rulify to rule_format, elimify to elim_format;
wenzelm
parents: 9906
diff changeset
    62
lemma append_length_n [rule_format]: 
10042
7164dc0d24d8 unsymbolized
kleing
parents: 9941
diff changeset
    63
"\<forall>n. n \<le> length x --> (\<exists>a b. x = a@b \<and> length a = n)" (is "?P x")
9664
4cae97480a6d open cases;
wenzelm
parents: 9594
diff changeset
    64
proof (induct (open) ?P x)
9559
kleing
parents:
diff changeset
    65
  show "?P []" by simp
kleing
parents:
diff changeset
    66
kleing
parents:
diff changeset
    67
  fix l ls assume Cons: "?P ls"
kleing
parents:
diff changeset
    68
kleing
parents:
diff changeset
    69
  show "?P (l#ls)"
kleing
parents:
diff changeset
    70
  proof (intro allI impI)
kleing
parents:
diff changeset
    71
    fix n
9580
kleing
parents: 9559
diff changeset
    72
    assume l: "n \<le> length (l # ls)"
9559
kleing
parents:
diff changeset
    73
9580
kleing
parents: 9559
diff changeset
    74
    show "\<exists>a b. l # ls = a @ b \<and> length a = n" 
9559
kleing
parents:
diff changeset
    75
    proof (cases n)
kleing
parents:
diff changeset
    76
      assume "n=0" thus ?thesis by simp
kleing
parents:
diff changeset
    77
    next
kleing
parents:
diff changeset
    78
      fix "n'" assume s: "n = Suc n'"
kleing
parents:
diff changeset
    79
      with l 
9580
kleing
parents: 9559
diff changeset
    80
      have  "n' \<le> length ls" by simp 
9941
fe05af7ec816 renamed atts: rulify to rule_format, elimify to elim_format;
wenzelm
parents: 9906
diff changeset
    81
      hence "\<exists>a b. ls = a @ b \<and> length a = n'" by (rule Cons [rule_format])
9559
kleing
parents:
diff changeset
    82
      thus ?thesis
kleing
parents:
diff changeset
    83
      proof elim
kleing
parents:
diff changeset
    84
        fix a b 
kleing
parents:
diff changeset
    85
        assume "ls = a @ b" "length a = n'"
kleing
parents:
diff changeset
    86
        with s
9580
kleing
parents: 9559
diff changeset
    87
        have "l # ls = (l#a) @ b \<and> length (l#a) = n" by simp
9559
kleing
parents:
diff changeset
    88
        thus ?thesis by blast
kleing
parents:
diff changeset
    89
      qed
kleing
parents:
diff changeset
    90
    qed
kleing
parents:
diff changeset
    91
  qed
kleing
parents:
diff changeset
    92
qed
kleing
parents:
diff changeset
    93
kleing
parents:
diff changeset
    94
kleing
parents:
diff changeset
    95
kleing
parents:
diff changeset
    96
lemma rev_append_cons:
10042
7164dc0d24d8 unsymbolized
kleing
parents: 9941
diff changeset
    97
"[|n < length x|] ==> \<exists>a b c. x = (rev a) @ b # c \<and> length a = n"
9559
kleing
parents:
diff changeset
    98
proof -
kleing
parents:
diff changeset
    99
  assume n: "n < length x"
9580
kleing
parents: 9559
diff changeset
   100
  hence "n \<le> length x" by simp
kleing
parents: 9559
diff changeset
   101
  hence "\<exists>a b. x = a @ b \<and> length a = n" by (rule append_length_n)
9559
kleing
parents:
diff changeset
   102
  thus ?thesis
kleing
parents:
diff changeset
   103
  proof elim
kleing
parents:
diff changeset
   104
    fix r d assume x: "x = r@d" "length r = n"
kleing
parents:
diff changeset
   105
    with n
9580
kleing
parents: 9559
diff changeset
   106
    have "\<exists>b c. d = b#c" by (simp add: neq_Nil_conv)
9559
kleing
parents:
diff changeset
   107
    
kleing
parents:
diff changeset
   108
    thus ?thesis 
kleing
parents:
diff changeset
   109
    proof elim
kleing
parents:
diff changeset
   110
      fix b c 
kleing
parents:
diff changeset
   111
      assume "d = b#c"
kleing
parents:
diff changeset
   112
      with x
9580
kleing
parents: 9559
diff changeset
   113
      have "x = (rev (rev r)) @ b # c \<and> length (rev r) = n" by simp
9559
kleing
parents:
diff changeset
   114
      thus ?thesis by blast
kleing
parents:
diff changeset
   115
    qed
kleing
parents:
diff changeset
   116
  qed
kleing
parents:
diff changeset
   117
qed
kleing
parents:
diff changeset
   118
kleing
parents:
diff changeset
   119
kleing
parents:
diff changeset
   120
lemma app_mono: 
10042
7164dc0d24d8 unsymbolized
kleing
parents: 9941
diff changeset
   121
"[|G \<turnstile> s <=' s'; app i G rT s'|] ==> app i G rT s";
9559
kleing
parents:
diff changeset
   122
proof -
kleing
parents:
diff changeset
   123
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   124
  { fix s1 s2
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   125
    assume G:   "G \<turnstile> s2 <=s s1"
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   126
    assume app: "app i G rT (Some s1)"
9559
kleing
parents:
diff changeset
   127
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   128
    have "app i G rT (Some s2)"
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   129
    proof (cases (open) i)
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   130
      case Load
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   131
    
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   132
      from G
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   133
      have l: "length (snd s1) = length (snd s2)" by (simp add: sup_state_length)
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   134
      
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   135
      from G Load app
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   136
      have "G \<turnstile> snd s2 <=l snd s1" by (auto simp add: sup_state_def)
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   137
      
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   138
      with G Load app l
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   139
      show ?thesis by clarsimp (drule sup_loc_some, simp+)
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   140
    next
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   141
      case Store
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   142
      with G app
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   143
      show ?thesis
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   144
        by - (cases s2,
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   145
              auto simp add: map_eq_Cons sup_loc_Cons2 sup_loc_length sup_state_def)
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   146
    next
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   147
      case Bipush
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   148
      thus ?thesis by simp 
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   149
    next
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   150
      case Aconst_null
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   151
      thus ?thesis by simp
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   152
    next
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   153
      case New
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   154
      with app
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   155
      show ?thesis by simp
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   156
    next
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   157
      case Getfield
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   158
      with app G
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   159
      show ?thesis
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   160
        by - (cases s2, clarsimp simp add: sup_state_Cons2, rule widen_trans)
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   161
    next
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   162
      case Putfield
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   163
      
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   164
      with app 
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   165
      obtain vT oT ST LT b
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   166
        where s1: "s1 = (vT # oT # ST, LT)" and
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   167
                  "field (G, cname) vname = Some (cname, b)" 
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   168
                  "is_class G cname" and
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   169
              oT: "G\<turnstile> oT\<preceq> (Class cname)" and
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   170
              vT: "G\<turnstile> vT\<preceq> b"
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   171
        by simp (elim exE conjE, rule that) 
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   172
      moreover
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   173
      from s1 G
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   174
      obtain vT' oT' ST' LT'
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   175
        where s2:  "s2 = (vT' # oT' # ST', LT')" and
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   176
              oT': "G\<turnstile> oT' \<preceq> oT" and
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   177
              vT': "G\<turnstile> vT' \<preceq> vT"
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   178
        by - (cases s2, simp add: sup_state_Cons2, elim exE conjE, simp, rule that)
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   179
      moreover
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   180
      from vT' vT
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   181
      have "G \<turnstile> vT' \<preceq> b" by (rule widen_trans)
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   182
      moreover
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   183
      from oT' oT
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   184
      have "G\<turnstile> oT' \<preceq> (Class cname)" by (rule widen_trans)
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   185
      ultimately
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   186
      show ?thesis
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   187
        by (auto simp add: Putfield)
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   188
    next
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   189
      case Checkcast
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   190
      with app G
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   191
      show ?thesis 
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   192
        by - (cases s2, auto intro!: widen_RefT2 simp add: sup_state_Cons2)
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   193
    next
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   194
      case Return
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   195
      with app G
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   196
      show ?thesis
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   197
        by - (cases s2, auto simp add: sup_state_Cons2, rule widen_trans)
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   198
    next
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   199
      case Pop
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   200
      with app G
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   201
      show ?thesis
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   202
        by - (cases s2, clarsimp simp add: sup_state_Cons2)
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   203
    next
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   204
      case Dup
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   205
      with app G
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   206
      show ?thesis
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   207
        by - (cases s2, clarsimp simp add: sup_state_Cons2)
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   208
    next
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   209
      case Dup_x1
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   210
      with app G
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   211
      show ?thesis
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   212
        by - (cases s2, clarsimp simp add: sup_state_Cons2)
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   213
    next
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   214
      case Dup_x2
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   215
      with app G
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   216
      show ?thesis
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   217
        by - (cases s2, clarsimp simp add: sup_state_Cons2)
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   218
    next
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   219
      case Swap
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   220
      with app G
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   221
      show ?thesis
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   222
        by - (cases s2, clarsimp simp add: sup_state_Cons2)
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   223
    next
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   224
      case IAdd
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   225
      with app G
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   226
      show ?thesis
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   227
        by - (cases s2, auto simp add: sup_state_Cons2 PrimT_PrimT)
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   228
    next
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   229
      case Goto 
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   230
      with app
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   231
      show ?thesis by simp
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   232
    next
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   233
      case Ifcmpeq
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   234
      with app G
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   235
      show ?thesis
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   236
        by - (cases s2, auto simp add: sup_state_Cons2 PrimT_PrimT widen_RefT2)
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   237
    next
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   238
      case Invoke
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   239
      
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   240
      with app
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   241
      obtain apTs X ST LT mD' rT' b' where
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   242
        s1: "s1 = (rev apTs @ X # ST, LT)" and
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   243
        l:  "length apTs = length list" and
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   244
        C:  "G \<turnstile> X \<preceq> Class cname" and
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   245
        w:  "\<forall>x \<in> set (zip apTs list). x \<in> widen G" and
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   246
        m:  "method (G, cname) (mname, list) = Some (mD', rT', b')"
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   247
        by (simp, elim exE conjE) (rule that)
9559
kleing
parents:
diff changeset
   248
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   249
      obtain apTs' X' ST' LT' where
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   250
        s2: "s2 = (rev apTs' @ X' # ST', LT')" and
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   251
        l': "length apTs' = length list"
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   252
      proof -
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   253
        from l s1 G 
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   254
        have "length list < length (fst s2)" 
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   255
          by (simp add: sup_state_length)
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   256
        hence "\<exists>a b c. (fst s2) = rev a @ b # c \<and> length a = length list"
9941
fe05af7ec816 renamed atts: rulify to rule_format, elimify to elim_format;
wenzelm
parents: 9906
diff changeset
   257
          by (rule rev_append_cons [rule_format])
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   258
        thus ?thesis
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   259
          by -  (cases s2, elim exE conjE, simp, rule that) 
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   260
      qed
9559
kleing
parents:
diff changeset
   261
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   262
      from l l'
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   263
      have "length (rev apTs') = length (rev apTs)" by simp
9559
kleing
parents:
diff changeset
   264
    
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   265
      from this s1 s2 G 
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   266
      obtain
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   267
        G': "G \<turnstile> (apTs',LT') <=s (apTs,LT)" and
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   268
        X : "G \<turnstile>  X' \<preceq> X" and "G \<turnstile> (ST',LT') <=s (ST,LT)"
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   269
        by (simp add: sup_state_rev_fst sup_state_append_fst sup_state_Cons1)
9559
kleing
parents:
diff changeset
   270
        
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   271
      with C
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   272
      have C': "G \<turnstile> X' \<preceq> Class cname"
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   273
        by - (rule widen_trans, auto)
9559
kleing
parents:
diff changeset
   274
    
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   275
      from G'
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents: 10042
diff changeset
   276
      have "G \<turnstile> map OK apTs' <=l map OK apTs"
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   277
        by (simp add: sup_state_def)
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   278
      also
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   279
      from l w
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents: 10042
diff changeset
   280
      have "G \<turnstile> map OK apTs <=l map OK list" 
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   281
        by (simp add: all_widen_is_sup_loc)
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   282
      finally
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents: 10042
diff changeset
   283
      have "G \<turnstile> map OK apTs' <=l map OK list" .
9559
kleing
parents:
diff changeset
   284
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   285
      with l'
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   286
      have w': "\<forall>x \<in> set (zip apTs' list). x \<in> widen G"
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   287
        by (simp add: all_widen_is_sup_loc)
9559
kleing
parents:
diff changeset
   288
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   289
      from Invoke s2 l' w' C' m
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   290
      show ?thesis 
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   291
        by simp blast
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   292
    qed
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   293
  } note mono_Some = this
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   294
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   295
  assume "G \<turnstile> s <=' s'" "app i G rT s'"
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   296
  
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   297
  thus ?thesis 
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   298
    by - (cases s, cases s', auto simp add: mono_Some)
9559
kleing
parents:
diff changeset
   299
qed
kleing
parents:
diff changeset
   300
    
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   301
lemmas [simp del] = split_paired_Ex
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   302
lemmas [simp] = step_def
9559
kleing
parents:
diff changeset
   303
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   304
lemma step_mono_Some:
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents: 10042
diff changeset
   305
"[| app i G rT (Some s2); G \<turnstile> s1 <=s s2 |] ==>
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   306
  G \<turnstile> the (step i G (Some s1)) <=s the (step i G (Some s2))"
9559
kleing
parents:
diff changeset
   307
proof (cases s1, cases s2) 
kleing
parents:
diff changeset
   308
  fix a1 b1 a2 b2
kleing
parents:
diff changeset
   309
  assume s: "s1 = (a1,b1)" "s2 = (a2,b2)"
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   310
  assume app2: "app i G rT (Some s2)"
9580
kleing
parents: 9559
diff changeset
   311
  assume G: "G \<turnstile> s1 <=s s2"
9559
kleing
parents:
diff changeset
   312
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   313
  hence "G \<turnstile> Some s1 <=' Some s2" 
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   314
    by simp
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   315
  from this app2
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   316
  have app1: "app i G rT (Some s1)" by (rule app_mono)
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   317
  
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   318
  have "step i G (Some s1) \<noteq> None \<and> step i G (Some s2) \<noteq> None"
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   319
    by simp
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   320
  then 
9559
kleing
parents:
diff changeset
   321
  obtain a1' b1' a2' b2'
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   322
    where step: "step i G (Some s1) = Some (a1',b1')" 
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   323
                "step i G (Some s2) = Some (a2',b2')"
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   324
    by (auto simp del: step_def simp add: s)
9559
kleing
parents:
diff changeset
   325
9580
kleing
parents: 9559
diff changeset
   326
  have "G \<turnstile> (a1',b1') <=s (a2',b2')"
9664
4cae97480a6d open cases;
wenzelm
parents: 9594
diff changeset
   327
  proof (cases (open) i)
9559
kleing
parents:
diff changeset
   328
    case Load
kleing
parents:
diff changeset
   329
kleing
parents:
diff changeset
   330
    with s app1
kleing
parents:
diff changeset
   331
    obtain y where
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents: 10042
diff changeset
   332
       y:  "nat < length b1" "b1 ! nat = OK y" by clarsimp
9559
kleing
parents:
diff changeset
   333
kleing
parents:
diff changeset
   334
    from Load s app2
kleing
parents:
diff changeset
   335
    obtain y' where
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents: 10042
diff changeset
   336
       y': "nat < length b2" "b2 ! nat = OK y'" by clarsimp
9559
kleing
parents:
diff changeset
   337
kleing
parents:
diff changeset
   338
    from G s 
9580
kleing
parents: 9559
diff changeset
   339
    have "G \<turnstile> b1 <=l b2" by (simp add: sup_state_def)
9559
kleing
parents:
diff changeset
   340
kleing
parents:
diff changeset
   341
    with y y'
9580
kleing
parents: 9559
diff changeset
   342
    have "G \<turnstile> y \<preceq> y'" 
9559
kleing
parents:
diff changeset
   343
      by - (drule sup_loc_some, simp+)
kleing
parents:
diff changeset
   344
    
kleing
parents:
diff changeset
   345
    with Load G y y' s step app1 app2 
kleing
parents:
diff changeset
   346
    show ?thesis by (clarsimp simp add: sup_state_def)
kleing
parents:
diff changeset
   347
  next
kleing
parents:
diff changeset
   348
    case Store
kleing
parents:
diff changeset
   349
    with G s step app1 app2
kleing
parents:
diff changeset
   350
    show ?thesis
kleing
parents:
diff changeset
   351
      by (clarsimp simp add: sup_state_def sup_loc_update)
kleing
parents:
diff changeset
   352
  next
kleing
parents:
diff changeset
   353
    case Bipush
kleing
parents:
diff changeset
   354
    with G s step app1 app2
kleing
parents:
diff changeset
   355
    show ?thesis
kleing
parents:
diff changeset
   356
      by (clarsimp simp add: sup_state_Cons1)
kleing
parents:
diff changeset
   357
  next
kleing
parents:
diff changeset
   358
    case New
kleing
parents:
diff changeset
   359
    with G s step app1 app2
kleing
parents:
diff changeset
   360
    show ?thesis
kleing
parents:
diff changeset
   361
      by (clarsimp simp add: sup_state_Cons1)
kleing
parents:
diff changeset
   362
  next
kleing
parents:
diff changeset
   363
    case Aconst_null
kleing
parents:
diff changeset
   364
    with G s step app1 app2
kleing
parents:
diff changeset
   365
    show ?thesis
kleing
parents:
diff changeset
   366
      by (clarsimp simp add: sup_state_Cons1)
kleing
parents:
diff changeset
   367
  next
kleing
parents:
diff changeset
   368
    case Getfield
kleing
parents:
diff changeset
   369
    with G s step app1 app2
kleing
parents:
diff changeset
   370
    show ?thesis
kleing
parents:
diff changeset
   371
      by (clarsimp simp add: sup_state_Cons1)
kleing
parents:
diff changeset
   372
  next
kleing
parents:
diff changeset
   373
    case Putfield
kleing
parents:
diff changeset
   374
    with G s step app1 app2
kleing
parents:
diff changeset
   375
    show ?thesis
kleing
parents:
diff changeset
   376
      by (clarsimp simp add: sup_state_Cons1)
kleing
parents:
diff changeset
   377
  next
kleing
parents:
diff changeset
   378
    case Checkcast
kleing
parents:
diff changeset
   379
    with G s step app1 app2
kleing
parents:
diff changeset
   380
    show ?thesis
kleing
parents:
diff changeset
   381
      by (clarsimp simp add: sup_state_Cons1)
kleing
parents:
diff changeset
   382
  next
kleing
parents:
diff changeset
   383
    case Invoke
kleing
parents:
diff changeset
   384
kleing
parents:
diff changeset
   385
    with s app1
kleing
parents:
diff changeset
   386
    obtain a X ST where
kleing
parents:
diff changeset
   387
      s1: "s1 = (a @ X # ST, b1)" and
kleing
parents:
diff changeset
   388
      l:  "length a = length list"
kleing
parents:
diff changeset
   389
      by (simp, elim exE conjE, simp)
kleing
parents:
diff changeset
   390
kleing
parents:
diff changeset
   391
    from Invoke s app2
kleing
parents:
diff changeset
   392
    obtain a' X' ST' where
kleing
parents:
diff changeset
   393
      s2: "s2 = (a' @ X' # ST', b2)" and
kleing
parents:
diff changeset
   394
      l': "length a' = length list"
kleing
parents:
diff changeset
   395
      by (simp, elim exE conjE, simp)
kleing
parents:
diff changeset
   396
kleing
parents:
diff changeset
   397
    from l l'
kleing
parents:
diff changeset
   398
    have lr: "length a = length a'" by simp
kleing
parents:
diff changeset
   399
      
kleing
parents:
diff changeset
   400
    from lr G s s1 s2 
9580
kleing
parents: 9559
diff changeset
   401
    have "G \<turnstile> (ST, b1) <=s (ST', b2)"
9559
kleing
parents:
diff changeset
   402
      by (simp add: sup_state_append_fst sup_state_Cons1)
kleing
parents:
diff changeset
   403
    
kleing
parents:
diff changeset
   404
    moreover
kleing
parents:
diff changeset
   405
    
kleing
parents:
diff changeset
   406
    from Invoke G s step app1 app2
9580
kleing
parents: 9559
diff changeset
   407
    have "b1 = b1' \<and> b2 = b2'" by simp
9559
kleing
parents:
diff changeset
   408
kleing
parents:
diff changeset
   409
    ultimately 
kleing
parents:
diff changeset
   410
9580
kleing
parents: 9559
diff changeset
   411
    have "G \<turnstile> (ST, b1') <=s (ST', b2')" by simp
9559
kleing
parents:
diff changeset
   412
kleing
parents:
diff changeset
   413
    with Invoke G s step app1 app2 s1 s2 l l'
kleing
parents:
diff changeset
   414
    show ?thesis 
kleing
parents:
diff changeset
   415
      by (clarsimp simp add: sup_state_def)
kleing
parents:
diff changeset
   416
  next
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents: 10042
diff changeset
   417
    case Return 
f2d304bdf3cc BCV integration (first step)
kleing
parents: 10042
diff changeset
   418
    with G step
f2d304bdf3cc BCV integration (first step)
kleing
parents: 10042
diff changeset
   419
    show ?thesis
f2d304bdf3cc BCV integration (first step)
kleing
parents: 10042
diff changeset
   420
      by simp
9559
kleing
parents:
diff changeset
   421
  next
kleing
parents:
diff changeset
   422
    case Pop
kleing
parents:
diff changeset
   423
    with G s step app1 app2
kleing
parents:
diff changeset
   424
    show ?thesis
kleing
parents:
diff changeset
   425
      by (clarsimp simp add: sup_state_Cons1)
kleing
parents:
diff changeset
   426
  next
kleing
parents:
diff changeset
   427
    case Dup
kleing
parents:
diff changeset
   428
    with G s step app1 app2
kleing
parents:
diff changeset
   429
    show ?thesis
kleing
parents:
diff changeset
   430
      by (clarsimp simp add: sup_state_Cons1)
kleing
parents:
diff changeset
   431
  next
kleing
parents:
diff changeset
   432
    case Dup_x1
kleing
parents:
diff changeset
   433
    with G s step app1 app2
kleing
parents:
diff changeset
   434
    show ?thesis
kleing
parents:
diff changeset
   435
      by (clarsimp simp add: sup_state_Cons1)
kleing
parents:
diff changeset
   436
  next 
kleing
parents:
diff changeset
   437
    case Dup_x2
kleing
parents:
diff changeset
   438
    with G s step app1 app2
kleing
parents:
diff changeset
   439
    show ?thesis
kleing
parents:
diff changeset
   440
      by (clarsimp simp add: sup_state_Cons1)
kleing
parents:
diff changeset
   441
  next
kleing
parents:
diff changeset
   442
    case Swap
kleing
parents:
diff changeset
   443
    with G s step app1 app2
kleing
parents:
diff changeset
   444
    show ?thesis
kleing
parents:
diff changeset
   445
      by (clarsimp simp add: sup_state_Cons1)
kleing
parents:
diff changeset
   446
  next
kleing
parents:
diff changeset
   447
    case IAdd
kleing
parents:
diff changeset
   448
    with G s step app1 app2
kleing
parents:
diff changeset
   449
    show ?thesis
kleing
parents:
diff changeset
   450
      by (clarsimp simp add: sup_state_Cons1)
kleing
parents:
diff changeset
   451
  next
kleing
parents:
diff changeset
   452
    case Goto
kleing
parents:
diff changeset
   453
    with G s step app1 app2
kleing
parents:
diff changeset
   454
    show ?thesis by simp
kleing
parents:
diff changeset
   455
  next
kleing
parents:
diff changeset
   456
    case Ifcmpeq
kleing
parents:
diff changeset
   457
    with G s step app1 app2
kleing
parents:
diff changeset
   458
    show ?thesis
kleing
parents:
diff changeset
   459
      by (clarsimp simp add: sup_state_Cons1)   
kleing
parents:
diff changeset
   460
  qed
kleing
parents:
diff changeset
   461
kleing
parents:
diff changeset
   462
  with step
kleing
parents:
diff changeset
   463
  show ?thesis by auto  
kleing
parents:
diff changeset
   464
qed
kleing
parents:
diff changeset
   465
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   466
lemma step_mono:
10496
f2d304bdf3cc BCV integration (first step)
kleing
parents: 10042
diff changeset
   467
  "[| app i G rT s2; G \<turnstile> s1 <=' s2 |] ==>
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   468
  G \<turnstile> step i G s1 <=' step i G s2"
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   469
  by (cases s1, cases s2, auto dest: step_mono_Some)
9559
kleing
parents:
diff changeset
   470
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   471
lemmas [simp del] = step_def
9559
kleing
parents:
diff changeset
   472
kleing
parents:
diff changeset
   473
end
9757
1024a2d80ac0 functional LBV style, dead code, type safety -> Isar
kleing
parents: 9664
diff changeset
   474