src/HOL/MicroJava/BV/SemilatAlg.thy
author kleing
Sun, 24 Mar 2002 14:05:53 +0100
changeset 13065 d6585b32412b
parent 13062 4b1edf2f6bd2
child 13066 b57d926d1de2
permissions -rw-r--r--
more about match_exception_table
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13062
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
     1
(*  Title:      HOL/MicroJava/BV/SemilatAlg.thy
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
     2
    ID:         $Id$
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
     3
    Author:     Gerwin Klein
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
     4
    Copyright   2002 Technische Universitaet Muenchen
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
     5
*)
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
     6
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
     7
header {* \isaheader{More on Semilattices} *}
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
     8
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
     9
theory SemilatAlg = Typing_Framework + Product:
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    10
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    11
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    12
syntax "@lesubstep_type" :: "(nat \<times> 's) list \<Rightarrow> 's ord \<Rightarrow> (nat \<times> 's) list \<Rightarrow> bool"
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    13
       ("(_ /<=|_| _)" [50, 0, 51] 50)
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    14
translations
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    15
 "x <=|r| y" == "x <=[(Product.le (op =) r)] y"
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    16
 
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    17
consts
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    18
 "@plusplussub" :: "'a list \<Rightarrow> ('a \<Rightarrow> 'a \<Rightarrow> 'a) \<Rightarrow> 'a \<Rightarrow> 'a" ("(_ /++'__ _)" [65, 1000, 66] 65)
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    19
primrec
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    20
  "[] ++_f y = y"
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    21
  "(x#xs) ++_f y = xs ++_f (x +_f y)"
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    22
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    23
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    24
constdefs
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    25
 bounded :: "'s step_type \<Rightarrow> nat \<Rightarrow> bool"
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    26
"bounded step n == !p<n. !s. !(q,t):set(step p s). q<n"  
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    27
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    28
 pres_type :: "'s step_type \<Rightarrow> nat \<Rightarrow> 's set \<Rightarrow> bool"
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    29
"pres_type step n A == \<forall>s\<in>A. \<forall>p<n. \<forall>(q,s')\<in>set (step p s). s' \<in> A"
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    30
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    31
 mono :: "'s ord \<Rightarrow> 's step_type \<Rightarrow> nat \<Rightarrow> 's set \<Rightarrow> bool"
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    32
"mono r step n A ==
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    33
 \<forall>s p t. s \<in> A \<and> p < n \<and> s <=_r t \<longrightarrow> step p s <=|r| step p t"
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    34
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    35
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    36
lemma pres_typeD:
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    37
  "\<lbrakk> pres_type step n A; s\<in>A; p<n; (q,s')\<in>set (step p s) \<rbrakk> \<Longrightarrow> s' \<in> A"
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    38
  by (unfold pres_type_def, blast)
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    39
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    40
lemma monoD:
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    41
  "\<lbrakk> mono r step n A; p < n; s\<in>A; s <=_r t \<rbrakk> \<Longrightarrow> step p s <=|r| step p t"
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    42
  by (unfold mono_def, blast)
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    43
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    44
lemma boundedD: 
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    45
  "\<lbrakk> bounded step n; p < n; (q,t) : set (step p xs) \<rbrakk> \<Longrightarrow> q < n" 
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    46
  by (unfold bounded_def, blast)
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    47
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    48
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    49
lemma list_update_le_listI [rule_format]:
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    50
  "set xs <= A \<longrightarrow> set ys <= A \<longrightarrow> xs <=[r] ys \<longrightarrow> p < size xs \<longrightarrow>  
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    51
   x <=_r ys!p \<longrightarrow> semilat(A,r,f) \<longrightarrow> x\<in>A \<longrightarrow> 
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    52
   xs[p := x +_f xs!p] <=[r] ys"
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    53
  apply (unfold Listn.le_def lesub_def semilat_def)
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    54
  apply (simp add: list_all2_conv_all_nth nth_list_update)
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    55
  done
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    56
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    57
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    58
lemma plusplus_closed: 
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    59
  "\<And>y. \<lbrakk>semilat (A, r, f); set x \<subseteq> A; y \<in> A\<rbrakk> \<Longrightarrow> x ++_f y \<in> A"
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    60
proof (induct x)
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    61
  show "\<And>y. y \<in> A \<Longrightarrow> [] ++_f y \<in> A" by simp
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    62
  fix y x xs
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    63
  assume sl: "semilat (A, r, f)" and y: "y \<in> A" and xs: "set (x#xs) \<subseteq> A"
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    64
  assume IH: "\<And>y. \<lbrakk>semilat (A, r, f); set xs \<subseteq> A; y \<in> A\<rbrakk> \<Longrightarrow> xs ++_f y \<in> A"
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    65
  from xs obtain x: "x \<in> A" and "set xs \<subseteq> A" by simp  
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    66
  from sl x y have "(x +_f y) \<in> A" by (simp add: closedD)
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    67
  with sl xs have "xs ++_f (x +_f y) \<in> A" by - (rule IH)
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    68
  thus "(x#xs) ++_f y \<in> A" by simp
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    69
qed
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    70
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    71
lemma ub2: "\<And>y. \<lbrakk>semilat (A, r, f); set x \<subseteq> A; y \<in> A\<rbrakk> \<Longrightarrow> y <=_r x ++_f y"
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    72
proof (induct x)
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    73
  show "\<And>y. semilat(A, r, f) \<Longrightarrow> y <=_r [] ++_f y" by simp 
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    74
  
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    75
  fix y a l
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    76
  assume sl: "semilat (A, r, f)"
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    77
  assume y:  "y \<in> A"
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    78
  assume "set (a#l) \<subseteq> A"
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    79
  then obtain a: "a \<in> A" and x: "set l \<subseteq> A" by simp 
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    80
  assume "\<And>y. \<lbrakk>semilat (A, r, f); set l \<subseteq> A; y \<in> A\<rbrakk> \<Longrightarrow> y <=_r l ++_f y"
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    81
  hence IH: "\<And>y. y \<in> A \<Longrightarrow> y <=_r l ++_f y" .
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    82
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    83
  from sl have "order r" .. note order_trans [OF this, trans]  
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    84
  
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    85
  from sl a y have "y <=_r a +_f y" by (rule semilat_ub2)
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    86
  also
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    87
  from sl a y have "a +_f y \<in> A" by (simp add: closedD)
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    88
  hence "(a +_f y) <=_r l ++_f (a +_f y)" by (rule IH)
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    89
  finally
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    90
  have "y <=_r l ++_f (a +_f y)" .
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    91
  thus "y <=_r (a#l) ++_f y" by simp
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    92
qed
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    93
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    94
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    95
lemma ub1: 
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    96
  "\<And>y. \<lbrakk>semilat (A, r, f); set ls \<subseteq> A; y \<in> A; x \<in> set ls\<rbrakk> \<Longrightarrow> x <=_r ls ++_f y"
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    97
proof (induct ls)
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    98
  show "\<And>y. x \<in> set [] \<Longrightarrow> x <=_r [] ++_f y" by simp
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
    99
  
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   100
  fix y s ls
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   101
  assume sl: "semilat (A, r, f)" 
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   102
  hence "order r" .. note order_trans [OF this, trans]
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   103
  assume "set (s#ls) \<subseteq> A"
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   104
  then obtain s: "s \<in> A" and ls: "set ls \<subseteq> A" by simp
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   105
  assume y: "y \<in> A" 
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   106
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   107
  assume 
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   108
    "\<And>y. \<lbrakk>semilat (A, r, f); set ls \<subseteq> A; y \<in> A; x \<in> set ls\<rbrakk> \<Longrightarrow> x <=_r ls ++_f y"
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   109
  hence IH: "\<And>y. x \<in> set ls \<Longrightarrow> y \<in> A \<Longrightarrow> x <=_r ls ++_f y" .
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   110
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   111
  assume "x \<in> set (s#ls)"
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   112
  then obtain xls: "x = s \<or> x \<in> set ls" by simp
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   113
  moreover {
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   114
    assume xs: "x = s"
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   115
    from sl s y have "s <=_r s +_f y" by (rule semilat_ub1)
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   116
    also
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   117
    from sl s y have "s +_f y \<in> A" by (simp add: closedD)
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   118
    with sl ls have "(s +_f y) <=_r ls ++_f (s +_f y)" by (rule ub2)
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   119
    finally 
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   120
    have "s <=_r ls ++_f (s +_f y)" .
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   121
    with xs have "x <=_r ls ++_f (s +_f y)" by simp
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   122
  } 
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   123
  moreover {
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   124
    assume "x \<in> set ls"
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   125
    hence "\<And>y. y \<in> A \<Longrightarrow> x <=_r ls ++_f y" by (rule IH)
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   126
    moreover
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   127
    from sl s y
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   128
    have "s +_f y \<in> A" by (simp add: closedD)
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   129
    ultimately 
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   130
    have "x <=_r ls ++_f (s +_f y)" .
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   131
  }
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   132
  ultimately 
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   133
  have "x <=_r ls ++_f (s +_f y)" by blast
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   134
  thus "x <=_r (s#ls) ++_f y" by simp
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   135
qed
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   136
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   137
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   138
lemma ub1': 
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   139
  "\<lbrakk>semilat (A, r, f); \<forall>(p,s) \<in> set S. s \<in> A; y \<in> A; (a,b) \<in> set S\<rbrakk> 
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   140
  \<Longrightarrow> b <=_r map snd [(p', t')\<in>S. p' = a] ++_f y" 
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   141
proof -
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   142
  let "b <=_r ?map ++_f y" = ?thesis
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   143
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   144
  assume "semilat (A, r, f)" "y \<in> A"
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   145
  moreover
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   146
  assume "\<forall>(p,s) \<in> set S. s \<in> A"
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   147
  hence "set ?map \<subseteq> A" by auto
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   148
  moreover
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   149
  assume "(a,b) \<in> set S"
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   150
  hence "b \<in> set ?map" by (induct S, auto)
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   151
  ultimately
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   152
  show ?thesis by - (rule ub1)
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   153
qed
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   154
    
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   155
 
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   156
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   157
lemma plusplus_empty:  
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   158
  "\<forall>s'. (q, s') \<in> set S \<longrightarrow> s' +_f ss ! q = ss ! q \<Longrightarrow>
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   159
   (map snd [(p', t')\<in> S. p' = q] ++_f ss ! q) = ss ! q"
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   160
apply (induct S)
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   161
apply auto 
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   162
done
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   163
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   164
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   165
lemma lesub_step_type:
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   166
  "\<And>b x y. a <=|r| b \<Longrightarrow> (x,y) \<in> set a \<Longrightarrow> \<exists>y'. (x, y') \<in> set b \<and> y <=_r y'"
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   167
apply (induct a)
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   168
 apply simp
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   169
apply simp
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   170
apply (case_tac b)
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   171
 apply simp
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   172
apply simp
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   173
apply (erule disjE)
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   174
 apply clarify
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   175
 apply (simp add: lesub_def)
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   176
 apply blast   
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   177
apply clarify
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   178
apply blast
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   179
done
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   180
4b1edf2f6bd2 small refactoring for lbv with semilattices
kleing
parents:
diff changeset
   181
end