slides/slides01.tex
changeset 253 75c469893514
parent 252 e8ef8f38ca84
child 254 dcd4688690ce
equal deleted inserted replaced
252:e8ef8f38ca84 253:75c469893514
     4 \usepackage{../langs}
     4 \usepackage{../langs}
     5 \usepackage{../data}
     5 \usepackage{../data}
     6 
     6 
     7 \hfuzz=220pt 
     7 \hfuzz=220pt 
     8 
     8 
     9 %\setmonofont[Scale=.88]{Consolas}
     9 \newcommand{\bl}[1]{\textcolor{blue}{#1}}     
    10 %\newfontfamily{\consolas}{Consolas}
       
    11 %\usepackage{beamerthemeplaincu}
       
    12 %\usepackage{fontenc,xltxtra,xunicode}
       
    13 %\defaultfontfeatures{Mapping=tex-text}
       
    14 %\usepackage[absolute,overlay]{textpos}
       
    15 %\usepackage{ifthen}
       
    16 %\usepackage{tikz}
       
    17 %\usepackage{pgf}
       
    18 %\usepackage{calc} 
       
    19 %\usepackage{ulem}
       
    20 %\usepackage{listings}
       
    21 %\renewcommand{\uline}[1]{#1}
       
    22 %\usetikzlibrary{arrows}
       
    23 %\usetikzlibrary{automata}
       
    24 %\usetikzlibrary{shapes}
       
    25 %\usetikzlibrary{shadows}
       
    26 %\usetikzlibrary{positioning}
       
    27 %\usetikzlibrary{calc}
       
    28 %\usetikzlibrary{plotmarks}
       
    29 %\usepackage{graphicx} 
       
    30 %\usepackage{pgfplots}
       
    31 %\usepackage{../langs}
       
    32 %\usepackage{../data}
       
    33 
       
    34 %\makeatletter
       
    35 %\lst@CCPutMacro\lst@ProcessOther {"2D}{\lst@ttfamily{-{}}{-{}}}
       
    36 %\@empty\z@\@empty
       
    37 %\makeatother
       
    38 
    10 
    39 % beamer stuff 
    11 % beamer stuff 
    40 \renewcommand{\slidecaption}{AFL 01, King's College London}
    12 \renewcommand{\slidecaption}{AFL 01, King's College London}
    41 
    13 
    42 
    14 
    43 \begin{document}
    15 \begin{document}
    44 
    16 
    45 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    17 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    46 \mode<presentation>{
    18 \begin{frame}[t]
    47 \begin{frame}<1>[t]
       
    48 \frametitle{%
    19 \frametitle{%
    49   \begin{tabular}{@ {}c@ {}}
    20   \begin{tabular}{@ {}c@ {}}
    50   \\[-3mm]
    21   \\[-3mm]
    51   \LARGE Automata and \\[-2mm] 
    22   \LARGE Automata and \\[-2mm] 
    52   \LARGE Formal Languages (1)\\[-3mm] 
    23   \LARGE Formal Languages (1)\\[-3mm] 
    66   Slides: & KEATS
    37   Slides: & KEATS
    67   \end{tabular}
    38   \end{tabular}
    68   \end{center}
    39   \end{center}
    69 
    40 
    70 
    41 
    71 \end{frame}}
    42 \end{frame}
    72  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
    43  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
    73 
    44 
    74 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    45 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    75 \mode<presentation>{
       
    76 \begin{frame}[c]
    46 \begin{frame}[c]
    77 
    47 
    78 \begin{textblock}{1}(2,5)
    48 \begin{textblock}{1}(2,5)
    79 \begin{tabular}{c}
    49 \begin{tabular}{c}
    80 \includegraphics[scale=0.15]{pics/servers.png}\\[-2mm]
    50 \includegraphics[scale=0.15]{pics/servers.png}\\[-2mm]
   112 \begin{itemize}
    82 \begin{itemize}
   113 \item programming languages, compilers
    83 \item programming languages, compilers
   114 \end{itemize}
    84 \end{itemize}
   115 \end{textblock}}
    85 \end{textblock}}
   116   
    86   
   117   
    87 \end{frame}
   118 \end{frame}}
    88 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   119 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
    89 
   120 
    90 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   121 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   122 \mode<presentation>{
       
   123 \begin{frame}[c]
    91 \begin{frame}[c]
   124 
    92 
   125 transforming strings into structured data\\[10mm]
    93 transforming strings into structured data\\[10mm]
   126 
    94 
   127 {\LARGE\bf Lexing}\medskip\\
    95 {\LARGE\bf Lexing}\medskip\\
   128 \hspace{5mm}(recognising ``words'')\\[6mm]
    96 \hspace{5mm}(recognising ``words'')\\[6mm]
   129 
    97 
   130 {\LARGE\bf Parsing}\medskip\\
    98 {\LARGE\bf Parsing}\medskip\\
   131 \hspace{5mm}(recognising ``sentences'')
    99 \hspace{5mm}(recognising ``sentences'')
   132 
   100 
   133 \end{frame}}
   101 \end{frame}
   134 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
   102 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
   135 
   103 
   136 
   104 
   137 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   105 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   138 \mode<presentation>{
       
   139 \begin{frame}[c]
   106 \begin{frame}[c]
   140 
   107 
   141 The subject is quite old:
   108 The subject is quite old:
   142 
   109 
   143 \begin{itemize}
   110 \begin{itemize}
   151 \footnotesize\textcolor{gray}{Grace Hopper}
   118 \footnotesize\textcolor{gray}{Grace Hopper}
   152 \end{flushright}
   119 \end{flushright}
   153 
   120 
   154 {\footnotesize\textcolor{gray}{(she made it to David Letterman's Tonight Show, \url{http://www.youtube.com/watch?v=aZOxtURhfEU})}}
   121 {\footnotesize\textcolor{gray}{(she made it to David Letterman's Tonight Show, \url{http://www.youtube.com/watch?v=aZOxtURhfEU})}}
   155 
   122 
   156 \end{frame}}
   123 \end{frame}
   157 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
   124 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
   158 
   125 
   159 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   126 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   160 \mode<presentation>{
   127 \mode<presentation>{
   161 \begin{frame}[c]
   128 \begin{frame}[c]
   189 
   156 
   190 \end{frame}}
   157 \end{frame}}
   191 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   158 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   192 
   159 
   193 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   160 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   194 \mode<presentation>{
   161 \begin{frame}[t]
   195 \begin{frame}[t]
   162 \frametitle{A Web-Crawler}
   196 \frametitle{\begin{tabular}{c}A Web-Crawler\end{tabular}}
       
   197 
   163 
   198 \mbox{}\\[10mm]
   164 \mbox{}\\[10mm]
   199 
   165 
   200 \begin{enumerate}
   166 \begin{enumerate}
   201 \item given an URL, read the corresponding webpage
   167 \item given an URL, read the corresponding webpage
   202 \item extract all links from it
   168 \item extract all links from it
   203 \item call the web-crawler again for all these links
   169 \item call the web-crawler again for all these links
   204 \end{enumerate}
   170 \end{enumerate}
   205 
   171 
   206 \end{frame}}
   172 \end{frame}
   207 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   173 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   208 
   174 
   209 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   175 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   210 \mode<presentation>{
   176 \mode<presentation>{
   211 \begin{frame}[t]
   177 \begin{frame}[t]
   212 \frametitle{\begin{tabular}{c}A Web-Crawler\end{tabular}}
   178 \frametitle{A Web-Crawler}
   213 
   179 
   214 \mbox{}\\[10mm]
   180 \mbox{}\\[10mm]
   215 
   181 
   216 
   182 
   217 \begin{enumerate}
   183 \begin{enumerate}
   226 \small (the purpose is to check all links on my own webpage)
   192 \small (the purpose is to check all links on my own webpage)
   227 \end{frame}}
   193 \end{frame}}
   228 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   194 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   229 
   195 
   230 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   196 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   231 \mode<presentation>{
   197 \begin{frame}[c]
   232 \begin{frame}[c]
   198 \frametitle{Scala}
   233 \frametitle{\begin{tabular}{c}Scala\end{tabular}}
   199 
   234 
   200 \small a simple Scala function for reading webpages
   235 \small a simple Scala function for reading webpages\\[-3mm]
   201 
   236 
   202 \footnotesize
   237 \footnotesize
   203 \lstinputlisting{../progs/app0.scala}\pause
   238 {\lstset{language=Scala}\texttt{\lstinputlisting{../progs/app0.scala}}}\pause
   204 \lstinline{get_page("""http://www.inf.kcl.ac.uk/staff/urbanc/""")}\pause\bigskip
   239 {\lstset{language=Scala}\texttt{\lstinline{get_page("""http://www.inf.kcl.ac.uk/staff/urbanc/""")}}}\pause\bigskip
   205 
   240 
   206 
   241 
   207 \small slightly more complicated for handling errors properly:
   242 \small slightly more complicated for handling errors properly:\\[-3mm]
   208 
   243 
   209 \footnotesize
   244 \footnotesize
   210 \lstinputlisting{../progs/app1.scala}
   245 {\lstset{language=Scala}\texttt{\lstinputlisting{../progs/app1.scala}}}
   211 
   246 
   212 
   247 
   213 \end{frame}
   248 \end{frame}}
   214 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   249 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   215 
   250 
   216 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   251 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   217 \begin{frame}[c]
   252 \mode<presentation>{
   218 \frametitle{Why Scala?}
   253 \begin{frame}[c]
       
   254 \frametitle{\begin{tabular}{c}Why Scala?\end{tabular}}
       
   255 
   219 
   256 \begin{textblock}{6}(1,3)
   220 \begin{textblock}{6}(1,3)
   257 \begin{tabular}{l}
   221 \begin{tabular}{l}
   258 \mbox{}\hspace{-1mm}\includegraphics[scale=0.36]{pics/twitter.png}\\[-1mm]
   222 \mbox{}\hspace{-1mm}\includegraphics[scale=0.36]{pics/twitter.png}\\[-1mm]
   259 \includegraphics[scale=0.30]{pics/linked.png}\\
   223 \includegraphics[scale=0.30]{pics/linked.png}\\
   298 \end{textblock}}
   262 \end{textblock}}
   299 
   263 
   300 
   264 
   301 \only<5->{
   265 \only<5->{
   302 \begin{textblock}{1}(3,6)
   266 \begin{textblock}{1}(3,6)
   303 \begin{tikzpicture}
   267 \begin{bubble}[8.5cm]
   304 \draw (0,0) node[inner sep=2mm,fill=cream, ultra thick, draw=red, rounded corners=2mm] 
   268 \normalsize
   305 {\normalsize\color{darkgray}
   269 Scala is a functional and object-oriented programming
   306 \begin{minipage}{8.5cm}\raggedright\normalsize
   270 language; compiles to the JVM; does not need null-pointer
   307 Scala is a functional and object-oriented programming language; compiles to the JVM; does not 
   271 exceptions; a course on Coursera\\
   308 need null-pointer exceptions; a course on Coursera\\
   272 \mbox{}\hfill\url{http://www.scala-lang.org}
   309 \mbox{}\hfill\textcolor{blue}{\url{http://www.scala-lang.org}}
   273 \end{bubble}
   310 \end{minipage}};
       
   311 \end{tikzpicture}
       
   312 \end{textblock}}
   274 \end{textblock}}
   313 
   275 
   314   
   276 \end{frame}
   315 \end{frame}}
   277 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   316 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   278 
   317 
   279 
   318 
   280 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   319 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   281 \begin{frame}[t]
   320 \mode<presentation>{
   282 \frametitle{A Regular Expression}
   321 \begin{frame}[t]
       
   322 \frametitle{\begin{tabular}{c}A Regular Expression\end{tabular}}
       
   323 
   283 
   324 \begin{itemize}
   284 \begin{itemize}
   325 \item \ldots{} is a pattern or template for specifying strings
   285 \item \ldots{} is a pattern or template for specifying strings
   326 \end{itemize}\bigskip
   286 \end{itemize}\bigskip
   327   
   287   
   328 \begin{center}  
   288 \begin{center}  
   329 \only<1>{{\lstset{language=Scala}\fontsize{18}{19}\selectfont\bf
   289 \only<1>{\code{"https?://[^\"]*"}}%
   330 \texttt{"https?://[$\hat{\hspace{2mm}}$"]*"}}}%
   290 \only<2>{\code{""""https?://[^\"]*"""".r}}
   331 \only<2>{{\lstset{language=Scala}\fontsize{18}{19}\selectfont\bf
       
   332 \texttt{"""\textbackslash{}"https?://[$\hat{\hspace{2mm}}$\textbackslash{}"]*\textbackslash{}"""".r}}}
       
   333 \end{center}\bigskip\bigskip
   291 \end{center}\bigskip\bigskip
   334 
   292 
   335 matches for example\\  
   293 matches for example\\  
   336 \;{\lstset{language=Scala}\fontsize{12}{14}\selectfont\bf
   294 \code{"http://www.foobar.com"}\\
   337 \texttt{"http://www.foobar.com"}}\\
   295 \code{"https://www.tls.org"}\\
   338 \;{\lstset{language=Scala}\fontsize{12}{14}\selectfont\bf
   296 
   339 \texttt{"https://www.tls.org"}}\\
   297 \end{frame}
   340 
   298 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   341 \end{frame}}
   299 
   342 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   300 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   343 
   301 \begin{frame}[c]
   344 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   302 
   345 \mode<presentation>{
   303 \code{rexp.findAllIn(string)}\medskip
   346 \begin{frame}[c]
   304   
   347 
   305 returns a list of all (sub)strings that match the 
   348 {\lstset{language=Scala}\fontsize{18}{19}\selectfont\bf
   306 regular expression\bigskip\bigskip  
   349 \texttt{rexp.findAllIn(string)}}\medskip
   307   
   350   
   308 \code{rexp.findFirstIn(string)}\medskip
   351 returns a list of all (sub)strings that match the regular expression\bigskip\bigskip  
   309   
   352   
   310 returns either \code{None} if no (sub)string matches 
   353 {\lstset{language=Scala}\fontsize{18}{19}\selectfont\bf
   311 or \code{Some(s)} with the first (sub)string
   354 \texttt{rexp.findFirstIn(string)}}\medskip
   312   
   355   
   313 \end{frame}
   356 returns either {\bf\texttt{None}} if no (sub)string matches 
   314 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   357 or {\bf\texttt{Some(s)}} with the first (sub)string
   315 
   358   
   316 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   359 \end{frame}}
   317 \begin{frame}[c]
   360 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   318 
   361 
   319 \footnotesize
   362 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   320 \lstinputlisting{../progs/app2.scala}\medskip
   363 \mode<presentation>{
   321 
   364 \begin{frame}[c]
   322 \code{crawl(some_start_URL, 2)}\
   365 
   323 
   366 \small
   324 \end{frame}
   367 {\lstset{language=Scala}\texttt{\lstinputlisting{../progs/app2.scala}}}\medskip
   325 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   368 
   326 
   369 {\lstset{language=Scala}\texttt{crawl(some\_start\_URL, 2)}}\
   327 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   370 
       
   371 \end{frame}}
       
   372 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   373 
       
   374 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   375 \mode<presentation>{
       
   376 \begin{frame}[c]
   328 \begin{frame}[c]
   377 
   329 
   378 \footnotesize
   330 \footnotesize
   379 a version that only ``crawls'' links in my domain:
   331 a version that only ``crawls'' links in my domain:
   380 
   332 
   381 \small
   333 \lstinputlisting{../progs/app3.scala}
   382 {\lstset{language=Scala}\texttt{\lstinputlisting{../progs/app3.scala}}}
   334 
   383 
   335 \end{frame}
   384 
   336 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   385 \end{frame}}
   337 
   386 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   338 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   387 
       
   388 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   389 \mode<presentation>{
       
   390 \begin{frame}[c]
   339 \begin{frame}[c]
   391 
   340 
   392 \footnotesize
   341 \footnotesize
   393 a little email ``harvester'':
   342 a little email ``harvester'':
   394 
   343 
   395 \small
   344 \footnotesize
   396 {\lstset{language=Scala}\texttt{\lstinputlisting{../progs/app4.scala}}}\bigskip
   345 \lstinputlisting{../progs/app4.scala}\bigskip
   397 
   346 
   398 \tiny
   347 \tiny
   399 \textcolor{gray}{\url{http://net.tutsplus.com/tutorials/other/8-regular-expressions-you-should-know/}}
   348 \url{http://net.tutsplus.com/tutorials/other/8-regular-expressions-you-should-know/}
   400 
   349 
   401 \end{frame}}
   350 \end{frame}
   402 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   351 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   403 
   352 
   404 \newcommand{\bl}[1]{\textcolor{blue}{#1}}       
   353 
   405 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   354   
   406 \mode<presentation>{
   355 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   407 \begin{frame}[t]
   356 \begin{frame}[t]
   408 \frametitle{\begin{tabular}{c}Regular Expressions\end{tabular}}
   357 \frametitle{\begin{tabular}{c}Regular Expressions\end{tabular}}
   409 
   358 
   410 Their inductive definition:\medskip
   359 Their inductive definition:\medskip
   411 
   360 
   422   
   371   
   423 \end{frame}}
   372 \end{frame}}
   424 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   373 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   425 
   374 
   426 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   375 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   427 \mode<presentation>{
   376 \begin{frame}[t]
   428 \begin{frame}[t]
   377 \frametitle{Regular Expressions}
   429 \frametitle{\begin{tabular}{c}Regular Expressions\end{tabular}}
       
   430 
   378 
   431 \small
   379 \small
   432 In Scala:
   380 In Scala:
   433 
   381 
   434 
   382 \footnotesize
   435 {\lstset{language=Scala}\fontsize{8}{10}\selectfont
   383 \lstinputlisting{../progs/app51.scala}
   436 \texttt{\lstinputlisting{../progs/app51.scala}}}
   384 
   437 
   385   
   438   
   386 \end{frame}
   439 \end{frame}}
   387 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   440 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   388 
   441 
       
   442 \newcommand{\dn}{\stackrel{\mbox{\scriptsize def}}{=}}% for definitions
       
   443 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   389 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   444 \mode<presentation>{
   390 \mode<presentation>{
   445 \begin{frame}[c]
   391 \begin{frame}[c]
   446 \frametitle{\begin{tabular}{c}The Meaning of a\\[-2mm] Regular Expression\end{tabular}}
   392 \frametitle{\begin{tabular}{c}The Meaning of a\\[-2mm] 
       
   393   Regular Expression\end{tabular}}
   447 
   394 
   448 \begin{textblock}{15}(1,4)
   395 \begin{textblock}{15}(1,4)
   449  \begin{tabular}{@ {}rcl}
   396  \begin{tabular}{@ {}rcl}
   450  \bl{$L$($\varnothing$)}  & \bl{$\dn$} & \bl{$\varnothing$}\\
   397  \bl{$L$($\varnothing$)}  & \bl{$\dn$} & \bl{$\varnothing$}\\
   451  \bl{$L$($\epsilon$)}        & \bl{$\dn$} & \bl{$\{$""$\}$}\\
   398  \bl{$L$($\epsilon$)}        & \bl{$\dn$} & \bl{$\{$""$\}$}\\
   502 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   449 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   503 
   450 
   504 
   451 
   505 
   452 
   506 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   453 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   507 \mode<presentation>{
   454 \begin{frame}[c]
   508 \begin{frame}[c]
   455 \frametitle{Written Exam}
   509 \frametitle{\begin{tabular}{c}Exam\end{tabular}}
   456 
   510 
   457 \begin{itemize}
   511 \begin{itemize}
   458 \item Accounts for 75\%.\bigskip
   512 \item The question ``Is this relevant for the exam?'' is not appreciated!\bigskip\\
   459 
   513 
   460 \item You will understand the question ``Is this relevant for
   514 Whatever is in the homework sheets (and is not marked ``optional'') is relevant for the
   461       the exam?'' is very demotivating for the lecturer!\bigskip\\
   515 exam.\\ No code needs to be written in the exam.
   462 
   516 \end{itemize}
   463 \item Deal: Whatever is in the homework (and is not marked
   517 
   464       ``optional'') is relevant for the exam.
   518 \end{frame}}
   465 \end{itemize}
   519 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   466 
   520 
   467 \end{frame}
       
   468 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   469 
       
   470 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   471 \begin{frame}[t]
       
   472 \frametitle{Coursework}
       
   473 
       
   474 \begin{itemize}
       
   475 \item Accounts for 25\%. Two strands. Choose \alert{\bf one}!\bigskip
       
   476 \end{itemize}
       
   477 
       
   478 \begin{columns}[t]
       
   479 \begin{column}{.5\textwidth}
       
   480 \underline{\bf Strand 1}\medskip
       
   481 \begin{itemize}
       
   482 \item four programming subtasks:
       
   483 \begin{itemize}
       
   484 \item matcher (5\%, 13.10.) 
       
   485 \item lexer (5\%, 03.11.)
       
   486 \item parser (5\%, 27.11.)
       
   487 \item compiler (10\%, 12.12.)
       
   488 \end{itemize}
       
   489 \end{itemize}
       
   490 \end{column}
       
   491 
       
   492 \hspace{-45pt}\vrule{}\hspace{10pt}
       
   493 
       
   494 \begin{column}{.5\textwidth}
       
   495 \underline{\bf Strand 2}\smallskip
       
   496 \begin{itemize}
       
   497 \item one task: prove the correctness of a regular expression matcher in 
       
   498 the Isabelle theorem prover
       
   499 \item 25\%, submission 12.12.
       
   500 \end{itemize}
       
   501 \end{column}
       
   502 \end{columns}\medskip
       
   503 
       
   504 \small
       
   505 \begin{itemize}
       
   506 \item Solving more than one strand will {\bf not} give you more 
       
   507 marks.\\[-2mm]
       
   508 \item The exam will contain in much, much smaller form 
       
   509 elements from both (but will also be in lectures and HW).
       
   510 \end{itemize}
       
   511 
       
   512 \end{frame}
       
   513 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   521 
   514 
   522 \end{document}
   515 \end{document}
   523 
   516 
   524 %%% Local Variables:  
   517 %%% Local Variables:  
   525 %%% mode: latex
   518 %%% mode: latex