slides/slides01.tex
author Christian Urban <christian.urban@kcl.ac.uk>
Mon, 07 Sep 2020 12:18:07 +0100
changeset 754 1c9a23304b85
parent 745 7dc3643a0cc5
child 756 f7c7a75e0583
permissions -rw-r--r--
ammonite
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
     1
% !TEX program = xelatex
743
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
     2
\documentclass[dvipsnames,14pt,t,xelatex,aspectratio=169,xcolor={table}]{beamer}
252
e8ef8f38ca84 added style files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
     3
\usepackage{../slides}
e8ef8f38ca84 added style files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
     4
\usepackage{../graphics}
215
828303e8e4af updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 98
diff changeset
     5
\usepackage{../langs}
828303e8e4af updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 98
diff changeset
     6
\usepackage{../data}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     7
754
1c9a23304b85 ammonite
Christian Urban <christian.urban@kcl.ac.uk>
parents: 745
diff changeset
     8
\usepackage{tcolorbox}
1c9a23304b85 ammonite
Christian Urban <christian.urban@kcl.ac.uk>
parents: 745
diff changeset
     9
\newtcolorbox{mybox}{colback=red!5!white,colframe=red!75!black}
1c9a23304b85 ammonite
Christian Urban <christian.urban@kcl.ac.uk>
parents: 745
diff changeset
    10
