added
authorChristian Urban <christian dot urban at kcl dot ac dot uk>
Sat, 26 Oct 2013 10:06:58 +0100
changeset 160 8134c3b981e0
parent 159 ae5ceef5355e
child 161 bfcf838dda4d
added
handouts/ho05.pdf
handouts/ho05.tex
Binary file handouts/ho05.pdf has changed
--- a/handouts/ho05.tex	Sat Oct 26 10:02:29 2013 +0100
+++ b/handouts/ho05.tex	Sat Oct 26 10:06:58 2013 +0100
@@ -207,8 +207,8 @@
 \]
 
 \noindent
-and so on. So even if both regular expressions match in the example above,
-we can give the regular expression for \ref{Page ??} as follows
+So even if both regular expressions match in the example above,
+we give preference to the regular expression for keywords.
 
 Let us see how our algorithm for lexing works in detail. The regular 
 expressions and their ranking are shown above. For our algorithm it will  
@@ -230,23 +230,24 @@
 In contrast to the function $nullable(r)$, which test whether a regular expression
 can match the empty string, the $zeroable$ function identifies whether a regular
 expression cannot match anything at all. The mathematical way of stating this
-is 
+property is
 
 \begin{center}
-$s \in zeroable(s)$ implies $L(r) = \varnothing$
+$zeroable(r)$ if and only if $L(r) = \varnothing$
 \end{center}
 
 \noindent
 Let us fix a set of regular expressions $rs$.
-The crucial idea of the algorithm is to take the input string, say
+The crucial idea of the algorithm working with $rs$ and the string, say
 
 \begin{center}
 \texttt{\grid{$c_1$}\grid{$c_2$}\grid{$c_3$}\grid{$c_4$}\grid{\ldots}}
 \end{center}
 
 \noindent
-and build the derivative of all regular expressions in $rs$ with respect
-to the first character $c_1$. Then we take the result and continue with $c_2$
+is to build the derivative of all regular expressions in $rs$ with respect
+to the first character $c_1$. Then we take the results and continue with 
+building the derivatives with respect to $c_2$
 until we have either exhausted our input string or all of the regular expressions
 are ``zeroable''.