coursework/cw01.tex
changeset 576 550186034b6e
parent 567 4573d36d0b2f
child 577 7a437f1f689d
--- a/coursework/cw01.tex	Tue Oct 09 08:25:40 2018 +0100
+++ b/coursework/cw01.tex	Fri Oct 12 10:16:54 2018 +0100
@@ -1,3 +1,4 @@
+
 \documentclass{article}
 \usepackage{../style}
 \usepackage{../langs}
@@ -70,7 +71,8 @@
   like that.} That means do not treat the extended regular expressions
 by just translating them into the basic ones. See also Question 3,
 where you are asked to explicitly give the rules for \textit{nullable}
-and \textit{der} for the extended regular expressions.\medskip
+and \textit{der} for the extended regular expressions. So something like
+$der\,c\,(r^+) \dn der\,c\,(r\cdot r^*)$ is \emph{not} allowed.\medskip
 
 \noindent
 The meanings of the extended regular expressions are
@@ -201,7 +203,16 @@
 by using $\textit{ALL}^*$). In order to avoid having an explicit constructor
 for each case, we can generalise all these cases and introduce a single
 constructor $\textit{CFUN}(f)$ where $f$ is a function from characters
-to booleans. The idea is that the function $f$ determines which character(s)
+to booleans. In Scala code this would look as follows:
+
+\begin{lstlisting}[numbers=none]
+abstract class Rexp
+...
+case class CFUN(f: Char => Boolean) extends Rexp 
+\end{lstlisting}\smallskip
+
+\noindent
+The idea is that the function $f$ determines which character(s)
 are matched, namely those where $f$ returns \texttt{true}.
 In this question implement \textit{CFUN} and define