Journal/Paper.thy
changeset 338 e7504bfdbd50
parent 334 d47c2143ab8a
child 348 bea94f1e6771
equal deleted inserted replaced
337:f9d54f49c808 338:e7504bfdbd50
   616 text {*
   616 text {*
   617   \noindent
   617   \noindent
   618   The key definition in the Myhill-Nerode Theorem is the
   618   The key definition in the Myhill-Nerode Theorem is the
   619   \emph{Myhill-Nerode Relation}, which states that w.r.t.~a language two 
   619   \emph{Myhill-Nerode Relation}, which states that w.r.t.~a language two 
   620   strings are related, provided there is no distinguishing extension in this
   620   strings are related, provided there is no distinguishing extension in this
   621   language. This can be defined as a tertiary relation.
   621   language. This can be defined as a ternary relation.
   622 
   622 
   623   \begin{dfntn}[Myhill-Nerode Relation]\label{myhillneroderel} 
   623   \begin{dfntn}[Myhill-Nerode Relation]\label{myhillneroderel} 
   624   Given a language @{text A}, two strings @{text x} and
   624   Given a language @{text A}, two strings @{text x} and
   625   @{text y} are Myhill-Nerode related provided
   625   @{text y} are Myhill-Nerode related provided
   626   \begin{center}
   626   \begin{center}
   688   \begin{equation} 
   688   \begin{equation} 
   689   @{thm transition_def}
   689   @{thm transition_def}
   690   \end{equation}
   690   \end{equation}
   691 
   691 
   692   \noindent
   692   \noindent
   693   which means that if we concatenate the character @{text c} to the end of all 
   693   which means that if we append the character @{text c} to the end of all 
   694   strings in the equivalence class @{text Y}, we obtain a subset of 
   694   strings in the equivalence class @{text Y}, we obtain a subset of 
   695   @{text X}. Note that we do not define an automaton here, we merely relate two sets
   695   @{text X}. Note that we do not define an automaton here, we merely relate two sets
   696   (with the help of a character). In our concrete example we have 
   696   (with the help of a character). In our concrete example we have 
   697   @{term "X\<^isub>1 \<Turnstile>c\<Rightarrow> X\<^isub>2"}, @{term "X\<^isub>1 \<Turnstile>d\<^isub>i\<Rightarrow> X\<^isub>3"} with @{text "d\<^isub>i"} being any 
   697   @{term "X\<^isub>1 \<Turnstile>c\<Rightarrow> X\<^isub>2"}, @{term "X\<^isub>1 \<Turnstile>d\<^isub>i\<Rightarrow> X\<^isub>3"} with @{text "d\<^isub>i"} being any 
   698   other character than @{text c}, and @{term "X\<^isub>3 \<Turnstile>c\<^isub>j\<Rightarrow> X\<^isub>3"} for any 
   698   other character than @{text c}, and @{term "X\<^isub>3 \<Turnstile>c\<^isub>j\<Rightarrow> X\<^isub>3"} for any 
   701   Next we construct an \emph{initial equational system} that
   701   Next we construct an \emph{initial equational system} that
   702   contains an equation for each equivalence class. We first give
   702   contains an equation for each equivalence class. We first give
   703   an informal description of this construction. Suppose we have 
   703   an informal description of this construction. Suppose we have 
   704   the equivalence classes @{text "X\<^isub>1,\<dots>,X\<^isub>n"}, there must be one and only one that
   704   the equivalence classes @{text "X\<^isub>1,\<dots>,X\<^isub>n"}, there must be one and only one that
   705   contains the empty string @{text "[]"} (since equivalence classes are disjoint).
   705   contains the empty string @{text "[]"} (since equivalence classes are disjoint).
   706   Let us assume @{text "[] \<in> X\<^isub>1"}. We build the following equational system
   706   Let us assume @{text "[] \<in> X\<^isub>1"}. We build the following initial equational system
   707   
   707   
   708   \begin{center}
   708   \begin{center}
   709   \begin{tabular}{rcl}
   709   \begin{tabular}{rcl}
   710   @{text "X\<^isub>1"} & @{text "="} & @{text "(Y\<^isub>1\<^isub>1, ATOM c\<^isub>1\<^isub>1) + \<dots> + (Y\<^isub>1\<^isub>p, ATOM c\<^isub>1\<^isub>p) + \<lambda>(ONE)"} \\
   710   @{text "X\<^isub>1"} & @{text "="} & @{text "(Y\<^isub>1\<^isub>1, ATOM c\<^isub>1\<^isub>1) + \<dots> + (Y\<^isub>1\<^isub>p, ATOM c\<^isub>1\<^isub>p) + \<lambda>(ONE)"} \\
   711   @{text "X\<^isub>2"} & @{text "="} & @{text "(Y\<^isub>2\<^isub>1, ATOM c\<^isub>2\<^isub>1) + \<dots> + (Y\<^isub>2\<^isub>o, ATOM c\<^isub>2\<^isub>o)"} \\
   711   @{text "X\<^isub>2"} & @{text "="} & @{text "(Y\<^isub>2\<^isub>1, ATOM c\<^isub>2\<^isub>1) + \<dots> + (Y\<^isub>2\<^isub>o, ATOM c\<^isub>2\<^isub>o)"} \\
   713   @{text "X\<^isub>n"} & @{text "="} & @{text "(Y\<^isub>n\<^isub>1, ATOM c\<^isub>n\<^isub>1) + \<dots> + (Y\<^isub>n\<^isub>q, ATOM c\<^isub>n\<^isub>q)"}\\
   713   @{text "X\<^isub>n"} & @{text "="} & @{text "(Y\<^isub>n\<^isub>1, ATOM c\<^isub>n\<^isub>1) + \<dots> + (Y\<^isub>n\<^isub>q, ATOM c\<^isub>n\<^isub>q)"}\\
   714   \end{tabular}
   714   \end{tabular}
   715   \end{center}
   715   \end{center}
   716 
   716 
   717   \noindent
   717   \noindent
   718   where the terms @{text "(Y\<^isub>i\<^isub>j, ATOM c\<^isub>i\<^isub>j)"}
   718   where the terms @{text "(Y\<^isub>i\<^isub>j, ATOM c\<^isub>i\<^isub>j)"} are pairs consiting of an equivalence class and
       
   719   a regular expression. In the initial equational system, they
   719   stand for all transitions @{term "Y\<^isub>i\<^isub>j \<Turnstile>c\<^isub>i\<^isub>j\<Rightarrow>
   720   stand for all transitions @{term "Y\<^isub>i\<^isub>j \<Turnstile>c\<^isub>i\<^isub>j\<Rightarrow>
   720   X\<^isub>i"}. 
   721   X\<^isub>i"}. 
   721   %The intuition behind the equational system is that every 
   722   %The intuition behind the equational system is that every 
   722   %equation @{text "X\<^isub>i = rhs\<^isub>i"} in this system
   723   %equation @{text "X\<^isub>i = rhs\<^isub>i"} in this system
   723   %corresponds roughly to a state of an automaton whose name is @{text X\<^isub>i} and its predecessor states 
   724   %corresponds roughly to a state of an automaton whose name is @{text X\<^isub>i} and its predecessor states 
   895   \end{lmm}
   896   \end{lmm}
   896   
   897   
   897   \noindent
   898   \noindent
   898   Our @{text ardenable} condition is slightly stronger than needed for applying Arden's Lemma,
   899   Our @{text ardenable} condition is slightly stronger than needed for applying Arden's Lemma,
   899   but we can still ensure that it holds throughout our algorithm of transforming equations
   900   but we can still ensure that it holds throughout our algorithm of transforming equations
   900   into solved form. The \emph{substitution-operation} takes an equation
   901   into solved form. 
       
   902 
       
   903   The \emph{substitution-operation} takes an equation
   901   of the form @{text "X = xrhs"} and substitutes it into the right-hand side @{text rhs}.
   904   of the form @{text "X = xrhs"} and substitutes it into the right-hand side @{text rhs}.
   902 
   905 
   903   \begin{center}
   906   \begin{center}
   904   \begin{tabular}{rc@ {\hspace{2mm}}r@ {\hspace{1mm}}l}
   907   \begin{tabular}{rc@ {\hspace{2mm}}r@ {\hspace{1mm}}l}
   905   @{thm (lhs) Subst_def} & @{text "\<equiv>"}~~\mbox{} & \multicolumn{2}{@ {\hspace{-2mm}}l}{@{text "let"}}\\ 
   908   @{thm (lhs) Subst_def} & @{text "\<equiv>"}~~\mbox{} & \multicolumn{2}{@ {\hspace{-2mm}}l}{@{text "let"}}\\ 
  1601   In order to show that @{term "x @ z \<in> A\<star>"} implies @{term "y @ z \<in> A\<star>"}, we use
  1604   In order to show that @{term "x @ z \<in> A\<star>"} implies @{term "y @ z \<in> A\<star>"}, we use
  1602   the following tagging-function:
  1605   the following tagging-function:
  1603   %
  1606   %
  1604   \begin{center}
  1607   \begin{center}
  1605   @{thm (lhs) tag_Star_def[where ?A="A", THEN meta_eq_app]}~@{text "\<equiv>"}~
  1608   @{thm (lhs) tag_Star_def[where ?A="A", THEN meta_eq_app]}~@{text "\<equiv>"}~
  1606   @{text "{\<lbrakk>x\<^isub>s\<rbrakk>\<^bsub>\<approx>A\<^esub> | x\<^isub>p < x \<and> x\<^isub>p \<in> A\<^isup>\<star> \<and> (x\<^isub>s, x\<^isub>p) \<in> Partitions x}"}
  1609   @{text "{\<lbrakk>x\<^isub>s\<rbrakk>\<^bsub>\<approx>A\<^esub> | x\<^isub>p < x \<and> x\<^isub>p \<in> A\<^isup>\<star> \<and> (x\<^isub>p, x\<^isub>s) \<in> Partitions x}"}
  1607   \end{center}
  1610   \end{center}
  1608 
  1611 
  1609   \begin{proof}[@{const Star}-Case]
  1612   \begin{proof}[@{const Star}-Case]
  1610   If @{term "finite (UNIV // \<approx>A)"} 
  1613   If @{term "finite (UNIV // \<approx>A)"} 
  1611   then @{term "finite (Pow (UNIV // \<approx>A))"} holds. The range of
  1614   then @{term "finite (Pow (UNIV // \<approx>A))"} holds. The range of