handouts/ho02.tex
changeset 126 7c7185cb4f2b
parent 125 39c75cf4e079
child 133 09efdf5cf07c
equal deleted inserted replaced
125:39c75cf4e079 126:7c7185cb4f2b
   177 \[
   177 \[
   178 match\,s\,r\quad\text{if and only if}\quad s\in L(r)
   178 match\,s\,r\quad\text{if and only if}\quad s\in L(r)
   179 \]
   179 \]
   180 
   180 
   181 \noindent
   181 \noindent
   182 holds, which means our algorithm satisfies the specification.
   182 holds, which means our algorithm satisfies the specification. This algorithm can be easily 
       
   183 extended for other regular expressions such as $r^{\{n\}}$, $r^?$, $\sim{}r$ and so on.
       
   184 
       
   185 \begin{figure}[p]
       
   186 {\lstset{language=Scala}\texttt{\lstinputlisting{../progs/app5.scala}}}
       
   187 {\lstset{language=Scala}\texttt{\lstinputlisting{../progs/app6.scala}}}
       
   188 \caption{Scala implementation of the nullable and derivatives functions.}
       
   189 \end{figure}
   183 
   190 
   184 \end{document}
   191 \end{document}
   185 
   192 
   186 %%% Local Variables: 
   193 %%% Local Variables: 
   187 %%% mode: latex
   194 %%% mode: latex