src/HOL/MicroJava/BV/StepMono.thy
changeset 10042 7164dc0d24d8
parent 9941 fe05af7ec816
child 10496 f2d304bdf3cc
equal deleted inserted replaced
10041:30693ebd16ae 10042:7164dc0d24d8
    12 lemma PrimT_PrimT: "(G \<turnstile> xb \<preceq> PrimT p) = (xb = PrimT p)"
    12 lemma PrimT_PrimT: "(G \<turnstile> xb \<preceq> PrimT p) = (xb = PrimT p)"
    13   by (auto elim: widen.elims)
    13   by (auto elim: widen.elims)
    14 
    14 
    15 
    15 
    16 lemma sup_loc_some [rule_format]:
    16 lemma sup_loc_some [rule_format]:
    17 "\<forall> y n. (G \<turnstile> b <=l y) \<longrightarrow> n < length y \<longrightarrow> y!n = Ok t \<longrightarrow> 
    17 "\<forall> y n. (G \<turnstile> b <=l y) --> n < length y --> y!n = Ok t --> 
    18   (\<exists>t. b!n = Ok t \<and> (G \<turnstile> (b!n) <=o (y!n)))" (is "?P b")
    18   (\<exists>t. b!n = Ok t \<and> (G \<turnstile> (b!n) <=o (y!n)))" (is "?P b")
    19 proof (induct (open) ?P b)
    19 proof (induct (open) ?P b)
    20   show "?P []" by simp
    20   show "?P []" by simp
    21 
    21 
    22   case Cons
    22   case Cons
    39   qed
    39   qed
    40 qed
    40 qed
    41    
    41    
    42 
    42 
    43 lemma all_widen_is_sup_loc:
    43 lemma all_widen_is_sup_loc:
    44 "\<forall>b. length a = length b \<longrightarrow> 
    44 "\<forall>b. length a = length b --> 
    45      (\<forall>x\<in>set (zip a b). x \<in> widen G) = (G \<turnstile> (map Ok a) <=l (map Ok b))" 
    45      (\<forall>x\<in>set (zip a b). x \<in> widen G) = (G \<turnstile> (map Ok a) <=l (map Ok b))" 
    46  (is "\<forall>b. length a = length b \<longrightarrow> ?Q a b" is "?P a")
    46  (is "\<forall>b. length a = length b --> ?Q a b" is "?P a")
    47 proof (induct "a")
    47 proof (induct "a")
    48   show "?P []" by simp
    48   show "?P []" by simp
    49 
    49 
    50   fix l ls assume Cons: "?P ls"
    50   fix l ls assume Cons: "?P ls"
    51 
    51 
    58   qed
    58   qed
    59 qed
    59 qed
    60  
    60  
    61 
    61 
    62 lemma append_length_n [rule_format]: 
    62 lemma append_length_n [rule_format]: 
    63 "\<forall>n. n \<le> length x \<longrightarrow> (\<exists>a b. x = a@b \<and> length a = n)" (is "?P x")
    63 "\<forall>n. n \<le> length x --> (\<exists>a b. x = a@b \<and> length a = n)" (is "?P x")
    64 proof (induct (open) ?P x)
    64 proof (induct (open) ?P x)
    65   show "?P []" by simp
    65   show "?P []" by simp
    66 
    66 
    67   fix l ls assume Cons: "?P ls"
    67   fix l ls assume Cons: "?P ls"
    68 
    68 
    92 qed
    92 qed
    93 
    93 
    94 
    94 
    95 
    95 
    96 lemma rev_append_cons:
    96 lemma rev_append_cons:
    97 "\<lbrakk>n < length x\<rbrakk> \<Longrightarrow> \<exists>a b c. x = (rev a) @ b # c \<and> length a = n"
    97 "[|n < length x|] ==> \<exists>a b c. x = (rev a) @ b # c \<and> length a = n"
    98 proof -
    98 proof -
    99   assume n: "n < length x"
    99   assume n: "n < length x"
   100   hence "n \<le> length x" by simp
   100   hence "n \<le> length x" by simp
   101   hence "\<exists>a b. x = a @ b \<and> length a = n" by (rule append_length_n)
   101   hence "\<exists>a b. x = a @ b \<and> length a = n" by (rule append_length_n)
   102   thus ?thesis
   102   thus ?thesis
   116   qed
   116   qed
   117 qed
   117 qed
   118 
   118 
   119 
   119 
   120 lemma app_mono: 
   120 lemma app_mono: 
   121 "\<lbrakk>G \<turnstile> s <=' s'; app i G rT s'\<rbrakk> \<Longrightarrow> app i G rT s";
   121 "[|G \<turnstile> s <=' s'; app i G rT s'|] ==> app i G rT s";
   122 proof -
   122 proof -
   123 
   123 
   124   { fix s1 s2
   124   { fix s1 s2
   125     assume G:   "G \<turnstile> s2 <=s s1"
   125     assume G:   "G \<turnstile> s2 <=s s1"
   126     assume app: "app i G rT (Some s1)"
   126     assume app: "app i G rT (Some s1)"