src/HOL/MicroJava/DFA/SemilatAlg.thy
changeset 61994 133a8a888ae8
parent 61361 8b5f00202e1a
child 67613 ce654b0e6d69
equal deleted inserted replaced
61993:89206877f0ee 61994:133a8a888ae8
     8 theory SemilatAlg
     8 theory SemilatAlg
     9 imports Typing_Framework Product
     9 imports Typing_Framework Product
    10 begin
    10 begin
    11 
    11 
    12 definition lesubstep_type :: "(nat \<times> 's) list \<Rightarrow> 's ord \<Rightarrow> (nat \<times> 's) list \<Rightarrow> bool"
    12 definition lesubstep_type :: "(nat \<times> 's) list \<Rightarrow> 's ord \<Rightarrow> (nat \<times> 's) list \<Rightarrow> bool"
    13                     ("(_ /<=|_| _)" [50, 0, 51] 50) where
    13                     ("(_ /\<le>|_| _)" [50, 0, 51] 50) where
    14   "x <=|r| y \<equiv> \<forall>(p,s) \<in> set x. \<exists>s'. (p,s') \<in> set y \<and> s <=_r s'"
    14   "x \<le>|r| y \<equiv> \<forall>(p,s) \<in> set x. \<exists>s'. (p,s') \<in> set y \<and> s <=_r s'"
    15 
    15 
    16 primrec plusplussub :: "'a list \<Rightarrow> ('a \<Rightarrow> 'a \<Rightarrow> 'a) \<Rightarrow> 'a \<Rightarrow> 'a" ("(_ /++'__ _)" [65, 1000, 66] 65) where
    16 primrec plusplussub :: "'a list \<Rightarrow> ('a \<Rightarrow> 'a \<Rightarrow> 'a) \<Rightarrow> 'a \<Rightarrow> 'a" ("(_ /++'__ _)" [65, 1000, 66] 65) where
    17   "[] ++_f y = y"
    17   "[] ++_f y = y"
    18 | "(x#xs) ++_f y = xs ++_f (x +_f y)"
    18 | "(x#xs) ++_f y = xs ++_f (x +_f y)"
    19 
    19 
    23 definition pres_type :: "'s step_type \<Rightarrow> nat \<Rightarrow> 's set \<Rightarrow> bool" where
    23 definition pres_type :: "'s step_type \<Rightarrow> nat \<Rightarrow> 's set \<Rightarrow> bool" where
    24 "pres_type step n A == \<forall>s\<in>A. \<forall>p<n. \<forall>(q,s')\<in>set (step p s). s' \<in> A"
    24 "pres_type step n A == \<forall>s\<in>A. \<forall>p<n. \<forall>(q,s')\<in>set (step p s). s' \<in> A"
    25 
    25 
    26 definition mono :: "'s ord \<Rightarrow> 's step_type \<Rightarrow> nat \<Rightarrow> 's set \<Rightarrow> bool" where
    26 definition mono :: "'s ord \<Rightarrow> 's step_type \<Rightarrow> nat \<Rightarrow> 's set \<Rightarrow> bool" where
    27 "mono r step n A ==
    27 "mono r step n A ==
    28  \<forall>s p t. s \<in> A \<and> p < n \<and> s <=_r t \<longrightarrow> step p s <=|r| step p t"
    28  \<forall>s p t. s \<in> A \<and> p < n \<and> s <=_r t \<longrightarrow> step p s \<le>|r| step p t"
    29 
    29 
    30 lemma pres_typeD:
    30 lemma pres_typeD:
    31   "\<lbrakk> pres_type step n A; s\<in>A; p<n; (q,s')\<in>set (step p s) \<rbrakk> \<Longrightarrow> s' \<in> A"
    31   "\<lbrakk> pres_type step n A; s\<in>A; p<n; (q,s')\<in>set (step p s) \<rbrakk> \<Longrightarrow> s' \<in> A"
    32   by (unfold pres_type_def, blast)
    32   by (unfold pres_type_def, blast)
    33 
    33 
    34 lemma monoD:
    34 lemma monoD:
    35   "\<lbrakk> mono r step n A; p < n; s\<in>A; s <=_r t \<rbrakk> \<Longrightarrow> step p s <=|r| step p t"
    35   "\<lbrakk> mono r step n A; p < n; s\<in>A; s <=_r t \<rbrakk> \<Longrightarrow> step p s \<le>|r| step p t"
    36   by (unfold mono_def, blast)
    36   by (unfold mono_def, blast)
    37 
    37 
    38 lemma boundedD: 
    38 lemma boundedD: 
    39   "\<lbrakk> bounded step n; p < n; (q,t) : set (step p xs) \<rbrakk> \<Longrightarrow> q < n" 
    39   "\<lbrakk> bounded step n; p < n; (q,t) : set (step p xs) \<rbrakk> \<Longrightarrow> q < n" 
    40   by (unfold bounded_def, blast)
    40   by (unfold bounded_def, blast)
    41 
    41 
    42 lemma lesubstep_type_refl [simp, intro]:
    42 lemma lesubstep_type_refl [simp, intro]:
    43   "(\<And>x. x <=_r x) \<Longrightarrow> x <=|r| x"
    43   "(\<And>x. x <=_r x) \<Longrightarrow> x \<le>|r| x"
    44   by (unfold lesubstep_type_def) auto
    44   by (unfold lesubstep_type_def) auto
    45 
    45 
    46 lemma lesub_step_typeD:
    46 lemma lesub_step_typeD:
    47   "a <=|r| b \<Longrightarrow> (x,y) \<in> set a \<Longrightarrow> \<exists>y'. (x, y') \<in> set b \<and> y <=_r y'"
    47   "a \<le>|r| b \<Longrightarrow> (x,y) \<in> set a \<Longrightarrow> \<exists>y'. (x, y') \<in> set b \<and> y <=_r y'"
    48   by (unfold lesubstep_type_def) blast
    48   by (unfold lesubstep_type_def) blast
    49 
    49 
    50 
    50 
    51 lemma list_update_le_listI [rule_format]:
    51 lemma list_update_le_listI [rule_format]:
    52   "set xs <= A \<longrightarrow> set ys <= A \<longrightarrow> xs <=[r] ys \<longrightarrow> p < size xs \<longrightarrow>  
    52   "set xs <= A \<longrightarrow> set ys <= A \<longrightarrow> xs <=[r] ys \<longrightarrow> p < size xs \<longrightarrow>