equal
deleted
inserted
replaced
92 What is your King's email address (you will need it in |
92 What is your King's email address (you will need it in |
93 Question 3)? |
93 Question 3)? |
94 |
94 |
95 \subsection*{Question 2} |
95 \subsection*{Question 2} |
96 |
96 |
97 This question does not require any implementation. From the |
97 From the |
98 lectures you have seen the definitions for the functions |
98 lectures you have seen the definitions for the functions |
99 \textit{nullable} and \textit{der} for the basic regular |
99 \textit{nullable} and \textit{der} for the basic regular |
100 expressions. Give the rules for the extended regular |
100 expressions. Implement the rules for the extended regular |
101 expressions: |
101 expressions: |
102 |
102 |
103 \begin{center} |
103 \begin{center} |
104 \begin{tabular}{@ {}l@ {\hspace{2mm}}c@ {\hspace{2mm}}l@ {}} |
104 \begin{tabular}{@ {}l@ {\hspace{2mm}}c@ {\hspace{2mm}}l@ {}} |
105 $\textit{nullable}([c_1 c_2 \ldots c_n])$ & $\dn$ & $?$\\ |
105 $\textit{nullable}([c_1 c_2 \ldots c_n])$ & $\dn$ & $?$\\ |
121 \begin{itemize} |
121 \begin{itemize} |
122 \item $\textit{nullable}(r)$ if and only if $[]\in L(r)$ |
122 \item $\textit{nullable}(r)$ if and only if $[]\in L(r)$ |
123 \item $L(der\,c\,r)) = Der\,c\,(L(r))$ |
123 \item $L(der\,c\,r)) = Der\,c\,(L(r))$ |
124 \end{itemize} |
124 \end{itemize} |
125 |
125 |
|
126 \noindent |
|
127 Give the implementation and the text-version of the clauses above. |
|
128 |
126 \subsection*{Question 3} |
129 \subsection*{Question 3} |
127 |
130 |
128 Implement the following regular expression for email addresses |
131 Implement the following regular expression for email addresses |
129 |
132 |
130 \[ |
133 \[ |
168 \item \texttt{"/*test/*test*/"} |
171 \item \texttt{"/*test/*test*/"} |
169 \end{enumerate} |
172 \end{enumerate} |
170 |
173 |
171 \noindent |
174 \noindent |
172 Also test your regular expression matcher with the regular |
175 Also test your regular expression matcher with the regular |
173 expression $a^{\{3,5\}}$ and the strings |
176 expressions $a^{\{3,5\}}$ and $(a^?)^{\{3,5\}}$. Test whether the |
|
177 strings |
174 |
178 |
175 \begin{enumerate} |
179 \begin{enumerate} |
176 \setcounter{enumi}{4} |
180 \setcounter{enumi}{4} |
177 \item \texttt{aa} |
181 \item \texttt{aa} |
178 \item \texttt{aaa} |
182 \item \texttt{aaa} |
179 \item \texttt{aaaaa} |
183 \item \texttt{aaaaa} |
180 \item \texttt{aaaaaa} |
184 \item \texttt{aaaaaa} |
181 \end{enumerate} |
185 \end{enumerate} |
182 |
186 |
183 \noindent |
187 \noindent |
184 Does your matcher produce the expected results? |
188 are matched or not. Does your matcher produce the expected results? |
185 |
189 |
186 \subsection*{Question 5} |
190 \subsection*{Question 5} |
187 |
191 |
188 Let $r_1$ be the regular expression $a\cdot a\cdot a$ and $r_2$ be |
192 Let $r_1$ be the regular expression $a\cdot a\cdot a$ and $r_2$ be |
189 $(a^{\{19,19\}}) \cdot (a^?)$. Decide whether the following three |
193 $(a^{\{19,19\}}) \cdot (a^?)$. Decide whether the following three |