\newtcolorbox{mybox2}[1]{colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries,title=#1}
1c9a23304b85 ammonite
Christian Urban <christian.urban@kcl.ac.uk>
parents: 745
diff changeset
    11
\newtcolorbox{mybox3}[1]{colback=Cyan!5!white,colframe=Cyan!75!black,fonttitle=\bfseries,title=#1}
1c9a23304b85 ammonite
Christian Urban <christian.urban@kcl.ac.uk>
parents: 745
diff changeset
    12
743
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
    13
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
    14
252
e8ef8f38ca84 added style files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
    15
\hfuzz=220pt 
e8ef8f38ca84 added style files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
    16
254
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
    17
\lstset{language=Scala,
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
    18
        style=mystyle,
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
    19
        numbersep=0pt,
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
    20
        numbers=none,
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
    21
        xleftmargin=0mm}
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
    22
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
    23
\newcommand{\bl}[1]{\textcolor{blue}{#1}}     
559
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
    24
 
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    25
% beamer stuff 
428
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
    26
\renewcommand{\slidecaption}{CFL 01, King's College London}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    27
721
e3c64f22dd31 added slides from Rochester
Christian Urban <christian.urban@kcl.ac.uk>
parents: 637
diff changeset
    28
%% https://cs.rit.edu/~hh/teaching/_media/cc18/lectures/lect1/main.pdf
e3c64f22dd31 added slides from Rochester
Christian Urban <christian.urban@kcl.ac.uk>
parents: 637
diff changeset
    29
%% https://cs.rit.edu/~hh/teaching/_media/cc18/lectures/lect2/main.pdf
e3c64f22dd31 added slides from Rochester
Christian Urban <christian.urban@kcl.ac.uk>
parents: 637
diff changeset
    30
%% https://cs.rit.edu/~hh/teaching/_media/cc18/lectures/lect3/main.pdf
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    31
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    32
\begin{document}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    33
754
1c9a23304b85 ammonite
Christian Urban <christian.urban@kcl.ac.uk>
parents: 745
diff changeset
    34
\begin{frame}[t]
1c9a23304b85 ammonite
Christian Urban <christian.urban@kcl.ac.uk>
parents: 745
diff changeset
    35
\begin{mybox}
1c9a23304b85 ammonite
Christian Urban <christian.urban@kcl.ac.uk>
parents: 745
diff changeset
    36
A physical explanation the \emph{dynamic matrix}\\
1c9a23304b85 ammonite
Christian Urban <christian.urban@kcl.ac.uk>
parents: 745
diff changeset
    37
lots of text
1c9a23304b85 ammonite
Christian Urban <christian.urban@kcl.ac.uk>
parents: 745
diff changeset
    38
\end{mybox}
743
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
    39
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
    40
754
1c9a23304b85 ammonite
Christian Urban <christian.urban@kcl.ac.uk>
parents: 745
diff changeset
    41
\begin{mybox2}{Test}
1c9a23304b85 ammonite
Christian Urban <christian.urban@kcl.ac.uk>
parents: 745
diff changeset
    42
A physical explanation the \emph{dynamic matrix}\\
1c9a23304b85 ammonite
Christian Urban <christian.urban@kcl.ac.uk>
parents: 745
diff changeset
    43
lots of text
1c9a23304b85 ammonite
Christian Urban <christian.urban@kcl.ac.uk>
parents: 745
diff changeset
    44
\end{mybox2}
1c9a23304b85 ammonite
Christian Urban <christian.urban@kcl.ac.uk>
parents: 745
diff changeset
    45
1c9a23304b85 ammonite
Christian Urban <christian.urban@kcl.ac.uk>
parents: 745
diff changeset
    46
\begin{mybox3}{Test}
1c9a23304b85 ammonite
Christian Urban <christian.urban@kcl.ac.uk>
parents: 745
diff changeset
    47
A physical explanation the \emph{dynamic matrix}\\
1c9a23304b85 ammonite
Christian Urban <christian.urban@kcl.ac.uk>
parents: 745
diff changeset
    48
lots of text
1c9a23304b85 ammonite
Christian Urban <christian.urban@kcl.ac.uk>
parents: 745
diff changeset
    49
\end{mybox3}
1c9a23304b85 ammonite
Christian Urban <christian.urban@kcl.ac.uk>
parents: 745
diff changeset
    50
\end{frame}
1c9a23304b85 ammonite
Christian Urban <christian.urban@kcl.ac.uk>
parents: 745
diff changeset
    51
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    52
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
    53
\begin{frame}[t]
510
cu
parents: 507
diff changeset
    54
\frametitle{%  
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    55
  \begin{tabular}{@ {}c@ {}}
1
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
    56
  \\[-3mm]
428
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
    57
  \LARGE Compilers and \\[-1mm] 
743
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
    58
  \LARGE Formal Languages\\[-3mm] 
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    59
  \end{tabular}}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    60
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    61
  \begin{center}
507
fdbc7d0ec04f updated
Christian Urban <urbanc@in.tum.de>
parents: 506
diff changeset
    62
  %\includegraphics[scale=0.3]{pics/ante1.jpg}\hspace{5mm}
fdbc7d0ec04f updated
Christian Urban <urbanc@in.tum.de>
parents: 506
diff changeset
    63
  %\includegraphics[scale=0.31]{pics/ante2.jpg}\\
fdbc7d0ec04f updated
Christian Urban <urbanc@in.tum.de>
parents: 506
diff changeset
    64
  %\footnotesize\textcolor{gray}{Antikythera automaton, 100 BC (Archimedes?)}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    65
  \end{center}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    66
510
cu
parents: 507
diff changeset
    67
  \normalsize
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    68
  \begin{center}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    69
  \begin{tabular}{ll}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    70
  Email:  & christian.urban at kcl.ac.uk\\
743
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
    71
  %Office Hours: & Thursdays 12 -- 14\\
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
    72
  %Location: & N7.07 (North Wing, Bush House)\\
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
    73
  Slides \& Progs: & KEATS\\
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    74
  \end{tabular}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    75
  \end{center}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    76
743
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
    77
  \begin{center}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
    78
    \begin{tikzpicture}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
    79
      \node[drop shadow,fill=white,inner sep=0pt] 
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
    80
      {\footnotesize\rowcolors{1}{capri!10}{white}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
    81
        \begin{tabular}{|p{4.8cm}|p{4.8cm}|}\hline
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
    82
          \cellcolor{blue!50}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
    83
          1 Introduction, Languages          & 6 While-Language \\
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
    84
          2 Regular Expressions, Derivatives & 7 Compilation, JVM \\
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
    85
          3 Automata, Regular Languages      & 8 Compiling Functional Languages \\
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
    86
          4 Lexing, Tokenising               & 9 Optimisations \\
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
    87
          5 Grammars, Parsing                & 10 LLVM \\ \hline
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
    88
        \end{tabular}%
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
    89
      };
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
    90
    \end{tikzpicture}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
    91
  \end{center}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
    92
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
    93
\end{frame}
559
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
    94
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    95
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    96
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
744
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
    97
\begin{frame}<1-11>[c]
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
    98
\frametitle{The Goal of this Module\ldots}
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
    99
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   100
\begin{center}
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   101
  \begin{tikzpicture}[scale=1,
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   102
                      node/.style={
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   103
                      rectangle,rounded corners=3mm,
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   104
                      very thick,draw=black!50,minimum height=18mm, minimum width=20mm,
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   105
                      top color=white,bottom color=black!20,drop shadow}]
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   106
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   107
  \node at (3.05, 1.8) {\Large\bf \ldots{} you write a compiler};
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   108
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   109
  \node (0) at (-2.3,0) {};  
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   110
  \node [above=5mm of 0]
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   111
  {\makebox[0mm]{\footnotesize
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   112
      \begin{tabular}{@{}l@{}}input\\[-1mm]program\end{tabular}}}; 
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   113
     
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   114
  \node (A) at (0,0)  [node] {};
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   115
  \node [below right] at (A.north west) {lexer};
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   116
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   117
  \node (B) at (3,0)  [node] {};
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   118
  \node [below right=1mm] at (B.north west) {\mbox{}\hspace{-1mm}parser};
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   119
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   120
  \node (C) at (6,0)  [node] {};
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   121
  \node [below right] at (C.north west) {\mbox{}\hspace{-1mm}code gen};
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   122
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   123
  \node (1) at (8.4,0) {};
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   124
  \node [above=5mm of 1]
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   125
  {\makebox[0mm]{\footnotesize
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   126
      \begin{tabular}{@{}r@{}}binary\\[-1mm]code\end{tabular}}};
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   127
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   128
  \draw [->,line width=4mm] (0) -- (A); 
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   129
  \draw [->,line width=4mm] (A) -- (B); 
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   130
  \draw [->,line width=4mm] (B) -- (C); 
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   131
  \draw [->,line width=4mm] (C) -- (1); 
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   132
  \end{tikzpicture}
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   133
  \end{center}
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   134
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   135
\only<2,3,4>{
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   136
\begin{textblock}{1}(1,2.1)
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   137
\begin{bubble}[9.8cm]
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   138
\normalsize
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   139
lexer input: a string\smallskip\\
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   140
\hspace{5mm}\code{"read(n);"}\medskip\\
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   141
lexer output: a sequence of tokens\smallskip\\
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   142
\hspace{5mm}\code{key(read) lpar id(n) rpar semi}
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   143
\end{bubble}
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   144
\end{textblock}} 
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   145
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   146
\only<3,4>{
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   147
\begin{textblock}{1}(6,7.8)
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   148
\begin{tabular}{c}
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   149
\includegraphics[scale=0.2]{../pics/rosetta.jpg}\\[-2mm]
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   150
\footnotesize lexing $\Rightarrow$ recognising words (Stone of Rosetta)
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   151
\end{tabular}
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   152
\end{textblock}}
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   153
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   154
\only<4>{
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   155
\begin{textblock}{1}(0.5,12)\small
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   156
\begin{tabular}{l@{}c@{}l}
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   157
  \pcode{if}    & $\;\Rightarrow\;$ & keyword\\
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   158
  \pcode{iffoo} & $\;\Rightarrow\;$ & identifier\\
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   159
\end{tabular}  
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   160
\end{textblock}}
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   161
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   162
\only<6>{
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   163
\begin{textblock}{1}(1,1.5)
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   164
\begin{bubble}[8.5cm]
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   165
\normalsize
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   166
parser input: a sequence of tokens\smallskip\\
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   167
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   168
{\small\hspace{5mm}\code{key(read) lpar id(n) rpar semi}}\smallskip\\
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   169
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   170
parser output: an abstract syntax tree\smallskip\\
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   171
\footnotesize
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   172
\hspace{2cm}\begin{tikzpicture}
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   173
  \node {\code{read}}
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   174
    child {node {\code{lpar}}}
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   175
    child {node {\code{n}}}
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   176
    child {node {\code{rpar}}};
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   177
\end{tikzpicture}
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   178
\end{bubble}
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   179
\end{textblock}}
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   180
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   181
\only<8,9>{
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   182
\begin{textblock}{1}(1,1.5)
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   183
\begin{bubble}[4cm]
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   184
\normalsize
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   185
code generation:\smallskip\\
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   186
\hspace{5mm}\code{istore 2}\\ 
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   187
\hspace{5mm}\code{iload 2}\\ 
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   188
\hspace{5mm}\code{ldc 10}\\
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   189
\hspace{5mm}\code{isub}\\
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   190
\hspace{5mm}\code{ifeq Label2}\\ 
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   191
\hspace{5mm}\code{iload 2}\\
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   192
\hspace{5mm}\code{...}\\
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   193
\end{bubble}
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   194
\end{textblock}}
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   195
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   196
\only<9>{
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   197
\begin{textblock}{6}(8.4,7)
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   198
\begin{bubble}[5cm]
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   199
\mbox{\begin{tikzpicture}[scale=0.58,rounded corners=0mm]
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   200
\begin{axis}[axis x line=bottom, axis y line=left, ylabel=secs,
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   201
    xlabel=n,
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   202
    enlargelimits=0.05,
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   203
    ybar interval=0.7, legend style=small]
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   204
\addplot file {interpreted2.data};
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   205
\addplot file {compiled2.data};
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   206
%\legend{interpreted, compiled}
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   207
\end{axis}
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   208
\end{tikzpicture}}
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   209
\end{bubble}
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   210
\end{textblock}}
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   211
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   212
\only<10>{
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   213
\begin{textblock}{6}(1,3)
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   214
  \begin{bubble}[11cm]
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   215
  Compiler explorers, e.g.: \url{https://gcc.godbolt.org}  
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   216
  \begin{tikzpicture}[]
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   217
  \node (0) at (-2.3,0) {\includegraphics[scale=0.3]{pics/csource.png}};
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   218
  \node (1) [right=35mm] at (0) {\includegraphics[scale=0.3]{pics/cassmbl.png}}; 
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   219
  \draw [->,line width=4mm, red] (0) -- (1);   
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   220
  \node (2) [below=20mm] at (0) {\LARGE\bf``source''};
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   221
  \node (3) [right=40mm] at (2) {\LARGE\bf``binary''};
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   222
  \draw [->,line width=1mm] (2) -- (3);   
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   223
\end{tikzpicture}
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   224
\end{bubble}
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   225
\end{textblock}}
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   226
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   227
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   228
\end{frame}
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   229
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   230
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   231
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   232
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   233
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
559
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   234
\begin{frame}[t]
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   235
\frametitle{Why Study Compilers?}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   236
743
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
   237
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
   238
John Regehr {\small(Univ.~Utah, LLVM compiler hacker)}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
   239
\here{https://blog.regehr.org/archives/1419}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
   240
\smallskip\\
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   241
559
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   242
\begin{bubble}[10.5cm]
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   243
  \bf ``\ldots{}It’s effectively a perpetual
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   244
  employment act for solid compiler hackers.''
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   245
\end{bubble}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   246
559
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   247
\onslide<1->{
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   248
\only<2>{
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   249
\begin{itemize}
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   250
\item {\bf Hardware is getting weirder
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   251
  rather than getting clocked faster.}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   252
559
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   253
\begin{itemize}
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   254
\item[]  ``Almost all processors are multicores nowadays and it looks
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   255
  like there is increasing asymmetry in resources across cores.
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   256
  Processors come with vector units, crypto accelerators etc. We have
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   257
  DSPs, GPUs, ARM big.little, and Xeon Phi. This is only scratching the
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   258
  surface.''
559
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   259
\end{itemize}  
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   260
\end{itemize}}
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   261
\only<3>{
559
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   262
\begin{itemize}
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   263
\item {\bf We’re getting tired of low-level languages and
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   264
    their associated security disasters.}
559
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   265
  
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   266
\begin{itemize}
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   267
\item [] ``We want to write new code, to whatever extent possible, in
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   268
  safer, higher-level languages. Compilers are caught right in the
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   269
  middle of these opposing trends: one of their main jobs is to help
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   270
  bridge the large and growing gap between increasingly high-level
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   271
  languages and increasingly wacky platforms.''
559
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   272
\end{itemize}  
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   273
\end{itemize}}}
1
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   274
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   275
\end{frame}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   276
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   277
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   278
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   279
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   280
\begin{frame}[c]
744
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   281
\frametitle{Why Bother with Compilers?}
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   282
  
745
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   283
\textbf{Boeing 777's}: First flight in 1994. They want to achieve
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   284
triple redundancy for potential hardware faults.
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   285
\here{http://www.citemaster.net/get/db3a81c6-548e-11e5-9d2e-00163e009cc7/R8.pdf}\bigskip
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   286
  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   287
They compile 1 Ada program to\medskip
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   288
  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   289
\begin{itemize}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   290
  \item Intel 80486
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   291
  \item Motorola 68040 (old Macintosh's)
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   292
  \item AMD 29050 (RISC chips used often in laser printers)
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   293
\end{itemize}\medskip\medskip
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   294
  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   295
using 3 independent compilers.\bigskip\pause
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   296
  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   297
\small Airbus uses C and static analysers. Recently started using CompCert.
745
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   298
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   299
\only<1->{%
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   300
\begin{textblock}{6}(8,4.5)
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   301
\includegraphics[scale=0.28]{../pics/777.png}
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   302
\end{textblock}}
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   303
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   304
\end{frame}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   305
%%%%%%%%%%%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   306
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   307
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   308
\begin{frame}[c]
745
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   309
\frametitle{Why Bother with Regexes?}
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   310
745
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   311
\begin{columns}[t,onlytextwidth]
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   312
\begin{column}{1.8cm}
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   313
\mbox{}   
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   314
\end{column}    
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   315
\begin{column}{.5\textwidth}
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   316
\small{}Ruby, Python, Java 8\medskip\\
428
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   317
\begin{tikzpicture}\footnotesize
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   318
\begin{axis}[
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   319
    xlabel={$n$},
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   320
    x label style={at={(1.05,0.0)}},
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   321
    ylabel={time in secs},
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   322
    enlargelimits=false,
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   323
    xtick={0,5,...,30},
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   324
    xmax=33,
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   325
    ymax=35,
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   326
    ytick={0,5,...,30},
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   327
    scaled ticks=false,
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   328
    axis lines=left,
745
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   329
    width=\textwidth,
428
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   330
    height=4cm, 
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   331
    legend entries={Python,Ruby},  
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   332
    legend pos=north west,
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   333
    legend cell align=left]
559
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   334
\addplot[blue,mark=*, mark options={fill=white}] table {re-python.data};
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   335
\addplot[brown,mark=triangle*, mark options={fill=white}] table {re-ruby.data};
428
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   336
\end{axis}
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   337
\end{tikzpicture}
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   338
\begin{tikzpicture}\footnotesize
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   339
\begin{axis}[
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   340
    xlabel={$n$},
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   341
    x label style={at={(1.05,0.0)}},
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   342
    ylabel={time in secs},
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   343
    enlargelimits=false,
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   344
    xtick={0,5,...,30},
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   345
    xmax=33,
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   346
    ymax=35,
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   347
    ytick={0,5,...,30},
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   348
    scaled ticks=false,
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   349
    axis lines=left,
745
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   350
    width=\textwidth,
428
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   351
    height=4cm, 
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   352
    legend entries={Python, Java 8, JavaScript},  
428
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   353
    legend pos=north west,
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   354
    legend cell align=left]
559
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   355
\addplot[blue,mark=*, mark options={fill=white}] table {re-python2.data};   
428
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   356
\addplot[cyan,mark=*, mark options={fill=white}] table {re-java.data};
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   357
\addplot[red,mark=*, mark options={fill=white}] table {re-js.data};
428
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   358
\end{axis}
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   359
\end{tikzpicture}
745
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   360
%
428
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   361
\end{column}
745
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   362
\begin{column}{.5\textwidth}
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   363
\small{}Us (after next lecture)\medskip\\
428
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   364
\begin{tikzpicture}\footnotesize
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   365
\begin{axis}[
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   366
    xlabel={$n$},
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   367
    x label style={at={(1.07,0.0)}},
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   368
    ylabel={time in secs},
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   369
    enlargelimits=false,
442
84d6714840c9 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 437
diff changeset
   370
    xtick={0,5000,...,10000},
84d6714840c9 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 437
diff changeset
   371
    xmax=11000,
428
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   372
    ymax=35,
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   373
    ytick={0,5,...,30},
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   374
    scaled ticks=false,
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   375
    axis lines=left,
745
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   376
    width=\textwidth,
428
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   377
    height=4cm]
437
fe387fcbf2ee updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 428
diff changeset
   378
\addplot[green,mark=square*,mark options={fill=white}] table {re2.data};
428
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   379
\addplot[black,mark=square*,mark options={fill=white}] table {re3.data};
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   380
\end{axis}
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   381
\end{tikzpicture}
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   382
\begin{tikzpicture}\footnotesize
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   383
\begin{axis}[
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   384
    xlabel={$n$},
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   385
    x label style={at={(1.07,0.0)}},
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   386
    ylabel={time in secs},
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   387
    enlargelimits=false,
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   388
    ymax=35,
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   389
    ytick={0,5,...,30},
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   390
    scaled ticks=false,
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   391
    axis lines=left,
745
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   392
    width=\textwidth,
428
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   393
    height=4cm]
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   394
\addplot[black,mark=square*,mark options={fill=white}] table {re3a.data};
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   395
\end{axis}
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   396
\end{tikzpicture}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   397
\end{column}
745
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   398
\end{columns}
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   399
\medskip
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   400
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   401
\begin{textblock}{3}(-0.1,3.3)
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   402
\small\hfill\bl{\texttt{[a?]\{n\}[a]\{n\}}}:
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   403
\end{textblock}
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   404
745
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   405
\begin{textblock}{3}(-0.1,8.7)  
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   406
\small\hfill\bl{\texttt{(a*)*b}}:
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   407
\end{textblock}
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   408
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   409
\begin{textblock}{3}(0.3,13)
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   410
\small{}matching with strings
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   411
\bl{$\underbrace{\texttt{a}...\texttt{a}}_n$}  
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   412
\end{textblock}
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   413
510
cu
parents: 507
diff changeset
   414
\end{frame} 
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   415
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   416
    
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   417
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   418
\begin{frame}[c,fragile]
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   419
  \frametitle{Incidents}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   420
    
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   421
  \begin{itemize}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   422
  \item a global outage on 2 July 2019 at \textbf{Cloudflare} 
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   423
  (first one for six years)\medskip
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   424
  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   425
  \begin{center}\small\color{blue}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   426
  \begin{verbatim}  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   427
  (?:(?:\"|'|\]|\}|\\|\d|(?:nan|infinity|true|false|
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   428
  null|undefined|symbol|math)|\`|\-|\+)+[)]*;?((?:\s
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   429
  |-|~|!|{}|\|\||\+)*.*(?:.*=.*)))  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   430
  \end{verbatim}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   431
  \end{center}\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip    
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   432
  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   433
  \item on 20 July 2016 the \textbf{Stack Exchange} webpage went down
745
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   434
    because of an evil regular expression
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   435
    \here{https://stackstatus.net/post/147710624694/outage-postmortem-july-20-2016}    
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   436
  \end{itemize}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   437
  
745
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   438
  \begin{textblock}{6}(6,7.6)
728
c669b39debe3 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 722
diff changeset
   439
    \includegraphics[scale=0.14]{../pics/cloudflare.png}\\
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   440
    \footnotesize
745
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   441
    It serves more web traffic than Twitter, Amazon, Apple,
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   442
    Instagram, Bing \& Wikipedia combined.
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   443
    \here{https://blog.cloudflare.com/details-of-the-cloudflare-outage-on-july-2-2019/}
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   444
    \end{textblock}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   445
  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   446
  \end{frame}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   447
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   448
    
560
99d2bb1f145c updated
Christian Urban <urbanc@in.tum.de>
parents: 559
diff changeset
   449
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
99d2bb1f145c updated
Christian Urban <urbanc@in.tum.de>
parents: 559
diff changeset
   450
\begin{frame}[c]
99d2bb1f145c updated
Christian Urban <urbanc@in.tum.de>
parents: 559
diff changeset
   451
\frametitle{Evil Regular Expressions}
99d2bb1f145c updated
Christian Urban <urbanc@in.tum.de>
parents: 559
diff changeset
   452
99d2bb1f145c updated
Christian Urban <urbanc@in.tum.de>
parents: 559
diff changeset
   453
\begin{itemize}
99d2bb1f145c updated
Christian Urban <urbanc@in.tum.de>
parents: 559
diff changeset
   454
\item \alert{R}egular \alert{e}xpression \alert{D}enial \alert{o}f \alert{S}ervice (ReDoS)\medskip
745
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   455
\item Some evil regular expressions:\medskip
560
99d2bb1f145c updated
Christian Urban <urbanc@in.tum.de>
parents: 559
diff changeset
   456
\begin{itemize}
745
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   457
\item \bl{\texttt{[a?]\{n\}\;[a]\{n\}}}
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   458
\item \bl{\texttt{(a*)*\;b}}  
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   459
\item \bl{\texttt{([a-z]+)*}} 
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   460
\item \bl{\texttt{(a + aa)*}}
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   461
\item \bl{\texttt{(a + a?)*}}
560
99d2bb1f145c updated
Christian Urban <urbanc@in.tum.de>
parents: 559
diff changeset
   462
\end{itemize}
99d2bb1f145c updated
Christian Urban <urbanc@in.tum.de>
parents: 559
diff changeset
   463
99d2bb1f145c updated
Christian Urban <urbanc@in.tum.de>
parents: 559
diff changeset
   464
\item sometimes also called \alert{catastrophic backtracking}
99d2bb1f145c updated
Christian Urban <urbanc@in.tum.de>
parents: 559
diff changeset
   465
\item this is a problem for \alert{N}etwork \alert{I}ntrusion
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   466
  \alert{D}etection systems, Cloudflare, StackExchange, Atom editor
560
99d2bb1f145c updated
Christian Urban <urbanc@in.tum.de>
parents: 559
diff changeset
   467
\item \url{https://vimeo.com/112065252}  
99d2bb1f145c updated
Christian Urban <urbanc@in.tum.de>
parents: 559
diff changeset
   468
\end{itemize}
99d2bb1f145c updated
Christian Urban <urbanc@in.tum.de>
parents: 559
diff changeset
   469
99d2bb1f145c updated
Christian Urban <urbanc@in.tum.de>
parents: 559
diff changeset
   470
\end{frame}
99d2bb1f145c updated
Christian Urban <urbanc@in.tum.de>
parents: 559
diff changeset
   471
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
428
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   472
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   473
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
745
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   474
\begin{frame}[t]
559
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   475
\frametitle{The Acad.~Subject is Mature}
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   476
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   477
\bigskip
559
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   478
\begin{itemize}
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   479
\item Turing Machines, 1936 (a tape as memory)
559
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   480
\item Regular Expressions, 1956\\
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   481
\item The first compiler for COBOL, 1957\\ (Grace Hopper)\medskip
559
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   482
\item But surprisingly research papers are still published nowadays\\
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   483
\item ``Parsing: The Solved Problem That Isn't''
745
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   484
  \here{https://tratt.net/laurie/blog/entries/parsing_the_solved_problem_that_isnt.html}
559
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   485
\end{itemize}
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   486
745
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   487
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   488
\begin{textblock}{8.5}(5,7.6)
559
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   489
\begin{flushright}
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   490
\includegraphics[scale=0.3]{pics/hopper.jpg}\\
745
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   491
\footnotesize\textcolor{gray}{Grace Hopper}\smallskip\\
559
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   492
745
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   493
{\small\textcolor{gray}{(she made it to David Letterman's Tonight Show
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   494
 \here{https://youtu.be/3N_ywhx6_K0?t=31})}}
559
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   495
\end{flushright}
745
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   496
\end{textblock}
559
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   497
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   498
\end{frame}
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   499
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   500
632
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   501
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   502
\begin{frame}[c]
745
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   503
\frametitle{What Do Compilers Do?}
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   504
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   505
Remember BF*** from PEP?
559
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   506
632
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   507
\begin{center}
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   508
\begin{tabular}{lcl}
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   509
\bl{\texttt{>}} & $\Rightarrow$ & move one cell right\\
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   510
\bl{\texttt{<}} & $\Rightarrow$ & move one cell left\\
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   511
\bl{\texttt{+}} & $\Rightarrow$ & increase cell by one\\
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   512
\bl{\texttt{-}} & $\Rightarrow$ & decrease cell by one\\
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   513
\bl{\texttt{.}} & $\Rightarrow$ & print current cell\\
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   514
\bl{\texttt{,}} & $\Rightarrow$ & input current cell\\
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   515
\bl{\texttt{[}} & $\Rightarrow$ & loop begin\\
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   516
\bl{\texttt{]}} & $\Rightarrow$ & loop end\medskip\\
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   517
                & $\Rightarrow$ & everything else is a comment\\
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   518
\end{tabular}  
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   519
\end{center}  
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   520
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   521
\end{frame}
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   522
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   523
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   524
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   525
\begin{frame}[c]
745
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   526
  \frametitle{A ``Compiler'' for BF*** to C}
632
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   527
  
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   528
  \begin{center}
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   529
  \begin{tabular}{lcl}
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   530
  \bl{\texttt{>}} & $\Rightarrow$ & \texttt{ptr++}\\
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   531
  \bl{\texttt{<}} & $\Rightarrow$ & \texttt{ptr--}\\
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   532
  \bl{\texttt{+}} & $\Rightarrow$ & \texttt{(*ptr)++}\\
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   533
  \bl{\texttt{-}} & $\Rightarrow$ & \texttt{(*ptr)--}\\
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   534
  \bl{\texttt{.}} & $\Rightarrow$ & \texttt{putchar(*ptr)}\\
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   535
  \bl{\texttt{,}} & $\Rightarrow$ & \texttt{*ptr = getchar()}\\
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   536
  \bl{\texttt{[}} & $\Rightarrow$ & \texttt{while(*ptr)\{}\\
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   537
  \bl{\texttt{]}} & $\Rightarrow$ & \texttt{\}}\medskip\\
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   538
                  & $\Rightarrow$ & ignore everything else\\
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   539
  \end{tabular}  
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   540
  \end{center}\bigskip  
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   541
  
743
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
   542
  \texttt{char field[30000]\\ char *ptr = \&field[15000]}
632
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   543
  
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   544
\end{frame}
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   545
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   546
    
559
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   547
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   548
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   549
\begin{frame}[c]
327
9470cd124667 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 255
diff changeset
   550
\frametitle{Lectures 1 - 5}
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   551
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   552
transforming strings into structured data\\[10mm]
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   553
506
12a8f57f68ea updated
Christian Urban <urbanc@in.tum.de>
parents: 505
diff changeset
   554
{\LARGE\bf Lexing} {\hfill{}based on regular expressions}\medskip\\
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   555
\hspace{5mm}(recognising ``words'')\\[6mm]
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   556
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   557
{\LARGE\bf Parsing}\medskip\\
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   558
\hspace{5mm}(recognising ``sentences'')
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   559
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   560
\begin{textblock}{1}(10,9.1)
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   561
\begin{tabular}{c}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   562
\includegraphics[scale=0.1]{../pics/rosetta.jpg}\\[-2mm]
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   563
\footnotesize Stone of Rosetta
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   564
\end{tabular}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   565
\end{textblock}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   566
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   567
\end{frame}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   568
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   569
636
96a91e4a8ac8 updated
Christian Urban <urbanc@in.tum.de>
parents: 635
diff changeset
   570
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
96a91e4a8ac8 updated
Christian Urban <urbanc@in.tum.de>
parents: 635
diff changeset
   571
\begin{frame}[c]
96a91e4a8ac8 updated
Christian Urban <urbanc@in.tum.de>
parents: 635
diff changeset
   572
  \frametitle{Lectures 5 - 10}
96a91e4a8ac8 updated
Christian Urban <urbanc@in.tum.de>
parents: 635
diff changeset
   573
  
745
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   574
  code generation for a small imperative and a small functional language\\[10mm]
636
96a91e4a8ac8 updated
Christian Urban <urbanc@in.tum.de>
parents: 635
diff changeset
   575
  
96a91e4a8ac8 updated
Christian Urban <urbanc@in.tum.de>
parents: 635
diff changeset
   576
  {\LARGE\bf Interpreters}\medskip\\
96a91e4a8ac8 updated
Christian Urban <urbanc@in.tum.de>
parents: 635
diff changeset
   577
  \hspace{5mm}(directly runs a program)\\[6mm]
96a91e4a8ac8 updated
Christian Urban <urbanc@in.tum.de>
parents: 635
diff changeset
   578
  
96a91e4a8ac8 updated
Christian Urban <urbanc@in.tum.de>
parents: 635
diff changeset
   579
  {\LARGE\bf Compilers}\medskip\\
745
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   580
  \hspace{5mm}(generate JVM code and LLVM-IR code)
636
96a91e4a8ac8 updated
Christian Urban <urbanc@in.tum.de>
parents: 635
diff changeset
   581
  
745
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   582
  \begin{textblock}{1}(8.8,8.1)
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   583
  \begin{tabular}{c@{}c}
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   584
    \includegraphics[scale=0.4]{../pics/javaduke.png} &
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   585
    \includegraphics[scale=0.23]{../pics/llvmlogo.png}
636
96a91e4a8ac8 updated
Christian Urban <urbanc@in.tum.de>
parents: 635
diff changeset
   586
  \end{tabular}
96a91e4a8ac8 updated
Christian Urban <urbanc@in.tum.de>
parents: 635
diff changeset
   587
  \end{textblock}
96a91e4a8ac8 updated
Christian Urban <urbanc@in.tum.de>
parents: 635
diff changeset
   588
  
96a91e4a8ac8 updated
Christian Urban <urbanc@in.tum.de>
parents: 635
diff changeset
   589
  \end{frame}
96a91e4a8ac8 updated
Christian Urban <urbanc@in.tum.de>
parents: 635
diff changeset
   590
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
96a91e4a8ac8 updated
Christian Urban <urbanc@in.tum.de>
parents: 635
diff changeset
   591
  
96a91e4a8ac8 updated
Christian Urban <urbanc@in.tum.de>
parents: 635
diff changeset
   592
96a91e4a8ac8 updated
Christian Urban <urbanc@in.tum.de>
parents: 635
diff changeset
   593
1
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   594
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   595
\begin{frame}[t]
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   596
\frametitle{Familiar Regular Expr.}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   597
\small
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   598
\begin{center}
560
99d2bb1f145c updated
Christian Urban <urbanc@in.tum.de>
parents: 559
diff changeset
   599
\texttt{[a-z0-9\_$\backslash{}$.-]+ @ [a-z0-9$\backslash{}$.-]+ . [a-z$\backslash{}$.]\{2,6\}}
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   600
\end{center}\smallskip
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   601
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   602
\begin{center}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   603
\begin{tabular}{@{}lp{8.5cm}@{}}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   604
\pcode{re*} & matches 0 or more times\\
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   605
\pcode{re+} & matches 1 or more times\\
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   606
\pcode{re?} & matches 0 or 1 times\\
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   607
\pcode{re\{n\}}	& matches exactly \pcode{n} number of times\\
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   608
\pcode{re\{n,m\}} & matches at least \pcode{n} and at most {\tt m} times\\
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   609
\pcode{[...]} & matches any single character inside the brackets\\
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   610
\pcode{[^...]} & matches any single character not inside the 
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   611
brackets\\
560
99d2bb1f145c updated
Christian Urban <urbanc@in.tum.de>
parents: 559
diff changeset
   612
\pcode{a-z A-Z} & character ranges\\
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   613
\pcode{\\d} & matches digits; equivalent to \pcode{[0-9]}\\
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   614
\pcode{.} & matches every character except newline\\
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   615
\pcode{(re)}	& groups regular expressions and remembers 
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   616
the matched text
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   617
\end{tabular}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   618
\end{center}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   619
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   620
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   621
\end{frame}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   622
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   623
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   624
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   625
%\begin{frame}[c]
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   626
%\frametitle{Today}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   627
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   628
%\begin{itemize}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   629
%\item While the ultimate goal is to implement a small compiler for the JVM
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   630
%  \ldots\bigskip
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   631
%\end{itemize}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   632
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   633
%Let's start with:
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   634
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   635
%\begin{itemize}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   636
%\item a web-crawler
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   637
%\item an email harvester
559
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   638
%\item \textcolor{gray}{(a web-scraper)}
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   639
%\end{itemize}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   640
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   641
%\end{frame}
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   642
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   643
2
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   644
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   645
%\begin{frame}[t]
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   646
%\frametitle{A Web-Crawler}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   647
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   648
%\mbox{}\\[10mm]
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   649
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   650
%\begin{enumerate}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   651
%\item given an URL, read the corresponding webpage
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   652
%\item extract all links from it
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   653
%\item call the web-crawler again for all these links
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   654
%\end{enumerate}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   655
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   656
%\end{frame}
2
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   657
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   658
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   659
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   660
%\begin{frame}[t]
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   661
%\frametitle{A Web-Crawler}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   662
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   663
%\mbox{}\\[10mm]
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   664
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   665
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   666
%\begin{enumerate}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   667
%\item given an URL, read the corresponding webpage
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   668
%\item if not possible print, out a problem
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   669
%\item if possible, extract all links from it
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   670
%\item call the web-crawler again for all these links
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   671
%\end{enumerate}\bigskip\pause
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   672
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   673
%\small (we need a bound for the number of recursive calls)
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   674
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   675
%\small (the purpose is to check all links on my own webpage)
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   676
%\end{frame}
2
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   677
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   678
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   679
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   680
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   681
%\begin{frame}[c]
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   682
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   683
%\begin{textblock}{1}(2,5)
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   684
%\begin{tabular}{c}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   685
%\includegraphics[scale=0.15]{pics/servers.png}\\[-2mm]
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   686
%\small Server
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   687
%\end{tabular}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   688
%\end{textblock}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   689
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   690
%\begin{textblock}{1}(5.6,4)
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   691
%  \begin{tikzpicture}[scale=1.1]
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   692
%  \draw[white] (0,1) node (X) {};
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   693
%  \draw[white] (2,1) node (Y) {};
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   694
%   \draw[white] (0,0) node (X1) {};
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   695
%  \draw[white] (2,0) node (Y1) {};
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   696
%   \draw[white] (0,-1) node (X2) {};
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   697
%  \draw[white] (2,-1) node (Y2) {};
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   698
%  \draw[red, <-, line width = 2mm] (X) -- (Y);
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   699
%  \node [inner sep=5pt,label=above:\textcolor{black}{GET request}] at ($ (X)!.5!(Y) $) {};
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   700
%  \draw[red, ->, line width = 2mm] (X1) -- (Y1);
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   701
%  \node [inner sep=5pt,label=above:\textcolor{black}{webpage}] at ($ (X1)!.5!(Y1) $) {};
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   702
%  \draw[red, <-, line width = 2mm] (X2) -- (Y2);
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   703
%  \node [inner sep=7pt,label=above:\textcolor{black}{POST data}] at ($ (X2)!.5!(Y2) $) {};
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   704
%  \end{tikzpicture}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   705
%\end{textblock}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   706
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   707
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   708
%\begin{textblock}{1}(9,5.5)
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   709
%\begin{tabular}{c}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   710
%\includegraphics[scale=0.15]{pics/laptop.png}\\[-2mm]
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   711
%\small Browser
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   712
%\end{tabular}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   713
%\end{textblock}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   714
%\end{frame}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   715
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   716
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   717
  
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   718
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   719
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   720
%\begin{frame}[c]
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   721
%\frametitle{Scala}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   722
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   723
%\small A simple Scala function for reading webpages:
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   724
%\bigskip
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   725
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   726
%\footnotesize
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   727
%\lstinputlisting{../progs/app0.scala}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   728
%\medskip\pause
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   729
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   730
%\lstinline{get_page("""https://nms.kcl.ac.uk/christian.urban/""")}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   731
%\bigskip\medskip\pause
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   732
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   733
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   734
%\small A slightly more complicated version for handling errors:
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   735
%\smallskip
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   736
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   737
%\footnotesize
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   738
%\lstinputlisting[xleftmargin=-4mm]{../progs/app1.scala}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   739
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   740
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   741
%\end{frame}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   742
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   743
98
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   744
 
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   745
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   746
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   747
\begin{frame}[t]
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   748
\frametitle{A Regular Expression}
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   749
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   750
\begin{itemize}
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   751
\item \ldots{} is a pattern or template for specifying strings
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   752
\end{itemize}\bigskip
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   753
  
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   754
\begin{center}  
254
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   755
\only<1>{\scode{"https?://[^"]*"}}%
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   756
\only<2>{\scode{""""https?://[^"]*"""".r}}
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   757
\end{center}\bigskip\bigskip
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   758
254
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   759
matches for example\smallskip\\  
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   760
\hspace{2mm}\code{"http://www.foobar.com"}\\
559
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   761
\hspace{2mm}\code{"https://www.tls.org"}\smallskip\\
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   762
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   763
but not\smallskip\\  
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   764
\hspace{2mm}\code{"http://www."foo"bar.com"}\\
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   765
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   766
\end{frame}
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   767
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   768
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   769
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
632
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   770
%\begin{frame}[c]
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   771
%\frametitle{Finding Operations in Scala}
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   772
%
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   773
%{\bf\code{rexp.findAllIn(string)}}\medskip
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   774
%  
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   775
%returns a list of all (sub)strings that match the 
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   776
%regular expression
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   777
%\bigskip\bigskip  
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   778
%  
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   779
%
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   780
%{\bf\code{rexp.findFirstIn(string)}}\medskip
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   781
% 
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   782
%returns either 
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   783
%
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   784
%\begin{itemize}
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   785
%\item \code{None} if no (sub)string matches or 
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   786
%\item \code{Some(s)} with the first (sub)string
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   787
%\end{itemize}
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   788
%
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   789
%\end{frame}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   790
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   791
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   792
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   793
%\begin{frame}[c]
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   794
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   795
%\footnotesize
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   796
%\lstinputlisting{../progs/app2.scala}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   797
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   798
%\end{frame}
254
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   799
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   800
254
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   801
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   802
%\begin{frame}[c]
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   803
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   804
%\small
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   805
%A version that only crawls links in ``my'' domain:\bigskip
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   806
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   807
%\footnotesize
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   808
%\lstinputlisting{../progs/app3.scala}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   809
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   810
%\end{frame}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   811
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   812
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   813
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   814
%\begin{frame}[c]
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   815
%\lstset{xleftmargin=-4mm}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   816
%\small
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   817
%A little email harvester:
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   818
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   819
%\footnotesize
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   820
%\lstinputlisting{../progs/app4.scala}\bigskip
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   821
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   822
%\tiny
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   823
%\url{http://net.tutsplus.com/tutorials/other/8-regular-expressions-you-should-know/}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   824
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   825
%\end{frame}
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   826
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   827
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   828
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
14
Christian Urban <urbanc@in.tum.de>
parents: 13
diff changeset
   829
\begin{frame}[t]
506
12a8f57f68ea updated
Christian Urban <urbanc@in.tum.de>
parents: 505
diff changeset
   830
\frametitle{Regular Expressions}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   831
330
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   832
Their inductive definition:
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   833
14
Christian Urban <urbanc@in.tum.de>
parents: 13
diff changeset
   834
330
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   835
\begin{textblock}{6}(2,7.5)
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   836
  \begin{tabular}{@ {}rrl@ {\hspace{13mm}}l}
512
a6aa52ecc1c5 updated
cu
parents: 510
diff changeset
   837
  \bl{$r$} & \bl{$::=$}  & \bl{$\ZERO$}  & nothing\\
428
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   838
         & \bl{$\mid$} & \bl{$\ONE$}       & empty string / \pcode{""} / $[]$\\
330
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   839
         & \bl{$\mid$} & \bl{$c$}                         & character\\
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   840
         & \bl{$\mid$} & \bl{$r_1 + r_2$}  & alternative / choice\\
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   841
         & \bl{$\mid$} & \bl{$r_1 \cdot r_2$} & sequence\\
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   842
         & \bl{$\mid$} & \bl{$r^*$}            & star (zero or more)\\
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   843
  \end{tabular}
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   844
  \end{textblock}
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   845
  
330
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   846
  
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   847
\only<2->{\footnotesize
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   848
\begin{textblock}{9}(2,0.5)
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   849
\begin{bubble}[9.8cm]
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   850
\lstinputlisting{../progs/app01.scala}
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   851
\end{bubble}
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   852
\end{textblock}}
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   853
  
254
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   854
\end{frame}
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   855
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   856
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   857
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
506
12a8f57f68ea updated
Christian Urban <urbanc@in.tum.de>
parents: 505
diff changeset
   858
%\begin{frame}[t]
12a8f57f68ea updated
Christian Urban <urbanc@in.tum.de>
parents: 505
diff changeset
   859
%\frametitle{Regular Expressions}
12a8f57f68ea updated
Christian Urban <urbanc@in.tum.de>
parents: 505
diff changeset
   860
%
12a8f57f68ea updated
Christian Urban <urbanc@in.tum.de>
parents: 505
diff changeset
   861
%\small
12a8f57f68ea updated
Christian Urban <urbanc@in.tum.de>
parents: 505
diff changeset
   862
%In Scala:\bigskip
12a8f57f68ea updated
Christian Urban <urbanc@in.tum.de>
parents: 505
diff changeset
   863
%
12a8f57f68ea updated
Christian Urban <urbanc@in.tum.de>
parents: 505
diff changeset
   864
%\footnotesize
12a8f57f68ea updated
Christian Urban <urbanc@in.tum.de>
parents: 505
diff changeset
   865
%\lstinputlisting{../progs/app51.scala}
12a8f57f68ea updated
Christian Urban <urbanc@in.tum.de>
parents: 505
diff changeset
   866
%
12a8f57f68ea updated
Christian Urban <urbanc@in.tum.de>
parents: 505
diff changeset
   867
%  
12a8f57f68ea updated
Christian Urban <urbanc@in.tum.de>
parents: 505
diff changeset
   868
%\end{frame}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   869
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   870
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   871
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   872
\begin{frame}[t]
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   873
\frametitle{Strings}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   874
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   875
\ldots are lists of characters. For example \code{"hello"}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   876
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   877
\begin{center}
330
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   878
\bl{$[h, e, l, l, o]$} or just \bl{$hello$}
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   879
\end{center}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   880
330
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   881
the empty string: \bl{$[]$} or \bl{\pcode{""}}\bigskip\\
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   882
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   883
the concatenation of two strings:
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   884
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   885
\begin{center}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   886
\bl{$s_1 \,@\, s_2$}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   887
\end{center}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   888
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   889
\bl{\textit{foo $@$ bar = foobar}}\\
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   890
\bl{\textit{baz $@\, []$ = baz}}
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   891
  
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   892
\end{frame}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   893
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   894
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   895
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
330
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   896
\begin{frame}[c]
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   897
\frametitle{Languages, Strings}
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   898
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   899
\begin{itemize}
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   900
\item \alert{\bf Strings} are lists of characters, for example
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   901
\begin{center}
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   902
\bl{$[]$},\;\bl{$abc$}  \hspace{2cm}(Pattern match: \bl{$c\!::\!s$})
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   903
\end{center}\bigskip
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   904
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   905
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   906
\item A \alert{\bf language} is a set of strings, for example\medskip
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   907
\begin{center}
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   908
\bl{$\{[], hello, \textit{foobar}, a, abc\}$}
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   909
\end{center}\bigskip
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   910
332
4755ad4b457b updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 331
diff changeset
   911
\item \alert{\bf Concatenation} of strings and languages
330
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   912
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   913
\begin{center}
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   914
\begin{tabular}{rcl}
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   915
\bl{$\textit{foo}\;@\;bar$} & \bl{$=$} & \bl{$\textit{foobar}$}\medskip\\
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   916
\bl{$A\;@\;B$} & \bl{$\dn$} & \bl{$\{ s_1\,@\,s_2 \;\mid\; s_1 \in A \wedge s_2 \in B\}$}
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   917
\end{tabular}
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   918
\end{center}
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   919
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   920
%\item The \alert{\bf meaning} of a regular expression is a set of 
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   921
%  strings, or language.
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   922
\end{itemize}  
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   923
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   924
\end{frame}
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   925
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   926
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   927
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   928
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   929
\begin{frame}[c]
745
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   930
\frametitle{The Meaning of a Regex}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   931
4
Christian Urban <urbanc@in.tum.de>
parents: 3
diff changeset
   932
\begin{textblock}{15}(1,4)
254
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   933
 \begin{tabular}{rcl}
428
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   934
 \bl{$L(\ZERO)$}  & \bl{$\dn$} & \bl{$\{\}$}\\
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   935
 \bl{$L(\ONE)$}     & \bl{$\dn$} & \bl{$\{[]\}$}\\
254
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   936
 \bl{$L(c)$}            & \bl{$\dn$} & \bl{$\{[c]\}$}\\
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   937
 \bl{$L(r_1 + r_2)$}    & \bl{$\dn$} & \bl{$L(r_1) \cup L(r_2)$}\\
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   938
 \bl{$L(r_1 \cdot r_2)$} & \bl{$\dn$} & \bl{$\{ s_1 \,@\, s_2 \;|\; s_1 \in L(r_1) \wedge s_2 \in L(r_2) \}$}\\
428
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   939
 \bl{$L(r^*)$}           & \bl{$\dn$} & \onslide<4->{\bl{$\bigcup_{0 \le n} L(r)^n$}}\\
4
Christian Urban <urbanc@in.tum.de>
parents: 3
diff changeset
   940
  \end{tabular}\bigskip
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   941
  
4
Christian Urban <urbanc@in.tum.de>
parents: 3
diff changeset
   942
\onslide<2->{
254
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   943
\hspace{5mm}\bl{$L(r)^0 \;\dn\; \{[]\}$}\\
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   944
\bl{$L(r)^{n+1} \;\dn\; L(r) \,@\, L(r)^n$}\hspace{9mm}\onslide<3->{\small\textcolor{gray}{(append on sets)}\\
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   945
\small\hspace{5cm}\textcolor{gray}{$\{ s_1 @ s_2 \;|\; s_1\in L(r) \wedge s_2 \in L(r)^n \}$}}
4
Christian Urban <urbanc@in.tum.de>
parents: 3
diff changeset
   946
}  
Christian Urban <urbanc@in.tum.de>
parents: 3
diff changeset
   947
    \end{textblock}
Christian Urban <urbanc@in.tum.de>
parents: 3
diff changeset
   948
745
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   949
\end{frame}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   950
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   951
5
Christian Urban <urbanc@in.tum.de>
parents: 4
diff changeset
   952
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 4
diff changeset
   953
\begin{frame}[c]
254
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   954
\frametitle{The Meaning of Matching}
5
Christian Urban <urbanc@in.tum.de>
parents: 4
diff changeset
   955
254
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   956
\begin{bubble}[10cm]
559
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   957
\large\bf 
507
fdbc7d0ec04f updated
Christian Urban <urbanc@in.tum.de>
parents: 506
diff changeset
   958
A regular expression \bl{$r$} matches a string~\bl{$s$} 
254
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   959
provided
5
Christian Urban <urbanc@in.tum.de>
parents: 4
diff changeset
   960
Christian Urban <urbanc@in.tum.de>
parents: 4
diff changeset
   961
\begin{center}
254
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   962
\bl{$s \in L(r)$}\\ 
5
Christian Urban <urbanc@in.tum.de>
parents: 4
diff changeset
   963
\end{center}
330
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   964
\end{bubble}\bigskip\bigskip
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   965
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   966
\ldots and the point of the next lecture is 
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   967
to decide this problem as fast as possible (unlike Python,
428
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   968
Ruby, Java)
5
Christian Urban <urbanc@in.tum.de>
parents: 4
diff changeset
   969
254
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   970
\end{frame}
5
Christian Urban <urbanc@in.tum.de>
parents: 4
diff changeset
   971
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 4
diff changeset
   972
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   973
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   974
\begin{frame}[c]
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   975
  \frametitle{The Power Operation}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   976
  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   977
  \begin{itemize}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   978
  \item The \alert{\textbf{\boldmath$n$th Power}} of a language:
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   979
  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   980
  \begin{center}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   981
  \begin{tabular}{lcl}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   982
  \bl{$A^0$}    & \bl{$\dn$} & \bl{$\{[]\}$}\\
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   983
  \bl{$A^{n+1}$} & \bl{$\dn$} & \bl{$A \,@\, A^n$}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   984
  \end{tabular}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   985
  \end{center}\bigskip
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   986
  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   987
  \item[] For example
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   988
  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   989
  \begin{center}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   990
  \begin{tabular}{lcl@{\hspace{10mm}}l}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   991
  \bl{$A^4$} & \bl{$=$} & \bl{$A \,@\, A \,@\, A \,@\, A$} & \bl{$(@\,\{[]\})$}\\
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   992
  \bl{$A^1$} & \bl{$=$} & \bl{$A$} & \bl{$(@\,\{[]\})$}\\
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   993
  \bl{$A^0$} & \bl{$=$} & \bl{$\{[]\}$}\\
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   994
  \end{tabular}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   995
  \end{center}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   996
  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   997
  \end{itemize}  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   998
  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   999
  \end{frame}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1000
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1001
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1002
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1003
\begin{frame}[c]
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1004
  \frametitle{Questions}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1005
  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1006
  \begin{itemize}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1007
  \item Say \bl{$A = \{[a],[b],[c],[d]\}$}.\bigskip
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1008
  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1009
  \item[]
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1010
  How many strings are in \bl{$A^4$}\,?
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1011
  \bigskip\medskip\pause
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1012
  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1013
  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1014
 \item[]
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1015
  What if \bl{$A = \{[a],[b],[c],[]\}$};\\ 
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1016
  how many strings are then in \bl{$A^4$}\,?
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1017
  \end{itemize}  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1018
  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1019
\end{frame}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1020
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1021
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1022
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1023
\begin{frame}[c]
743
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1024
\frametitle{Languages (Sets of Strings)}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1025
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1026
\begin{itemize}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1027
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1028
\item A \alert{\bf Language} is a set of strings, for example\medskip
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1029
\begin{center}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1030
\bl{$\{[], hello, foobar, a, abc\}$}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1031
\end{center}\bigskip
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1032
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1033
\item \alert{\bf Concatenation} for strings and languages
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1034
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1035
\begin{center}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1036
\begin{tabular}{rcl}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1037
\bl{$foo\;@\;bar$} & \bl{$=$} & \bl{$foobar$}\medskip\\
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1038
\bl{$A\;@\;B$}     & \bl{$\dn$} & \bl{$\{ s_1\,@\,s_2 \;\mid\; s_1 \in A \wedge s_2 \in B\}$}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1039
\end{tabular}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1040
\end{center}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1041
\bigskip
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1042
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1043
\small
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1044
\item [] For example \bl{$A = \{foo, bar\}$}, \bl{$B = \{a, b\}$}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1045
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1046
\[
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1047
\bl{A \,@\, B = \{fooa, foob, bara, barb\}}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1048
\]
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1049
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1050
\end{itemize}  
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1051
\end{frame}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1052
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1053
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1054
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1055
\begin{frame}[c]
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1056
  \frametitle{Two Corner Cases}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1057
   
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1058
  \Large
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1059
  \begin{center}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1060
  \bl{$A \,@\, \{[]\} = \;?$}\bigskip\bigskip\pause\\
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1061
  \bl{$A \,@\, \{\} = \;?$}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1062
  \end{center}  
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1063
    
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1064
  \end{frame}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1065
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1066
  
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1067
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1068
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1069
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1070
\begin{frame}[c]
745
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
  1071
\frametitle{The Meaning of a Regex}
743
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1072
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1073
 ...all the strings a regular expression can match.   
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1074
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1075
\begin{center}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1076
 \begin{tabular}{rcl}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1077
 \bl{$L(\ZERO)$}  & \bl{$\dn$} & \bl{$\{\}$}\\
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1078
 \bl{$L(\ONE)$}     & \bl{$\dn$} & \bl{$\{[]\}$}\\
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1079
 \bl{$L(c)$}            & \bl{$\dn$} & \bl{$\{[c]\}$}\\
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1080
 \bl{$L(r_1 + r_2)$}    & \bl{$\dn$} & \bl{$L(r_1) \cup L(r_2)$}\\
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1081
 \bl{$L(r_1 \cdot r_2)$} & \bl{$\dn$} & \bl{$L(r_1) \,@\, L(r_2)$}\\
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1082
 \bl{$L(r^*)$}           & \bl{$\dn$} & \\
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1083
  \end{tabular}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1084
\end{center}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1085
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1086
\begin{textblock}{14}(1.5,13.5)\small
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1087
\bl{$L$} is a function from regular expressions to 
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1088
sets of strings (languages):\smallskip\\
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1089
\bl{\quad$L$ : Rexp $\Rightarrow$ Set$[$String$]$}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1090
\end{textblock}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1091
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1092
\end{frame}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1093
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1094
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1095
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1096
\begin{frame}[c]
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1097
\frametitle{The Power Operation}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1098
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1099
\begin{itemize}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1100
\item The \alert{\textbf{\boldmath$n$th Power}} of a language:
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1101
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1102
\begin{center}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1103
\begin{tabular}{lcl}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1104
\bl{$A^0$}    & \bl{$\dn$} & \bl{$\{[]\}$}\\
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1105
\bl{$A^{n+1}$} & \bl{$\dn$} & \bl{$A \,@\, A^n$}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1106
\end{tabular}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1107
\end{center}\bigskip
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1108
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1109
\item[] For example
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1110
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1111
\begin{center}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1112
\begin{tabular}{lcl@{\hspace{10mm}}l}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1113
\bl{$A^4$} & \bl{$=$} & \bl{$A \,@\, A \,@\, A \,@\, A$} & \bl{$(@\,\{[]\})$}\\
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1114
\bl{$A^1$} & \bl{$=$} & \bl{$A$} & \bl{$(@\,\{[]\})$}\\
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1115
\bl{$A^0$} & \bl{$=$} & \bl{$\{[]\}$}\\
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1116
\end{tabular}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1117
\end{center}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1118
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1119
\end{itemize}  
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1120
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1121
\end{frame}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1122
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1123
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1124
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1125
\begin{frame}[c]
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1126
  \frametitle{The Star Operation}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1127
  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1128
  \begin{itemize}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1129
  \item The \alert{\bf Kleene Star} of a \underline{language}:
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1130
  \bigskip
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1131
  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1132
  \begin{center}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1133
  \begin{tabular}{c}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1134
  \bl{$A\star \dn \bigcup_{0\le n} A^n$}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1135
  \end{tabular}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1136
  \end{center}\bigskip
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1137
  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1138
  \item[] This expands to 
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1139
  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1140
  \[
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1141
  \bl{A^0 \cup A^1 \cup A^2 \cup A^3 \cup A^4 \cup \ldots}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1142
  \]
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1143
  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1144
  or
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1145
  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1146
  \small
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1147
  \[
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1148
  \bl{\{[]\} \;\cup\; A \;\cup\; A\,@\,A \;\cup\; 
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1149
    A\,@\,A\,@\,A \;\cup\; A\,@\,A\,@\,A\,@\,A \cup \ldots}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1150
  \]
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1151
  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1152
  \end{itemize}  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1153
  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1154
  \end{frame}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1155
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1156
  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1157
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1158
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1159
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1160
\begin{frame}[c]
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
  1161
\frametitle{Written Exam}
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
  1162
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
  1163
\begin{itemize}
428
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
  1164
\item Accounts for 80\%.\bigskip
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
  1165
559
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
  1166
\item The question ``\textit{Is this relevant for
330
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
  1167
      the exam?}'' is very demotivating for the lecturer!\bigskip\\
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
  1168
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
  1169
\item Deal: Whatever is in the homework (and is not marked
330
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
  1170
      ``\textit{optional}'') is relevant for the exam.\bigskip
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
  1171
      
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
  1172
\item Each lecture has also a handout. There are also handouts about
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
  1173
notation and Scala.      
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
  1174
\end{itemize}
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
  1175
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
  1176
\end{frame}
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
  1177
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
  1178
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
  1179
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
  1180
\begin{frame}[t]
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
  1181
\frametitle{Coursework}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1182
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1183
\begin{itemize}
428
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
  1184
\item Accounts for 20\%. Two strands. Choose \alert{\bf one}!\bigskip
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1185
\end{itemize}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1186
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
  1187
\begin{columns}[t]
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
  1188
\begin{column}{.5\textwidth}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
  1189
\underline{\bf Strand 1}\medskip
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
  1190
\begin{itemize}
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1191
\item 4 programming tasks:
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
  1192
\begin{itemize}
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1193
\item matcher (4\%, 11.10.) 
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1194
\item lexer (5\%, 04.11.)
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1195
\item parser (5\%, 22.11.)
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1196
\item compiler (6\%, 13.12.)
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
  1197
\end{itemize}
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1198
\item in any lang.~you like,\\ but I want to see the\\ code
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
  1199
\end{itemize}
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
  1200
\end{column}
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
  1201
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
  1202
\hspace{-45pt}\vrule{}\hspace{10pt}
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
  1203
\begin{column}{.5\textwidth}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
  1204
\underline{\bf Strand 2}\smallskip\begin{itemize}
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
  1205
\item one task: prove the correctness of a regular expression matcher in 
559
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
  1206
the \underline{Isabelle} theorem prover
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1207
\item 20\%, submission on~13.12.\hspace{-5mm}\mbox{}
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
  1208
\end{itemize}
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
  1209
\end{column}
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
  1210
\end{columns}\medskip
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
  1211
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
  1212
\small
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
  1213
\begin{itemize}
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
  1214
\item Solving more than one strand will {\bf not} give you more 
506
12a8f57f68ea updated
Christian Urban <urbanc@in.tum.de>
parents: 505
diff changeset
  1215
marks.
12a8f57f68ea updated
Christian Urban <urbanc@in.tum.de>
parents: 505
diff changeset
  1216
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
  1217
\end{itemize}
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
  1218
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
  1219
\end{frame}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1220
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1221
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
  1222
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
745
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
  1223
%\begin{frame}[c]
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
  1224
%\frametitle{Lecture Capture}
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
  1225
%
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
  1226
%\begin{itemize}
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
  1227
%\item Hope it works\ldots\pause actually no, it does not!\medskip\pause
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
  1228
%\item It is important to use lecture capture wisely\\ (it is only the ``baseline''):
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
  1229
%\begin{itemize}  
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
  1230
%\item Lecture recordings are a study and revision aid.
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
  1231
%\item Statistically, there is a clear and direct link between attendance and
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
  1232
%  attainment: students who do not attend lectures, do less well in exams.
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
  1233
%\end{itemize}
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
  1234
%
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
  1235
%\item Attending a lecture is more than watching it online -- if you do not
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
  1236
%attend, you miss out!  
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
  1237
%  
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
  1238
%\end{itemize}
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
  1239
%
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
  1240
%\end{frame}
506
12a8f57f68ea updated
Christian Urban <urbanc@in.tum.de>
parents: 505
diff changeset
  1241
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
12a8f57f68ea updated
Christian Urban <urbanc@in.tum.de>
parents: 505
diff changeset
  1242
12a8f57f68ea updated
Christian Urban <urbanc@in.tum.de>
parents: 505
diff changeset
  1243
12a8f57f68ea updated
Christian Urban <urbanc@in.tum.de>
parents: 505
diff changeset
  1244
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12a8f57f68ea updated
Christian Urban <urbanc@in.tum.de>
parents: 505
diff changeset
  1245
\begin{frame}[c]
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
  1246
\frametitle{\begin{tabular}{c}\\[3cm]\alert{Questions?}\end{tabular}}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
  1247
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
  1248
\mbox{}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
  1249
\end{frame}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
  1250
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1251
\end{document}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1252
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1253
%%% Local Variables:  
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1254
%%% mode: latex
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1255
%%% TeX-master: t
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1256
%%% End: 
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1257