slides02.tex
changeset 11 5353d405e4e6
parent 7 73cf4406b773
child 15 f5a6270adebc
equal deleted inserted replaced
10:6eff65f7e6cd 11:5353d405e4e6
    69 	tabsize=2,
    69 	tabsize=2,
    70 	showspaces=false,
    70 	showspaces=false,
    71 	showstringspaces=false}
    71 	showstringspaces=false}
    72 
    72 
    73 % beamer stuff 
    73 % beamer stuff 
    74 \renewcommand{\slidecaption}{AFL 01, King's College London, 26.~September 2012}
    74 \renewcommand{\slidecaption}{AFL 02, King's College London, 3.~October 2012}
    75 
    75 \newcommand{\bl}[1]{\textcolor{blue}{#1}}       
       
    76 \newcommand{\dn}{\stackrel{\mbox{\scriptsize def}}{=}}% for definitions
    76 
    77 
    77 \begin{document}
    78 \begin{document}
    78 
    79 
    79 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    80 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    80 \mode<presentation>{
    81 \mode<presentation>{
    81 \begin{frame}<1>[t]
    82 \begin{frame}<1>[t]
    82 \frametitle{%
    83 \frametitle{%
    83   \begin{tabular}{@ {}c@ {}}
    84   \begin{tabular}{@ {}c@ {}}
    84   \\[-3mm]
    85   \\[-3mm]
    85   \LARGE Automata and \\[-2mm] 
    86   \LARGE Automata and \\[-2mm] 
    86   \LARGE Formal Languages (1)\\[-3mm] 
    87   \LARGE Formal Languages (2)\\[-3mm] 
    87   \end{tabular}}
    88   \end{tabular}}
    88 
    89 
    89   \begin{center}
    90   \begin{center}
    90   \includegraphics[scale=0.3]{pics/ante1.jpg}\hspace{5mm}
    91   \includegraphics[scale=0.3]{pics/ante1.jpg}\hspace{5mm}
    91   \includegraphics[scale=0.31]{pics/ante2.jpg}\\
    92   \includegraphics[scale=0.31]{pics/ante2.jpg}\\
   103 
   104 
   104 
   105 
   105 \end{frame}}
   106 \end{frame}}
   106  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
   107  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
   107 
   108 
   108 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   109 \mode<presentation>{
       
   110 \begin{frame}[c]
       
   111 
       
   112 \begin{textblock}{1}(2,5)
       
   113 \begin{tabular}{c}
       
   114 \includegraphics[scale=0.15]{pics/servers.png}\\[-2mm]
       
   115 \small Server
       
   116 \end{tabular}
       
   117 \end{textblock}
       
   118 
       
   119 \begin{textblock}{1}(5.6,4)
       
   120   \begin{tikzpicture}[scale=1.1]
       
   121   \draw[white] (0,1) node (X) {};
       
   122   \draw[white] (2,1) node (Y) {};
       
   123    \draw[white] (0,0) node (X1) {};
       
   124   \draw[white] (2,0) node (Y1) {};
       
   125    \draw[white] (0,-1) node (X2) {};
       
   126   \draw[white] (2,-1) node (Y2) {};
       
   127   \draw[red, <-, line width = 2mm] (X) -- (Y);
       
   128   \node [inner sep=5pt,label=above:\textcolor{black}{GET request}] at ($ (X)!.5!(Y) $) {};
       
   129   \draw[red, ->, line width = 2mm] (X1) -- (Y1);
       
   130   \node [inner sep=5pt,label=above:\textcolor{black}{webpage}] at ($ (X1)!.5!(Y1) $) {};
       
   131   \draw[red, <-, line width = 2mm] (X2) -- (Y2);
       
   132   \node [inner sep=7pt,label=above:\textcolor{black}{POST data}] at ($ (X2)!.5!(Y2) $) {};
       
   133   \end{tikzpicture}
       
   134 \end{textblock}
       
   135 
       
   136 
       
   137 \begin{textblock}{1}(9,5.5)
       
   138 \begin{tabular}{c}
       
   139 \includegraphics[scale=0.15]{pics/laptop.png}\\[-2mm]
       
   140 \small Browser
       
   141 \end{tabular}
       
   142 \end{textblock}
       
   143   
       
   144 \only<2>{  
       
   145 \begin{textblock}{10}(2,13.5)
       
   146 \begin{itemize}
       
   147 \item programming languages, compilers
       
   148 \end{itemize}
       
   149 \end{textblock}}
       
   150   
       
   151   
       
   152 \end{frame}}
       
   153 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   154 
       
   155 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   156 \mode<presentation>{
       
   157 \begin{frame}[c]
       
   158 
       
   159 transforming strings into structured data\\[10mm]
       
   160 
       
   161 {\LARGE\bf Lexing}\medskip\\
       
   162 \hspace{5mm}(recognising ``words'')\\[6mm]
       
   163 
       
   164 {\LARGE\bf Parsing}\medskip\\
       
   165 \hspace{5mm}(recognising ``sentences'')
       
   166 
       
   167 \end{frame}}
       
   168 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
       
   169 
       
   170 
       
   171 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   172 \mode<presentation>{
       
   173 \begin{frame}[c]
       
   174 
       
   175 The subject is quite old:
       
   176 
       
   177 \begin{itemize}
       
   178 \item Turing Machines, 1936
       
   179 \item first compiler for COBOL, 1957 (Grace Hopper)
       
   180 \item but surprisingly research papers are still published now
       
   181 \end{itemize}
       
   182 
       
   183 \begin{flushright}
       
   184 \includegraphics[scale=0.3]{pics/hopper.jpg}\\
       
   185 \footnotesize\textcolor{gray}{Grace Hopper}
       
   186 \end{flushright}
       
   187 
       
   188 {\footnotesize\textcolor{gray}{(she made it to David Letterman's Tonight Show, \url{http://www.youtube.com/watch?v=aZOxtURhfEU})}}
       
   189 
       
   190 \end{frame}}
       
   191 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
       
   192 
       
   193 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   194 \mode<presentation>{
       
   195 \begin{frame}[c]
       
   196 \frametitle{\begin{tabular}{c}This Course\end{tabular}}
       
   197 
       
   198 \begin{itemize}
       
   199 \item the ultimate goal is to implement a small web-browser (really small one)\bigskip
       
   200 \end{itemize}
       
   201 
       
   202 Let's start with:
       
   203 
       
   204 \begin{itemize}
       
   205 \item a web-crawler
       
   206 \item an email harvester
       
   207 \item a web-scraper
       
   208 \end{itemize}
       
   209 
       
   210 \end{frame}}
       
   211 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   212 
       
   213 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   214 \mode<presentation>{
       
   215 \begin{frame}[t]
       
   216 \frametitle{\begin{tabular}{c}A Web Crawler\end{tabular}}
       
   217 
       
   218 \mbox{}\\[10mm]
       
   219 
       
   220 \begin{enumerate}
       
   221 \item given an URL, read the corresponding webpage
       
   222 \item extract all links from it
       
   223 \item call the web-crawler again for all these links
       
   224 \end{enumerate}
       
   225 
       
   226 \end{frame}}
       
   227 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   228 
       
   229 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   230 \mode<presentation>{
       
   231 \begin{frame}[t]
       
   232 \frametitle{\begin{tabular}{c}A Web Crawler\end{tabular}}
       
   233 
       
   234 \mbox{}\\[10mm]
       
   235 
       
   236 
       
   237 \begin{enumerate}
       
   238 \item given an URL, read the corresponding webpage
       
   239 \item if not possible print, out a problem
       
   240 \item if possible, extract all links from it
       
   241 \item call the web-crawler again for all these links
       
   242 \end{enumerate}\bigskip\pause
       
   243 
       
   244 \small (we need a bound for the number of recursive calls)
       
   245 
       
   246 \small (the purpose is to check all links on my own webpage)
       
   247 \end{frame}}
       
   248 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   249 
       
   250 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   251 \mode<presentation>{
       
   252 \begin{frame}[c]
       
   253 \frametitle{\begin{tabular}{c}Scala\end{tabular}}
       
   254 
       
   255 \footnotesize a simple Scala function for reading webpages\\[-3mm]
       
   256 
       
   257 {\lstset{language=Scala}\fontsize{8}{10}\selectfont
       
   258 \texttt{\lstinputlisting{app0.scala}}}\pause
       
   259 {\lstset{language=Scala}\fontsize{8}{10}\selectfont
       
   260 \texttt{\lstinline{get_page("""http://www.inf.kcl.ac.uk/staff/urbanc/""")}}}\pause\bigskip
       
   261 
       
   262 
       
   263 \footnotesize slightly more complicated for handling errors properly:\\[-3mm]
       
   264 
       
   265 \footnotesize
       
   266 {\lstset{language=Scala}\fontsize{8}{10}\selectfont
       
   267 \texttt{\lstinputlisting{app1.scala}}}
       
   268 
       
   269 
       
   270 \end{frame}}
       
   271 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   272 
       
   273 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   274 \mode<presentation>{
       
   275 \begin{frame}[t]
       
   276 \frametitle{\begin{tabular}{c}A Regular Expression\end{tabular}}
       
   277 
       
   278 \begin{itemize}
       
   279 \item \ldots{} is a pattern or template for specifying strings
       
   280 \end{itemize}\bigskip
       
   281   
       
   282 \begin{center}  
       
   283 \only<1>{{\lstset{language=Scala}\fontsize{18}{19}\selectfont\bf
       
   284 \texttt{"https?://[$\hat{\hspace{2mm}}$"]*"}}}%
       
   285 \only<2>{{\lstset{language=Scala}\fontsize{18}{19}\selectfont\bf
       
   286 \texttt{"""\textbackslash{}"https?://[$\hat{\hspace{2mm}}$\textbackslash{}"]*\textbackslash{}"""".r}}}
       
   287 \end{center}\bigskip\bigskip
       
   288 
       
   289 matches for example\\  
       
   290 \;{\lstset{language=Scala}\fontsize{12}{14}\selectfont\bf
       
   291 \texttt{"http://www.foobar.com"}}\\
       
   292 \;{\lstset{language=Scala}\fontsize{12}{14}\selectfont\bf
       
   293 \texttt{"https://www.tls.org"}}\\
       
   294 
       
   295 \end{frame}}
       
   296 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   297 
       
   298 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   299 \mode<presentation>{
       
   300 \begin{frame}[c]
       
   301 
       
   302 {\lstset{language=Scala}\fontsize{18}{19}\selectfont\bf
       
   303 \texttt{rexp.findAllIn(string)}}\medskip
       
   304   
       
   305 returns a list of all (sub)strings that match the regular expression\bigskip\bigskip  
       
   306   
       
   307 {\lstset{language=Scala}\fontsize{18}{19}\selectfont\bf
       
   308 \texttt{rexp.findFirstIn(string)}}\medskip
       
   309   
       
   310 returns either {\bf\texttt{None}} if no (sub)string matches 
       
   311 or {\bf\texttt{Some(s)}} with the first (sub)string
       
   312   
       
   313 \end{frame}}
       
   314 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   315 
       
   316 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   317 \mode<presentation>{
       
   318 \begin{frame}[c]
       
   319 
       
   320 {\lstset{language=Scala}\fontsize{8}{10}\selectfont
       
   321 \texttt{\lstinputlisting{app2.scala}}}\medskip
       
   322 
       
   323 {\lstset{language=Scala}\fontsize{8}{10}\selectfont
       
   324 \texttt{crawl(some\_start\_URL, 2)}}\
       
   325 
       
   326 \end{frame}}
       
   327 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   328 
       
   329 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   330 \mode<presentation>{
       
   331 \begin{frame}[c]
       
   332 
       
   333 \footnotesize
       
   334 a version that only ``crawls'' links in my domain:
       
   335 
       
   336 {\lstset{language=Scala}\fontsize{8}{10}\selectfont
       
   337 \texttt{\lstinputlisting{app3.scala}}}
       
   338 
       
   339 
       
   340 \end{frame}}
       
   341 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   342 
       
   343 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   344 \mode<presentation>{
       
   345 \begin{frame}[c]
       
   346 
       
   347 \footnotesize
       
   348 a little email ``harvester'':
       
   349 
       
   350 {\lstset{language=Scala}\fontsize{8}{10}\selectfont
       
   351 \texttt{\lstinputlisting{app4.scala}}}\bigskip
       
   352 
       
   353 \tiny
       
   354 \textcolor{gray}{\url{http://net.tutsplus.com/tutorials/other/8-regular-expressions-you-should-know/}}
       
   355 
       
   356 \end{frame}}
       
   357 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   358 
       
   359 \newcommand{\bl}[1]{\textcolor{blue}{#1}}       
       
   360 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   109 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   361 \mode<presentation>{
   110 \mode<presentation>{
   362 \begin{frame}[c]
   111 \begin{frame}[c]
   363 \frametitle{\begin{tabular}{c}Regular Expressions\end{tabular}}
   112 \frametitle{\begin{tabular}{c}Regular Expressions\end{tabular}}
   364 
   113 
   376 \end{frame}}
   125 \end{frame}}
   377 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   126 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   378 
   127 
   379 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   128 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   380 \mode<presentation>{
   129 \mode<presentation>{
   381 \begin{frame}[t]
       
   382 \frametitle{\begin{tabular}{c}Regular Expressions\end{tabular}}
       
   383 
       
   384 {\lstset{language=Scala}\fontsize{8}{10}\selectfont
       
   385 \texttt{\lstinputlisting{app51.scala}}}
       
   386 
       
   387   
       
   388 \end{frame}}
       
   389 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   390 
       
   391 \newcommand{\dn}{\stackrel{\mbox{\scriptsize def}}{=}}% for definitions
       
   392 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   393 \mode<presentation>{
       
   394 \begin{frame}[c]
   130 \begin{frame}[c]
   395 \frametitle{\begin{tabular}{c}The Meaning of a\\[-2mm] Regular Expression\end{tabular}}
   131 \frametitle{\begin{tabular}{c}The Meaning of a\\[-2mm] Regular Expression\end{tabular}}
   396 
   132 
   397 \begin{textblock}{15}(1,4)
   133 \begin{textblock}{15}(1,4)
   398  \begin{tabular}{@ {}rcl}
   134  \begin{tabular}{@ {}rcl}
   399  \bl{$L$($\varnothing$)}  & \bl{$\dn$} & \bl{$\varnothing$}\\
   135  \bl{$L$($\varnothing$)}  & \bl{$\dn$} & \bl{$\varnothing$}\\
   400  \bl{$L$($\epsilon$)}        & \bl{$\dn$} & \bl{$\{$""$\}$}\\
   136  \bl{$L$($\epsilon$)}        & \bl{$\dn$} & \bl{$\{$""$\}$}\\
   401  \bl{$L$(c)}                         & \bl{$\dn$} & \bl{$\{$"c"$\}$}\\
   137  \bl{$L$(c)}                         & \bl{$\dn$} & \bl{$\{$"c"$\}$}\\
   402  \bl{$L$(r$_1$ + r$_2$)} & \bl{$\dn$} & \bl{$L$(r$_1$) $\cup$ $L$(r$_2$)}\\
   138  \bl{$L$(r$_1$ + r$_2$)} & \bl{$\dn$} & \bl{$L$(r$_1$) $\cup$ $L$(r$_2$)}\\
   403  \bl{$L$(r$_1$ $\cdot$ r$_2$)}  & \bl{$\dn$} & \bl{$\{$ s$_1$ @ s$_2$ $|$ s$_1$ $\in$ $L$(r$_1$) $\wedge$ s$_2$ $\in$ 
   139  \bl{$L$(r$_1$ $\cdot$ r$_2$)}  & \bl{$\dn$} & \bl{$L$(r$_1$) @ $L$(r$_2$)}\\
   404      $L$(r$_2$) $\}$}\\
   140  \bl{$L$(r$^*$)}                   & \bl{$\dn$} & \bl{$\bigcup_{n \ge 0}$ $L$(r)$^n$}\\
   405  \bl{$L$(r$^*$)}                   & \bl{$\dn$} & \onslide<4->{\bl{$\bigcup_{n \ge 0}$ $L$(r)$^n$}}\\
       
   406   \end{tabular}\bigskip
   141   \end{tabular}\bigskip
   407   
   142   
   408 \onslide<2->{
   143 \hspace{5mm}\textcolor{gray}{$L$(r)$^0$ $\;\dn\;$ $\{$""$\}$}\\
   409 \hspace{5mm}\bl{$L$(r)$^0$ $\;\dn\;$ $\{$""$\}$}\\
   144 \textcolor{gray}{$L$(r)$^{n+1}$ $\;\dn\;$ $L$(r) @ $L$(r)$^n$}  
   410 \bl{$L$(r)$^{n+1}$ $\;\dn\;$ $L$(r) @ $L$(r)$^n$}\hspace{9mm}\onslide<3->{\small\textcolor{gray}{(append on sets)}\\
   145 \end{textblock}
   411 \small\hspace{5cm}\textcolor{gray}{$\{$ s$_1$ @ s$_2$ $|$ s$_1$ $\in$ $L$(r) $\wedge$ s$_2$ $\in$ 
   146 
   412      $L$(r)$^n$ $\}$}}
   147 \end{frame}}
   413 }  
   148 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   414     \end{textblock}
   149 
   415 
   150 \newcommand{\YES}{\textcolor{gray}{yes}}
   416 \end{frame}}
   151 \newcommand{\NO}{\textcolor{gray}{no}}
   417 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   152 \newcommand{\FORALLR}{\textcolor{gray}{$\forall$ r.}}
   418 
   153 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   419 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   154 \mode<presentation>{
   420 \mode<presentation>{
   155 \begin{frame}[c]
   421 \begin{frame}[c]
   156 \frametitle{\begin{tabular}{c}Reg Exp Equivalences\end{tabular}}
   422 \frametitle{\begin{tabular}{c}The Meaning of a Matching\end{tabular}}
   157 
       
   158 \begin{center}
       
   159 \begin{tabular}{lrcl@ {\hspace{7mm}}l}
       
   160 &\bl{(a + b)  + c} & \bl{$\equiv^?$} & \bl{a + (b + c)} & \onslide<2->{\YES}\\
       
   161 &\bl{a + a} & \bl{$\equiv^?$} & \bl{a} & \onslide<3->{\YES}\\
       
   162 &\bl{(a $\cdot$ b)  $\cdot$ c} & \bl{$\equiv^?$} & \bl{a $\cdot$ (b $\cdot$ c)} & \onslide<4->{\YES}\\
       
   163 &\bl{a $\cdot$ a} & \bl{$\equiv^?$} & \bl{a} & \onslide<5->{\NO}\\
       
   164 &\bl{$\epsilon^*$} & \bl{$\equiv^?$} & \bl{$\epsilon$} & \onslide<6->{\YES}\\
       
   165 &\bl{$\varnothing^*$} & \bl{$\equiv^?$} & \bl{$\varnothing$} & \onslide<7->{\NO}\\
       
   166 \FORALLR &\bl{r $\cdot$ $\epsilon$} & \bl{$\equiv^?$} & \bl{r} & \onslide<8->{\YES}\\
       
   167 \FORALLR &\bl{r + $\epsilon$} & \bl{$\equiv^?$} & \bl{r} & \onslide<9->{\NO}\\
       
   168 \FORALLR &\bl{r + $\varnothing$} & \bl{$\equiv^?$} & \bl{r} & \onslide<10->{\YES}\\
       
   169 \FORALLR &\bl{r $\cdot$ $\varnothing$} & \bl{$\equiv^?$} & \bl{r} & \onslide<11->{\NO}\\
       
   170 &\bl{c $\cdot$ (a + b)} & \bl{$\equiv^?$} & \bl{(c $\cdot$ a) + (c $\cdot$ b)} & \onslide<12->{\YES}\\
       
   171 &\bl{a$^*$} & \bl{$\equiv^?$} & \bl{$\epsilon$ + (a $\cdot$ a$^*$)} & \onslide<13->{\YES}
       
   172 \end{tabular}
       
   173 \end{center}
       
   174 
       
   175 \end{frame}}
       
   176 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   177 
       
   178 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   179 \mode<presentation>{
       
   180 \begin{frame}[c]
       
   181 \frametitle{\begin{tabular}{c}The Meaning of Matching\end{tabular}}
   423 
   182 
   424 \large
   183 \large
   425 a regular expression \bl{r} matches a string \bl{s} is defined as
   184 a regular expression \bl{r} matches a string \bl{s} is defined as
   426 
   185 
   427 \begin{center}
   186 \begin{center}
   428 \bl{s $\in$ $L$(r)}\\ 
   187 \bl{s $\in$ $L$(r)}\\ 
   429 \end{center}
   188 \end{center}\bigskip\bigskip\pause
   430 
   189 
   431 \end{frame}}
   190 \small
   432 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   191 if \bl{r$_1$ $\equiv$ r$_2$}, then \bl{$s$ $\in$ $L$(r$_1$)} iff \bl{$s$ $\in$ $L$(r$_2$)}
   433 
   192 
   434 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   193 \end{frame}}
   435 \mode<presentation>{
   194 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   436 \begin{frame}[c]
   195 
   437 \frametitle{\begin{tabular}{c}Nullability\end{tabular}}
   196 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   197 \mode<presentation>{
       
   198 \begin{frame}[t]
       
   199 \frametitle{\begin{tabular}{c}A Matching Algorithm\end{tabular}}
       
   200 
       
   201 \begin{itemize}
       
   202 \item given a regular expression \bl{r} and a string \bl{s}, say yes or no for whether
       
   203 \begin{center}
       
   204 \bl{s $\in$ $L$(r)}
       
   205 \end{center}\bigskip\bigskip\pause
       
   206 \only<2>{\item foo}%
       
   207 \only<3>{\item bar}
       
   208 \end{itemize}
       
   209 
       
   210 
       
   211 \end{frame}}
       
   212 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   213 
       
   214 
       
   215 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   216 \mode<presentation>{
       
   217 \begin{frame}[c]
       
   218 \frametitle{\begin{tabular}{c}An Matching Algorithm\end{tabular}}
   438 
   219 
   439 \small
   220 \small
   440 whether a regular expression matches the empty string:\medskip
   221 whether a regular expression matches the empty string:\medskip
   441 
   222 
   442 
   223