Binary file handouts/ho04.pdf has changed
--- a/handouts/ho04.tex Wed Oct 31 12:51:42 2018 +0000
+++ b/handouts/ho04.tex Fri Nov 02 00:24:28 2018 +0000
@@ -154,7 +154,7 @@
\end{tabular}
\end{center}
-\noindent There is are no cases for $\ZERO$ and $c$, since
+\noindent There are no cases for $\ZERO$ and $c$, since
these regular expression cannot match the empty string. Note
also that in case of alternatives we give preference to the
regular expression on the left-hand side. This will become
@@ -240,6 +240,7 @@
Next we have to ``inject'' the last character, that is $c$ in
the running example, into this value $v_4$ in order to
calculate how $r_3$ could have matched the string $c$.
+For this we call injection with $\textit{inj}(r_3, c, v_4)$.
According to the definition of $\textit{inj}$ we obtain
\begin{center}
@@ -249,8 +250,9 @@
\noindent This is the correct result, because $r_3$ needs
to use the right-hand alternative, and then $\ONE$ needs
to match the empty string and $c$ needs to match $c$.
-Next we need to inject back the letter $b$ into $v_3$. This
-gives
+Next we need to inject back the letter $b$ into $v_3$.
+For this we call injection with $\textit{inj}(r_2, b, v_3)$.
+This gives
\begin{center}
$v_2:\;Seq(Empty, Seq(Char(b), Char(c)))$
@@ -258,14 +260,16 @@
\noindent which is again the correct result for how $r_2$
matched the string $bc$. Finally we need to inject back the
-letter $a$ into $v_2$ giving the final result
+letter $a$ into $v_2$ giving the final result.
+For this we call injection with $\textit{inj}(r_1, a, v_2)$
+and obtain
\begin{center}
$v_1:\;Seq(Char(a), Seq(Char(b), Char(c)))$
\end{center}
-\noindent This now corresponds to how the regular
-expression $a \cdot (b \cdot c)$ matched the string $abc$.
+\noindent This value corresponds to how the regular expression $r_1$,
+namely $a \cdot (b \cdot c)$, matched the string $abc$.
There are a few auxiliary functions that are of interest
when analysing this algorithm. One is called \emph{flatten},
Binary file hws/hw06.pdf has changed
--- a/hws/hw06.tex Wed Oct 31 12:51:42 2018 +0000
+++ b/hws/hw06.tex Fri Nov 02 00:24:28 2018 +0000
@@ -67,8 +67,8 @@
\end{center}
there are several values for how these regular expressions can
-recognise the string (for 1) $ab$ and (for 2) $aaa$. Give in each case
-all the values and indicate which one is the POSIX value.
+recognise the strings (for 1) $ab$ and (for 2) $aaa$. Give in each case
+\emph{all} the values and indicate which one is the POSIX value.
\item \POSTSCRIPT
\end{enumerate}