diff -r 9a431d1eac85 -r b7f9460c6a1c coursework/cw01.tex --- a/coursework/cw01.tex Fri Apr 10 12:11:19 2020 +0100 +++ b/coursework/cw01.tex Fri Apr 10 16:12:33 2020 +0100 @@ -125,7 +125,7 @@ From the lectures you have seen the definitions for the functions \textit{nullable} and \textit{der} for the basic regular -expressions. Implement and write down rules for the extended +expressions. Implement and write down the rules for the extended regular expressions: \begin{center} @@ -170,20 +170,21 @@ \begin{center} \def\arraystretch{1.2} -\begin{tabular}{r|m{12mm}|m{12mm}|m{12mm}|m{12mm}|m{12mm}|m{12mm}} - string & $a^{\{3\}}$ & $(a^?)^{\{3\}}$ & $a^{\{..3\}}$ & - $(a^?)^{\{..3\}}$ & $a^{\{3..5\}}$ & $(a^?)^{\{3..5\}}$\\\hline - $[]$ &&&&&& \\\hline - \texttt{a} &&&&&& \\\hline - \texttt{aa} &&&&&& \\\hline - \texttt{aaa} &&&&&& \\\hline - \texttt{aaaaa} &&&&&& \\\hline - \texttt{aaaaaa}&&&&&& \\ +\begin{tabular}{@{}r|m{6mm}|m{6mm}|m{6mm}|m{10mm}|m{10mm}|m{10mm}|m{10mm}|m{10mm}} + string & $a^?$ & $\sim{}a$ & $a^{\{3\}}$ & $(a^?)^{\{3\}}$ & $a^{\{..3\}}$ & + $(a^?)^{\{..3\}}$ & $a^{\{3..5\}}$ & $(a^?)^{\{3..5\}}$ \\\hline + $[]$ &&&&&&& \\\hline + \texttt{a} &&&&&&& \\\hline + \texttt{aa} &&&&&&& \\\hline + \texttt{aaa} &&&&&&& \\\hline + \texttt{aaaaa} &&&&&&& \\\hline + \texttt{aaaaaa}&&&&&&& \\ \end{tabular} \end{center} \noindent -Does your matcher produce the expected results? +Does your matcher produce the expected results? Make sure you +also test corner-cases, like $a^{\{0\}}$! \subsection*{Question 4}