diff -r c7e944977e39 -r 68b1a84efce6 cws/cw01.tex --- a/cws/cw01.tex Wed Sep 17 14:29:52 2025 +0100 +++ b/cws/cw01.tex Wed Sep 17 15:11:48 2025 +0100 @@ -81,13 +81,13 @@ \code{RANGE}, \code{PLUS}, \code{OPTIONAL}, \code{INTER}, \code{NTIMES}, \code{UPTO}, \code{FROM} and \code{BETWEEN}.} That means do not treat the extended regular expressions -by just translating them into the basic ones. See also Question 1, +by just translating them into the basic ones. See also Task 1, where you are asked to explicitly give the rules for \textit{nullable} and \textit{der} for the extended regular expressions. Something like \[der\,c\,(r^+) \dn der\,c\,(r\cdot r^*)\] -\noindent is \emph{not} allowed as answer in Question 1 and \emph{not} +\noindent is \emph{not} allowed as answer in Task 1 and \emph{not} allowed in your code.\medskip \noindent @@ -116,7 +116,7 @@ \noindent Be careful that your implementation of \textit{nullable} and \textit{der} satisfies for every regular expression $r$ the following -two properties (see also Question 1): +two properties (see also Task 1): \begin{itemize} \item $\textit{nullable}(r)$ if and only if $[]\in L(r)$ @@ -139,7 +139,7 @@ %at least a good working day fiddling with a program)? This is just %for my curiosity to estimate what your background is. -\subsection*{Question 1} +\subsection*{Task 1} From the lectures you have seen the definitions for the functions \textit{nullable} and \textit{der} for the basic regular @@ -179,7 +179,7 @@ Does your matcher produce the expected results? Make sure you also test corner-cases, like $a^{\{0\}}$! -\subsection*{Question 2} +\subsection*{Task 2} As you can see, there are a number of explicit regular expressions that deal with single or several characters, for example: @@ -229,12 +229,12 @@ \noindent You can either add the constructor $CFUN$ to your implementation in -Question 3, or you can implement this questions first -and then use $CFUN$ instead of \code{RANGE} and \code{CHAR} in Question 3. +Task 3, or you can implement this questions first +and then use $CFUN$ instead of \code{RANGE} and \code{CHAR} in Task 3. In an ideal world one would do this task first, but this might confuse you with what you need to do in the previous question. -\subsection*{Question 3} +\subsection*{Task 3} Suppose $[a\mbox{-}z0\mbox{-}9\_\,.\mbox{-}]$ stands for the regular expression @@ -270,7 +270,7 @@ instead of raw code.\bigskip -\subsection*{Question 4} +\subsection*{Task 4} Implement the simplification rules in your regular expression matcher. Consider the regular expression $/ \cdot * \cdot @@ -285,7 +285,7 @@ \item \texttt{"/*test/*test*/"} \end{enumerate} -\subsection*{Question 5} +\subsection*{Task 5} Let $r_1$ be the regular expression $a\cdot a\cdot a$ and $r_2$ be $(a^{\{19,19\}}) \cdot (a^?)$.\medskip @@ -338,7 +338,7 @@ \uline{\hfill}\bigskip\bigskip \noindent -\textbf{Question 1:} +\textbf{Task 1:} \begin{center} \def\arraystretch{1.6} @@ -378,7 +378,7 @@ \noindent -\textbf{Question 2:} +\textbf{Task 2:} \begin{center} \def\arraystretch{1.6} @@ -398,7 +398,7 @@ \newpage \noindent -\textbf{Question 3 (`mathematical' notation):} +\textbf{Task 3 (`mathematical' notation):} \noindent \uline{\hfill}\medskip @@ -416,7 +416,7 @@ \uline{\hfill}\bigskip\bigskip \noindent -\textbf{Question 4:}\medskip +\textbf{Task 4:}\medskip \noindent \textbf{1)}\; Yes / No\qquad @@ -426,7 +426,7 @@ \noindent -\textbf{Question 5:}\medskip +\textbf{Task 5:}\medskip \def\arraystretch{1.5} \begin{tabular}{l|c|c}