diff -r 29fc780ca130 -r fa7f7144f2bb cws/main_cw03.tex --- a/cws/main_cw03.tex Tue Dec 07 01:35:00 2021 +0000 +++ b/cws/main_cw03.tex Tue Dec 07 23:17:51 2021 +0000 @@ -362,10 +362,23 @@ \end{tabular} \end{center} - The last case is as follows: first apply $simp$ to all regular expressions - $r_1,.. ,r_n$; then flatten the resulting list using \texttt{flts}; - finally remove all duplicates in this list (this can be done in Scala - using the function \texttt{\_.distinct}). +The last case is as follows: first apply $simp$ to all regular +expressions $r_1,.. ,r_n$; then flatten the resulting list using +\texttt{flts}; finally remove all duplicates in this list (this can be +done in Scala using the function +\texttt{\_.distinct}). \textcolor{red}{When you perform these + operations, you end up with three cases, namely where the list is + empty, contains a single element and ``otherwise''. These cases + should be processed as follows} +\begin{center} +\textcolor{red}{\begin{tabular}{l@{\hspace{4mm}}c@{\hspace{4mm}}ll} +$\sum\;[]$ & $\mapsto$ & $\ZERO$\\ +$\sum\;[r]$ & $\mapsto$ & $r$\\ +$\sum\;rs$ & $\mapsto$ & $\sum\;rs$ & ``otherwise''\\ +\end{tabular}} +\end{center} + + For example the regular expression \[(r_1 + \ZERO) \cdot \ONE + ((\ONE + r_2) + r_3) \cdot (r_4 \cdot \ZERO)\]