diff -r 21f41e08457d -r ae4708c851ee cws/cw03.tex --- a/cws/cw03.tex Wed Dec 21 01:19:25 2016 +0000 +++ b/cws/cw03.tex Wed Dec 21 03:06:18 2016 +0000 @@ -327,18 +327,17 @@ \end{itemize}\bigskip +\subsection*{Background} -\noindent -\textbf{Background} Although easily implementable in Scala, the idea -behind the derivative function might not so easy to be seen. To -understand its purpose better, assume a regular expression $r$ can -match strings of the form $c::cs$ (that means strings which start with -a character $c$ and have some rest, or tail, $cs$). If you now take the -derivative of $r$ with respect to the character $c$, then you obtain a -regular expressions that can match all the strings $cs$. In other -words, the regular expression $\textit{der}\;c\;r$ can match the same -strings $c::cs$ that can be matched by $r$, except that the $c$ is -chopped off. +Although easily implementable in Scala, the idea behind the derivative +function might not so easy to be seen. To understand its purpose +better, assume a regular expression $r$ can match strings of the form +$c::cs$ (that means strings which start with a character $c$ and have +some rest, or tail, $cs$). If you now take the derivative of $r$ with +respect to the character $c$, then you obtain a regular expressions +that can match all the strings $cs$. In other words, the regular +expression $\textit{der}\;c\;r$ can match the same strings $c::cs$ +that can be matched by $r$, except that the $c$ is chopped off. Assume now $r$ can match the string $abc$. If you take the derivative according to $a$ then you obtain a regular expression that can match