diff -r e7e4e490326b -r 7c68b9ad4486 Paper/Paper.thy --- a/Paper/Paper.thy Wed Apr 06 08:18:23 2011 +0000 +++ b/Paper/Paper.thy Tue Apr 19 02:19:56 2011 +0000 @@ -69,7 +69,7 @@ formalising such reasoning in a HOL-based theorem prover, in our case Isabelle/HOL. Automata are built up from states and transitions that need to be represented as graphs, matrices or functions, none - of which can be defined as inductive datatype. + of which can be defined as an inductive datatype. In case of graphs and matrices, this means we have to build our own reasoning infrastructure for them, as neither Isabelle/HOL nor HOL4 nor @@ -145,7 +145,7 @@ changes the type---the disjoint union is not a set, but a set of pairs. Using this definition for disjoint union means we do not have a single type for automata and hence will not be able to state certain properties about \emph{all} - automata, since there is no type quantification available in HOL. An + automata, since there is no type quantification available in HOL (unlike in Coq, for example). An alternative, which provides us with a single type for automata, is to give every state node an identity, for example a natural number, and then be careful to rename these identities apart whenever @@ -377,7 +377,7 @@ The key definition in the Myhill-Nerode theorem is the \emph{Myhill-Nerode relation}, which states that w.r.t.~a language two strings are related, provided there is no distinguishing extension in this - language. This can be defined as tertiary relation. + language. This can be defined as a tertiary relation. \begin{definition}[Myhill-Nerode Relation] Given a language @{text A}, two strings @{text x} and @{text y} are Myhill-Nerode related provided @@ -573,7 +573,7 @@ finally we append this regular expression to @{text rhs'}. It can be easily seen that this operation mimics Arden's lemma on the level of equations. To ensure the non-emptiness condition of Arden's lemma we say that a right-hand side is - \emph{ardenable} provided + @{text ardenable} provided \begin{center} @{thm ardenable_def} @@ -627,7 +627,7 @@ \noindent Finally, we can define how an equational system should be solved. For this we will need to iterate the process of eliminating equations until only one equation - will be left in the system. However, we not just want to have any equation + will be left in the system. However, we do not just want to have any equation as being the last one, but the one involving the equivalence class for which we want to calculate the regular expression. Let us suppose this equivalence class is @{text X}. @@ -682,7 +682,7 @@ @{text "P"} involving @{const Solve}. For this we have to discharge the following proof obligations: first the initial equational system satisfies the invariant; second the iteration - step @{text "Iter"} preserves the the invariant as long as the condition @{term Cond} holds; + step @{text "Iter"} preserves the invariant as long as the condition @{term Cond} holds; third @{text "Iter"} decreases the termination order, and fourth that once the condition does not hold anymore then the property @{text P} must hold. @@ -709,7 +709,7 @@ and number of terms in each equation); the second makes sure the `meaning' of the equations is preserved under our transformations. The other properties are a bit more technical, but are needed to get our proof through. Distinctness states that every - equation in the system is distinct. Ardenable ensures that we can always + equation in the system is distinct. @{text Ardenable} ensures that we can always apply the arden operation. The last property states that every @{text rhs} can only contain equivalence classes for which there is an equation. Therefore @{text lhss} is just the set containing @@ -729,7 +729,7 @@ \begin{proof} Finiteness is given by the assumption and the way how we set up the initial equational system. Soundness is proved in Lem.~\ref{inv}. Distinctness - follows from the fact that the equivalence classes are disjoint. The ardenable + follows from the fact that the equivalence classes are disjoint. The @{text ardenable} property also follows from the setup of the initial equational system, as does validity.\qed \end{proof} @@ -756,7 +756,7 @@ Finiteness is straightforward, as @{const Subst} and @{const Arden} operations keep the equational system finite. These operations also preserve soundness and distinctness (we proved soundness for @{const Arden} in Lem.~\ref{ardenable}). - The property ardenable is clearly preserved because the append-operation + The property @{text ardenable} is clearly preserved because the append-operation cannot make a regular expression to match the empty string. Validity is given because @{const Arden} removes an equivalence class from @{text yrhs} and then @{const Subst_all} removes @{text Y} from the equational system. @@ -832,7 +832,7 @@ we can infer that @{term "rhss rhs \ {X}"} and because the arden operation removes that @{text X} from @{text rhs}, that @{term "rhss (Arden X rhs) = {}"}. This means the right-hand side @{term "Arden X rhs"} can only consist of terms of the form @{term "Lam r"}. - So we can collect those (finitely many) regular expressions and have @{term "X = L (\rs)"}. + So we can collect those (finitely many) regular expressions @{text rs} and have @{term "X = L (\rs)"}. With this we can conclude the proof.\qed \end{proof} @@ -893,7 +893,7 @@ \end{proof} \noindent - Much more interesting, however, are the inductive cases. They seem hard to be solved + Much more interesting, however, are the inductive cases. They seem hard to solve directly. The reader is invited to try. Our proof will rely on some @@ -1274,8 +1274,8 @@ exists a regular expression that matches all of its strings. Regular expressions can conveniently be defined as a datatype in HOL-based theorem provers. For us it was therefore interesting to find out how far we can push - this point of view. We have established both directions of the Myhill-Nerode - theorem. + this point of view. We have established in Isabelle/HOL both directions + of the Myhill-Nerode theorem. % \begin{theorem}[The Myhill-Nerode Theorem]\mbox{}\\ A language @{text A} is regular if and only if @{thm (rhs) Myhill_Nerode}. @@ -1352,7 +1352,8 @@ We briefly considered using the method Brzozowski presented in the Appendix of~\cite{Brzozowski64} in order to prove the second direction of the Myhill-Nerode theorem. There he calculates the derivatives for regular - expressions and shows that there can be only finitely many of them. We could + expressions and shows that there can be only finitely many of them (if regarded equal + modulo ACI). We could have used as the tag of a string @{text s} the derivative of a regular expression generated with respect to @{text s}. Using the fact that two strings are Myhill-Nerode related whenever their derivative is the same, together with