slides/slides01.tex
author Christian Urban <christian.urban@kcl.ac.uk>
Tue, 17 Nov 2020 00:36:16 +0000
changeset 806 0d3bc1d0d987
parent 778 3e5f5d19f514
child 826 b0352633bf48
permissions -rw-r--r--
updated
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
758
194218161b71 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 757
diff changeset
    34
%\begin{frame}[t]
194218161b71 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 757
diff changeset
    35
%\begin{mybox}
194218161b71 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 757
diff changeset
    36
%A physical explanation the \emph{dynamic matrix}\\
194218161b71 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 757
diff changeset
    37
%lots of text
194218161b71 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 757
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
758
194218161b71 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 757
diff changeset
    41
%\begin{mybox2}{Test}
194218161b71 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 757
diff changeset
    42
%A physical explanation the \emph{dynamic matrix}\\
194218161b71 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 757
diff changeset
    43
%lots of text
194218161b71 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 757
diff changeset
    44
%\end{mybox2}
754
1c9a23304b85 ammonite
Christian Urban <christian.urban@kcl.ac.uk>
parents: 745
diff changeset
    45
758
194218161b71 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 757
diff changeset
    46
%\begin{mybox3}{Test}
194218161b71 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 757
diff changeset
    47
%A physical explanation the \emph{dynamic matrix}\\
194218161b71 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 757
diff changeset
    48
%lots of text
194218161b71 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 757
diff changeset
    49
%\end{mybox3}
194218161b71 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 757
diff changeset
    50
%\end{frame}
754
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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
756
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
    97
\begin{frame}<1-12>[c]
744
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]
756
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   215
    Compiler explorers, e.g.: \url{https://gcc.godbolt.org} \;\video{https://youtu.be/ysaBmhMEyUg}
744
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);   
756
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   220
  \node (2) [below=20mm] at (0) {\LARGE\bf source};
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   221
  \node (3) [right=40mm] at (2) {\LARGE\bf binary};
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   222
  \draw [->,line width=1mm] (2) -- (3);   
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   223
\end{tikzpicture}
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   224
\end{bubble}
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   225
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   226
\end{textblock}}
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   227
\only<11>{
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   228
\begin{textblock}{6}(1,3)
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   229
  \begin{bubble}[11cm]
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   230
    Compiler explorer for Java: \url{https://javap.yawk.at} 
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   231
  \begin{tikzpicture}[]
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   232
  \node (0) at (-2.3,0) {\includegraphics[scale=0.4]{pics/jsource.png}};
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   233
  \node (1) [right=35mm] at (0) {\includegraphics[scale=0.4]{pics/jassmbl.png}}; 
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   234
  \draw [->,line width=4mm, red] (0) -- (1);   
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   235
  \node (2) [below=20mm] at (0) {\LARGE\bf source};
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   236
  \node (3) [right=40mm] at (2) {\LARGE\bf byte code};
744
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   237
  \draw [->,line width=1mm] (2) -- (3);   
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   238
\end{tikzpicture}
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   239
\end{bubble}
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   240
\end{textblock}}
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   241
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   242
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   243
\end{frame}
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   244
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   245
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   246
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   247
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   248
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
559
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   249
\begin{frame}[t]
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   250
\frametitle{Why Study Compilers?}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   251
743
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
   252
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
   253
John Regehr {\small(Univ.~Utah, LLVM compiler hacker)}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
   254
\here{https://blog.regehr.org/archives/1419}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
   255
\smallskip\\
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   256
559
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   257
\begin{bubble}[10.5cm]
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   258
  \bf ``\ldots{}It’s effectively a perpetual
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   259
  employment act for solid compiler hackers.''
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   260
\end{bubble}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   261
559
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   262
\onslide<1->{
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   263
\only<2>{
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   264
\begin{itemize}
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   265
\item {\bf Hardware is getting weirder
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   266
  rather than getting clocked faster.}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   267
559
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   268
\begin{itemize}
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   269
\item[]  ``Almost all processors are multicores nowadays and it looks
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   270
  like there is increasing asymmetry in resources across cores.
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   271
  Processors come with vector units, crypto accelerators etc. We have
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   272
  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
   273
  surface.''
559
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   274
\end{itemize}  
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   275
\end{itemize}}
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   276
\only<3>{
559
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   277
\begin{itemize}
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   278
\item {\bf We’re getting tired of low-level languages and
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   279
    their associated security disasters.}
559
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   280
  
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   281
\begin{itemize}
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   282
\item [] ``We want to write new code, to whatever extent possible, in
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   283
  safer, higher-level languages. Compilers are caught right in the
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   284
  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
   285
  bridge the large and growing gap between increasingly high-level
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   286
  languages and increasingly wacky platforms.''
559
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   287
\end{itemize}  
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   288
\end{itemize}}}
1
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   289
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   290
\end{frame}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   291
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   292
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   293
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
\begin{frame}[c]
744
99c5916d9a8f updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   296
\frametitle{Why Bother with Compilers?}
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   297
  
745
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   298
\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
   299
triple redundancy for potential hardware faults.
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   300
\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
   301
  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   302
They compile 1 Ada program to\medskip
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   303
  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   304
\begin{itemize}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   305
  \item Intel 80486
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   306
  \item Motorola 68040 (old Macintosh's)
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   307
  \item AMD 29050 (RISC chips used often in laser printers)
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   308
\end{itemize}\medskip\medskip
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   309
  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   310
using 3 independent compilers.\bigskip\pause
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   311
  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   312
\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
   313
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   314
\only<1->{%
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   315
\begin{textblock}{6}(8,4.5)
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   316
\includegraphics[scale=0.28]{../pics/777.png}
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   317
\end{textblock}}
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   318
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   319
\end{frame}
756
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   320
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   321
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   322
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   323
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   324
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   325
\begin{frame}[c]
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   326
\frametitle{What Do Compilers Do?}
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   327
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   328
Remember BF*** from PEP?
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   329
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   330
\begin{center}
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   331
\begin{tabular}{rcl}
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   332
\bl{\texttt{>}} & $\Rightarrow$ & move one cell right\\
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   333
\bl{\texttt{<}} & $\Rightarrow$ & move one cell left\\
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   334
\bl{\texttt{+}} & $\Rightarrow$ & increase cell by one\\
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   335
\bl{\texttt{-}} & $\Rightarrow$ & decrease cell by one\\
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   336
\bl{\texttt{.}} & $\Rightarrow$ & print current cell\\
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   337
\bl{\texttt{,}} & $\Rightarrow$ & input current cell\\
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   338
\bl{\texttt{[}} & $\Rightarrow$ & loop begin\\
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   339
\bl{\texttt{]}} & $\Rightarrow$ & loop end\medskip\\
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   340
                & $\Rightarrow$ & everything else is a comment\\
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   341
\end{tabular}  
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   342
\end{center}  
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   343
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   344
\end{frame}
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   345
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   346
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   347
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   348
\begin{frame}[c]
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   349
  \frametitle{A ``Compiler'' for BF*** to C}
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   350
  
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   351
  \begin{center}
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   352
  \begin{tabular}{rcl}
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   353
  \bl{\texttt{>}} & $\Rightarrow$ & \texttt{ptr++}\\
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   354
  \bl{\texttt{<}} & $\Rightarrow$ & \texttt{ptr--}\\
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   355
  \bl{\texttt{+}} & $\Rightarrow$ & \texttt{(*ptr)++}\\
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   356
  \bl{\texttt{-}} & $\Rightarrow$ & \texttt{(*ptr)--}\\
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   357
  \bl{\texttt{.}} & $\Rightarrow$ & \texttt{putchar(*ptr)}\\
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   358
  \bl{\texttt{,}} & $\Rightarrow$ & \texttt{*ptr = getchar()}\\
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   359
  \bl{\texttt{[}} & $\Rightarrow$ & \texttt{while(*ptr)\{}\\
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   360
  \bl{\texttt{]}} & $\Rightarrow$ & \texttt{\}}\medskip\\
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   361
                  & $\Rightarrow$ & ignore everything else\\
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   362
  \end{tabular}  
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   363
  \end{center}\bigskip  
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   364
  
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   365
  \texttt{char field[30000]\\ char *ptr = \&field[15000]}
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   366
  
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   367
\end{frame}
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   368
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   369
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   370
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   371
\begin{frame}[c]
757
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   372
  \frametitle{Another~``Compiler''~for~BF~to~C}
756
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   373
  
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   374
  \begin{center}
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   375
  \begin{tabular}{rcl}
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   376
  \bl{\texttt{>\ldots>}} & $\Rightarrow$ & \texttt{ptr += n}\\
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   377
  \bl{\texttt{<\ldots<}} & $\Rightarrow$ & \texttt{ptr -= n}\\
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   378
  \bl{\texttt{+\ldots+}} & $\Rightarrow$ & \texttt{(*ptr) += n}\\
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   379
  \bl{\texttt{-\ldots-}} & $\Rightarrow$ & \texttt{(*ptr) -= n}\\
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   380
  \bl{\texttt{.}} & $\Rightarrow$ & \texttt{putchar(*ptr)}\\
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   381
  \bl{\texttt{,}} & $\Rightarrow$ & \texttt{*ptr = getchar()}\\
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   382
  \bl{\texttt{[}} & $\Rightarrow$ & \texttt{while(*ptr)\{}\\
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   383
  \bl{\texttt{]}} & $\Rightarrow$ & \texttt{\}}\medskip\\
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   384
                  & $\Rightarrow$ & ignore everything else\\
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   385
  \end{tabular}  
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   386
  \end{center}\bigskip  
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   387
  
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   388
  \texttt{char field[30000]\\ char *ptr = \&field[15000]}
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   389
  
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   390
\end{frame}
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   391
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
757
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   392
    
756
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   393
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   394
\begin{frame}[t]
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   395
\frametitle{A Brief Compiler History}
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   396
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   397
\bigskip
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   398
\begin{itemize}
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   399
\item Turing Machines, 1936 (a tape as memory)
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   400
\item Regular Expressions, 1956\\
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   401
\item The first compiler for COBOL, 1957\\ (Grace Hopper)\medskip
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   402
\item But surprisingly research papers are still published nowadays\\
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   403
\item ``Parsing: The Solved Problem That Isn't''
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   404
  \here{https://tratt.net/laurie/blog/entries/parsing_the_solved_problem_that_isnt.html}
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   405
\end{itemize}
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   406
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   407
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   408
\begin{textblock}{8.5}(5,7.6)
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   409
\begin{flushright}
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   410
\includegraphics[scale=0.3]{pics/hopper.jpg}\\
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   411
\footnotesize\textcolor{gray}{Grace Hopper}\smallskip\\
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   412
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   413
{\small\textcolor{gray}{(she made it to David Letterman's Tonight Show
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   414
 \here{https://youtu.be/3N_ywhx6_K0?t=31})}}
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   415
\end{flushright}
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   416
\end{textblock}
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   417
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   418
\end{frame}
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   419
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   420
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   421
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   422
\begin{frame}[c]
757
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   423
\frametitle{Some Housekeeping}
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   424
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   425
\textbf{Exams will be online:}\bigskip
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   426
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   427
\begin{itemize}
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   428
\item final exam in January (30\%)
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   429
\item mid-term shortly after Reading Week (10\%)\bigskip
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   430
  
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   431
\item weekly engagement (10\%)  
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   432
\end{itemize}\bigskip\bigskip\pause
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   433
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   434
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   435
\textbf{Weekly Homework (optional):}
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   436
\begin{itemize}
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   437
\item uploaded on KEATS, send answers via email, responded individually
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   438
\item \alert{\bf all} questions in the exam and mid-term will be from the HW!!
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   439
\end{itemize}  
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   440
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   441
\end{frame}
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   442
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   443
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   444
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   445
\begin{frame}[c]
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   446
\frametitle{Some Housekeeping}
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   447
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   448
\textbf{Coursework (5 accounting for 45\%):}\bigskip
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   449
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   450
\begin{itemize}
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   451
\item matcher (5\%)
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   452
\item lexer (8\%)
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   453
\item parser / interpreter (10\%)
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   454
\item JVM compiler (10\%)
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   455
\item LLVM compiler (12\%) 
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   456
\end{itemize}\bigskip\pause
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   457
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   458
you can use any programming language you like (Haskell, Rust)\\\pause
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   459
you can use any code I showed you and uploaded to KEATS\ldots\textbf{BUT NOTHING ELSE!}\pause
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   460
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   461
\end{frame}
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   462
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   463
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   464
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   465
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   466
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   467
\begin{frame}[c]
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   468
\frametitle{Lectures 1 - 5}
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   469
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   470
transforming strings into structured data\\[10mm]
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   471
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   472
{\LARGE\bf Lexing} {\hfill{}based on regular expressions}\medskip\\
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   473
\hspace{5mm}(recognising ``words'')\\[6mm]
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   474
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   475
{\LARGE\bf Parsing}\medskip\\
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   476
\hspace{5mm}(recognising ``sentences'')
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   477
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   478
\begin{textblock}{1}(10,9.1)
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   479
\begin{tabular}{c}
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   480
\includegraphics[scale=0.1]{../pics/rosetta.jpg}\\[-2mm]
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   481
\footnotesize Stone of Rosetta
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   482
\end{tabular}
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   483
\end{textblock}
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   484
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   485
\end{frame}
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   486
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   487
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   488
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   489
\begin{frame}[c]
756
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   490
\frametitle{Lectures 1 - 5}
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   491
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   492
transforming strings into structured data\\[10mm]
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   493
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   494
{\LARGE\bf Lexing} {\hfill{}based on regular expressions}\medskip\\
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   495
\hspace{5mm}(recognising ``words'')\\[6mm]
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   496
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   497
{\LARGE\bf Parsing}\medskip\\
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   498
\hspace{5mm}(recognising ``sentences'')
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   499
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   500
\begin{textblock}{1}(10,9.1)
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   501
\begin{tabular}{c}
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   502
\includegraphics[scale=0.1]{../pics/rosetta.jpg}\\[-2mm]
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   503
\footnotesize Stone of Rosetta
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   504
\end{tabular}
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   505
\end{textblock}
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   506
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   507
\end{frame}
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   508
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   509
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   510
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   511
\begin{frame}[c]
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   512
  \frametitle{Lectures 5 - 10}
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   513
  
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   514
  code generation for a small imperative and a small functional language\\[10mm]
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   515
  
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   516
  {\LARGE\bf Interpreters}\medskip\\
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   517
  \hspace{5mm}(directly runs a program)\\[6mm]
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   518
  
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   519
  {\LARGE\bf Compilers}\medskip\\
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   520
  \hspace{5mm}(generate JVM code and LLVM-IR code)
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   521
  
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   522
  \begin{textblock}{1}(8.8,8.1)
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   523
  \begin{tabular}{c@{}c}
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   524
    \includegraphics[scale=0.4]{../pics/javaduke.png} &
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   525
    \includegraphics[scale=0.23]{../pics/llvmlogo.png}
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   526
  \end{tabular}
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   527
  \end{textblock}
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   528
  
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   529
  \end{frame}
757
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   530
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
756
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   531
  
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   532
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   533
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   534
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   535
\begin{frame}[t]
757
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   536
\frametitle{Familiar Regular Expresssions}
756
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   537
\small
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   538
\begin{center}
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   539
\texttt{[a-z0-9\_$\backslash{}$.-]+ @ [a-z0-9$\backslash{}$.-]+ . [a-z$\backslash{}$.]\{2,6\}}
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   540
\end{center}\smallskip
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   541
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   542
\begin{center}
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   543
\begin{tabular}{@{}lp{8.5cm}@{}}
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   544
\pcode{re*} & matches 0 or more times\\
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   545
\pcode{re+} & matches 1 or more times\\
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   546
\pcode{re?} & matches 0 or 1 times\\
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   547
\pcode{re\{n\}}	& matches exactly \pcode{n} number of times\\
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   548
\pcode{re\{n,m\}} & matches at least \pcode{n} and at most {\tt m} times\\
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   549
\pcode{[...]} & matches any single character inside the brackets\\
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   550
\pcode{[^...]} & matches any single character not inside the 
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   551
brackets\\
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   552
\pcode{a-z A-Z} & character ranges\\
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   553
\pcode{\\d} & matches digits; equivalent to \pcode{[0-9]}\\
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   554
\pcode{.} & matches every character except newline\\
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   555
\pcode{(re)}	& groups regular expressions and remembers 
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   556
the matched text
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   557
\end{tabular}
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   558
\end{center}
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   559
757
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   560
\end{frame}
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   561
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   562
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   563
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   564
\begin{frame}[c]
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   565
\frametitle{Some ``innocent'' examples}
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   566
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   567
Let's try two examples
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   568
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   569
\begin{center}
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   570
  \bl{\texttt{(a*)*b}}
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   571
  \hspace{2cm}
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   572
  \bl{\texttt{[a?]\{n\}[a]\{n\}}}
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   573
\end{center}\bigskip\pause  
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   574
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   575
and match them with strings of the form
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   576
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   577
\begin{center}
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   578
  \bl{\texttt{a}},
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   579
  \bl{\texttt{aa}},
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   580
  \bl{\texttt{aaa}},
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   581
  \bl{\texttt{aaaa}},
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   582
  \bl{\texttt{aaaaa}},
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   583
  \bl{$\underbrace{\texttt{a}...\texttt{a}}_n$}  
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   584
\end{center}  
756
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   585
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   586
\end{frame}
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   587
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
f7c7a75e0583 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 754
diff changeset
   588
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   589
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   590
\begin{frame}[c]
745
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   591
\frametitle{Why Bother with Regexes?}
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   592
745
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   593
\begin{columns}[t,onlytextwidth]
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   594
\begin{column}{1.8cm}
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   595
\mbox{}   
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   596
\end{column}    
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   597
\begin{column}{.5\textwidth}
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   598
\small{}Ruby, Python, Java 8\medskip\\
428
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   599
\begin{tikzpicture}\footnotesize
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   600
\begin{axis}[
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   601
    xlabel={$n$},
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   602
    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
   603
    ylabel={time in secs},
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   604
    enlargelimits=false,
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   605
    xtick={0,5,...,30},
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   606
    xmax=33,
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   607
    ymax=35,
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   608
    ytick={0,5,...,30},
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   609
    scaled ticks=false,
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   610
    axis lines=left,
745
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   611
    width=\textwidth,
428
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   612
    height=4cm, 
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   613
    legend entries={Python,Ruby},  
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   614
    legend pos=north west,
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   615
    legend cell align=left]
559
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   616
\addplot[blue,mark=*, mark options={fill=white}] table {re-python.data};
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   617
\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
   618
\end{axis}
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   619
\end{tikzpicture}
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   620
\begin{tikzpicture}\footnotesize
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   621
\begin{axis}[
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   622
    xlabel={$n$},
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   623
    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
   624
    ylabel={time in secs},
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   625
    enlargelimits=false,
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   626
    xtick={0,5,...,30},
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   627
    xmax=33,
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   628
    ymax=35,
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   629
    ytick={0,5,...,30},
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   630
    scaled ticks=false,
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   631
    axis lines=left,
745
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   632
    width=\textwidth,
428
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   633
    height=4cm, 
767
bdd12391d345 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 762
diff changeset
   634
    legend entries={Python, Java 8, JavaScript, Swift},  
428
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   635
    legend pos=north west,
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   636
    legend cell align=left]
559
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   637
\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
   638
\addplot[cyan,mark=*, mark options={fill=white}] table {re-java.data};
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   639
\addplot[red,mark=*, mark options={fill=white}] table {re-js.data};
767
bdd12391d345 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 762
diff changeset
   640
\addplot[magenta,mark=*, mark options={fill=white}] table {re-swift.data};
428
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   641
\end{axis}
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   642
\end{tikzpicture}
745
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   643
%
428
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   644
\end{column}
745
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   645
\begin{column}{.5\textwidth}
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   646
\small{}Us (after next lecture)\medskip\\
428
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   647
\begin{tikzpicture}\footnotesize
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   648
\begin{axis}[
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   649
    xlabel={$n$},
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   650
    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
   651
    ylabel={time in secs},
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   652
    enlargelimits=false,
442
84d6714840c9 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 437
diff changeset
   653
    xtick={0,5000,...,10000},
84d6714840c9 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 437
diff changeset
   654
    xmax=11000,
428
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   655
    ymax=35,
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   656
    ytick={0,5,...,30},
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   657
    scaled ticks=false,
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   658
    axis lines=left,
745
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   659
    width=\textwidth,
428
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   660
    height=4cm]
437
fe387fcbf2ee updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 428
diff changeset
   661
\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
   662
\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
   663
\end{axis}
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   664
\end{tikzpicture}
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   665
\begin{tikzpicture}\footnotesize
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   666
\begin{axis}[
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   667
    xlabel={$n$},
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   668
    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
   669
    ylabel={time in secs},
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   670
    enlargelimits=false,
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   671
    ymax=35,
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   672
    ytick={0,5,...,30},
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   673
    scaled ticks=false,
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   674
    axis lines=left,
745
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   675
    width=\textwidth,
428
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   676
    height=4cm]
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   677
\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
   678
\end{axis}
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   679
\end{tikzpicture}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   680
\end{column}
745
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   681
\end{columns}
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   682
\medskip
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   683
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   684
\begin{textblock}{3}(-0.1,3.3)
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   685
\small\hfill\bl{\texttt{[a?]\{n\}[a]\{n\}}}:
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   686
\end{textblock}
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   687
745
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   688
\begin{textblock}{3}(-0.1,8.7)  
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   689
\small\hfill\bl{\texttt{(a*)*b}}:
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   690
\end{textblock}
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   691
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   692
\begin{textblock}{3}(0.3,13)
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   693
\small{}matching with strings
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   694
\bl{$\underbrace{\texttt{a}...\texttt{a}}_n$}  
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   695
\end{textblock}
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   696
510
cu
parents: 507
diff changeset
   697
\end{frame} 
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   698
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   699
    
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   700
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   701
\begin{frame}[c,fragile]
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   702
  \frametitle{Incidents}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   703
    
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   704
  \begin{itemize}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   705
  \item a global outage on 2 July 2019 at \textbf{Cloudflare} 
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   706
  (first one for six years)\medskip
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{center}\small\color{blue}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   709
  \begin{verbatim}  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   710
  (?:(?:\"|'|\]|\}|\\|\d|(?:nan|infinity|true|false|
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   711
  null|undefined|symbol|math)|\`|\-|\+)+[)]*;?((?:\s
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   712
  |-|~|!|{}|\|\||\+)*.*(?:.*=.*)))  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   713
  \end{verbatim}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   714
  \end{center}\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip    
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   715
  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   716
  \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
   717
    because of an evil regular expression
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   718
    \here{https://stackstatus.net/post/147710624694/outage-postmortem-july-20-2016}    
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   719
  \end{itemize}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   720
  
745
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   721
  \begin{textblock}{6}(6,7.6)
728
c669b39debe3 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 722
diff changeset
   722
    \includegraphics[scale=0.14]{../pics/cloudflare.png}\\
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   723
    \footnotesize
745
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   724
    It serves more web traffic than Twitter, Amazon, Apple,
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   725
    Instagram, Bing \& Wikipedia combined.
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   726
    \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
   727
    \end{textblock}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   728
  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   729
  \end{frame}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   730
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   731
    
560
99d2bb1f145c updated
Christian Urban <urbanc@in.tum.de>
parents: 559
diff changeset
   732
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
99d2bb1f145c updated
Christian Urban <urbanc@in.tum.de>
parents: 559
diff changeset
   733
\begin{frame}[c]
99d2bb1f145c updated
Christian Urban <urbanc@in.tum.de>
parents: 559
diff changeset
   734
\frametitle{Evil Regular Expressions}
99d2bb1f145c updated
Christian Urban <urbanc@in.tum.de>
parents: 559
diff changeset
   735
99d2bb1f145c updated
Christian Urban <urbanc@in.tum.de>
parents: 559
diff changeset
   736
\begin{itemize}
99d2bb1f145c updated
Christian Urban <urbanc@in.tum.de>
parents: 559
diff changeset
   737
\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
   738
\item Some evil regular expressions:\medskip
560
99d2bb1f145c updated
Christian Urban <urbanc@in.tum.de>
parents: 559
diff changeset
   739
\begin{itemize}
745
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   740
\item \bl{\texttt{[a?]\{n\}\;[a]\{n\}}}
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   741
\item \bl{\texttt{(a*)*\;b}}  
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   742
\item \bl{\texttt{([a-z]+)*}} 
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   743
\item \bl{\texttt{(a + aa)*}}
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
   744
\item \bl{\texttt{(a + a?)*}}
560
99d2bb1f145c updated
Christian Urban <urbanc@in.tum.de>
parents: 559
diff changeset
   745
\end{itemize}
99d2bb1f145c updated
Christian Urban <urbanc@in.tum.de>
parents: 559
diff changeset
   746
99d2bb1f145c updated
Christian Urban <urbanc@in.tum.de>
parents: 559
diff changeset
   747
\item sometimes also called \alert{catastrophic backtracking}
99d2bb1f145c updated
Christian Urban <urbanc@in.tum.de>
parents: 559
diff changeset
   748
\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
   749
  \alert{D}etection systems, Cloudflare, StackExchange, Atom editor
560
99d2bb1f145c updated
Christian Urban <urbanc@in.tum.de>
parents: 559
diff changeset
   750
\item \url{https://vimeo.com/112065252}  
99d2bb1f145c updated
Christian Urban <urbanc@in.tum.de>
parents: 559
diff changeset
   751
\end{itemize}
99d2bb1f145c updated
Christian Urban <urbanc@in.tum.de>
parents: 559
diff changeset
   752
99d2bb1f145c updated
Christian Urban <urbanc@in.tum.de>
parents: 559
diff changeset
   753
\end{frame}
99d2bb1f145c updated
Christian Urban <urbanc@in.tum.de>
parents: 559
diff changeset
   754
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
428
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   755
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   756
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   757
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   758
%\begin{frame}[c]
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   759
%\frametitle{Today}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   760
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   761
%\begin{itemize}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   762
%\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
   763
%  \ldots\bigskip
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   764
%\end{itemize}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   765
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   766
%Let's start with:
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   767
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   768
%\begin{itemize}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   769
%\item a web-crawler
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   770
%\item an email harvester
559
Christian Urban <urbanc@in.tum.de>
parents: 512
diff changeset
   771
%\item \textcolor{gray}{(a web-scraper)}
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   772
%\end{itemize}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   773
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   774
%\end{frame}
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   775
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   776
2
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   777
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   778
%\begin{frame}[t]
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   779
%\frametitle{A Web-Crawler}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   780
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   781
%\mbox{}\\[10mm]
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   782
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   783
%\begin{enumerate}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   784
%\item given an URL, read the corresponding webpage
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   785
%\item extract all links from it
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   786
%\item call the web-crawler again for all these links
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   787
%\end{enumerate}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   788
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   789
%\end{frame}
2
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   790
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   791
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   792
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   793
%\begin{frame}[t]
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   794
%\frametitle{A Web-Crawler}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   795
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   796
%\mbox{}\\[10mm]
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
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   799
%\begin{enumerate}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   800
%\item given an URL, read the corresponding webpage
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   801
%\item if not possible print, out a problem
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   802
%\item if possible, extract all links from it
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   803
%\item call the web-crawler again for all these links
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   804
%\end{enumerate}\bigskip\pause
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   805
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   806
%\small (we need a bound for the number of recursive calls)
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   807
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   808
%\small (the purpose is to check all links on my own webpage)
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   809
%\end{frame}
2
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   810
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   811
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   812
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
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
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   816
%\begin{textblock}{1}(2,5)
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   817
%\begin{tabular}{c}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   818
%\includegraphics[scale=0.15]{pics/servers.png}\\[-2mm]
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   819
%\small Server
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   820
%\end{tabular}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   821
%\end{textblock}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   822
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   823
%\begin{textblock}{1}(5.6,4)
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   824
%  \begin{tikzpicture}[scale=1.1]
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   825
%  \draw[white] (0,1) node (X) {};
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   826
%  \draw[white] (2,1) node (Y) {};
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   827
%   \draw[white] (0,0) node (X1) {};
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   828
%  \draw[white] (2,0) node (Y1) {};
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   829
%   \draw[white] (0,-1) node (X2) {};
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   830
%  \draw[white] (2,-1) node (Y2) {};
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   831
%  \draw[red, <-, line width = 2mm] (X) -- (Y);
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   832
%  \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
   833
%  \draw[red, ->, line width = 2mm] (X1) -- (Y1);
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   834
%  \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
   835
%  \draw[red, <-, line width = 2mm] (X2) -- (Y2);
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   836
%  \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
   837
%  \end{tikzpicture}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   838
%\end{textblock}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   839
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   840
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   841
%\begin{textblock}{1}(9,5.5)
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   842
%\begin{tabular}{c}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   843
%\includegraphics[scale=0.15]{pics/laptop.png}\\[-2mm]
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   844
%\small Browser
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   845
%\end{tabular}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   846
%\end{textblock}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   847
%\end{frame}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   848
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   849
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   850
  
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   851
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   852
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   853
%\begin{frame}[c]
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   854
%\frametitle{Scala}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   855
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   856
%\small A simple Scala function for reading webpages:
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   857
%\bigskip
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   858
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   859
%\footnotesize
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   860
%\lstinputlisting{../progs/app0.scala}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   861
%\medskip\pause
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   862
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   863
%\lstinline{get_page("""https://nms.kcl.ac.uk/christian.urban/""")}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   864
%\bigskip\medskip\pause
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   865
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   866
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   867
%\small A slightly more complicated version for handling errors:
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   868
%\smallskip
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   869
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   870
%\footnotesize
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   871
%\lstinputlisting[xleftmargin=-4mm]{../progs/app1.scala}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   872
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   873
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   874
%\end{frame}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   875
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   876
98
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   877
 
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   878
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   879
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
757
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   880
%\begin{frame}[t]
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   881
%\frametitle{A Regular Expression}
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   882
%
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   883
%\begin{itemize}
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   884
%\item \ldots{} is a pattern or template for specifying strings
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   885
%\end{itemize}\bigskip
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   886
%  
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   887
%\begin{center}  
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   888
%\only<1>{\scode{"https?://[^"]*"}}%
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   889
%\only<2>{\scode{""""https?://[^"]*"""".r}}
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   890
%\end{center}\bigskip\bigskip
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   891
%
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   892
%matches for example\smallskip\\  
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   893
%\hspace{2mm}\code{"http://www.foobar.com"}\\
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   894
%\hspace{2mm}\code{"https://www.tls.org"}\smallskip\\
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   895
%
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   896
%but not\smallskip\\  
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   897
%\hspace{2mm}\code{"http://www."foo"bar.com"}\\
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   898
%
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   899
%\end{frame}
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   900
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   901
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   902
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
632
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   903
%\begin{frame}[c]
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   904
%\frametitle{Finding Operations in Scala}
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   905
%
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   906
%{\bf\code{rexp.findAllIn(string)}}\medskip
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   907
%  
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   908
%returns a list of all (sub)strings that match the 
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   909
%regular expression
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   910
%\bigskip\bigskip  
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   911
%  
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   912
%
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   913
%{\bf\code{rexp.findFirstIn(string)}}\medskip
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   914
% 
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   915
%returns either 
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   916
%
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   917
%\begin{itemize}
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   918
%\item \code{None} if no (sub)string matches or 
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   919
%\item \code{Some(s)} with the first (sub)string
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   920
%\end{itemize}
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   921
%
b7b91158eded updated
Christian Urban <urbanc@in.tum.de>
parents: 631
diff changeset
   922
%\end{frame}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   923
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   924
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   925
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   926
%\begin{frame}[c]
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   927
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   928
%\footnotesize
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   929
%\lstinputlisting{../progs/app2.scala}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   930
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   931
%\end{frame}
254
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   932
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   933
254
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   934
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   935
%\begin{frame}[c]
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   936
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   937
%\small
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   938
%A version that only crawls links in ``my'' domain:\bigskip
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   939
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   940
%\footnotesize
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   941
%\lstinputlisting{../progs/app3.scala}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   942
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   943
%\end{frame}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   944
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   945
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   946
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   947
%\begin{frame}[c]
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   948
%\lstset{xleftmargin=-4mm}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   949
%\small
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   950
%A little email harvester:
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   951
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   952
%\footnotesize
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   953
%\lstinputlisting{../progs/app4.scala}\bigskip
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   954
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   955
%\tiny
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   956
%\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
   957
%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
   958
%\end{frame}
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   959
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   960
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   961
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
14
Christian Urban <urbanc@in.tum.de>
parents: 13
diff changeset
   962
\begin{frame}[t]
757
ea0be0662be0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 756
diff changeset
   963
\frametitle{(Basic) Regular Expressions}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   964
330
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   965
Their inductive definition:
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   966
14
Christian Urban <urbanc@in.tum.de>
parents: 13
diff changeset
   967
330
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   968
\begin{textblock}{6}(2,7.5)
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   969
  \begin{tabular}{@ {}rrl@ {\hspace{13mm}}l}
512
a6aa52ecc1c5 updated
cu
parents: 510
diff changeset
   970
  \bl{$r$} & \bl{$::=$}  & \bl{$\ZERO$}  & nothing\\
428
a47c4227a0c6 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 334
diff changeset
   971
         & \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
   972
         & \bl{$\mid$} & \bl{$c$}                         & character\\
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   973
         & \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
   974
         & \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
   975
         & \bl{$\mid$} & \bl{$r^*$}            & star (zero or more)\\
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   976
  \end{tabular}
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   977
  \end{textblock}
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   978
  
330
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   979
  
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   980
\only<2->{\footnotesize
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   981
\begin{textblock}{9}(2,0.5)
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   982
\begin{bubble}[9.8cm]
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   983
\lstinputlisting{../progs/app01.scala}
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   984
\end{bubble}
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   985
\end{textblock}}
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
   986
  
254
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   987
\end{frame}
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   988
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   989
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   990
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
506
12a8f57f68ea updated
Christian Urban <urbanc@in.tum.de>
parents: 505
diff changeset
   991
%\begin{frame}[t]
12a8f57f68ea updated
Christian Urban <urbanc@in.tum.de>
parents: 505
diff changeset
   992
%\frametitle{Regular Expressions}
12a8f57f68ea updated
Christian Urban <urbanc@in.tum.de>
parents: 505
diff changeset
   993
%
12a8f57f68ea updated
Christian Urban <urbanc@in.tum.de>
parents: 505
diff changeset
   994
%\small
12a8f57f68ea updated
Christian Urban <urbanc@in.tum.de>
parents: 505
diff changeset
   995
%In Scala:\bigskip
12a8f57f68ea updated
Christian Urban <urbanc@in.tum.de>
parents: 505
diff changeset
   996
%
12a8f57f68ea updated
Christian Urban <urbanc@in.tum.de>
parents: 505
diff changeset
   997
%\footnotesize
12a8f57f68ea updated
Christian Urban <urbanc@in.tum.de>
parents: 505
diff changeset
   998
%\lstinputlisting{../progs/app51.scala}
12a8f57f68ea updated
Christian Urban <urbanc@in.tum.de>
parents: 505
diff changeset
   999
%
12a8f57f68ea updated
Christian Urban <urbanc@in.tum.de>
parents: 505
diff changeset
  1000
%  
12a8f57f68ea updated
Christian Urban <urbanc@in.tum.de>
parents: 505
diff changeset
  1001
%\end{frame}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1002
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1003
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1004
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
  1005
\begin{frame}[t]
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
  1006
\frametitle{Strings}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
  1007
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
  1008
\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
  1009
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
  1010
\begin{center}
330
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
  1011
\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
  1012
\end{center}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
  1013
330
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
  1014
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
  1015
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
  1016
the concatenation of two strings:
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
  1017
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
  1018
\begin{center}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
  1019
\bl{$s_1 \,@\, s_2$}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
  1020
\end{center}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
  1021
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1022
\bl{\textit{foo $@$ bar = foobar}}\\
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1023
\bl{\textit{baz $@\, []$ = baz}}
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
  1024
  
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
  1025
\end{frame}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
  1026
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
  1027
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
  1028
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
330
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
  1029
\begin{frame}[c]
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
  1030
\frametitle{Languages, Strings}
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
  1031
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
  1032
\begin{itemize}
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
  1033
\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
  1034
\begin{center}
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
  1035
\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
  1036
\end{center}\bigskip
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
  1037
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
  1038
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
  1039
\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
  1040
\begin{center}
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
  1041
\bl{$\{[], hello, \textit{foobar}, a, abc\}$}
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
  1042
\end{center}\bigskip
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
  1043
332
4755ad4b457b updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 331
diff changeset
  1044
\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
  1045
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
  1046
\begin{center}
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
  1047
\begin{tabular}{rcl}
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
  1048
\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
  1049
\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
  1050
\end{tabular}
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
  1051
\end{center}
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
  1052
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
  1053
%\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
  1054
%  strings, or language.
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
  1055
\end{itemize}  
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
  1056
762
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1057
\only<2>{
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1058
\begin{textblock}{4}(10.5,8)
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1059
\small
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1060
Let
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1061
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1062
\bl{$A = \{foo, bar\}$} \bl{$B = \{a, b\}$}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1063
\[
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1064
\bl{A \,@\, B = \{fooa, foob, bara, barb\}}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1065
\]
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1066
\end{textblock}}  
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1067
330
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
  1068
\end{frame}
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
  1069
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
  1070
761
82a1315c128d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 758
diff changeset
  1071
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
82a1315c128d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 758
diff changeset
  1072
\begin{frame}[c]
762
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1073
  \frametitle{Two Corner Cases}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1074
   
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1075
  \Large
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1076
  \begin{center}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1077
  \bl{$A \,@\, \{[]\} = \;?$}\bigskip\bigskip\pause\\
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1078
  \bl{$A \,@\, \{\} = \;?$}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1079
  \end{center}  
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1080
    
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1081
  \end{frame}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1082
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1083
  
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1084
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1085
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1086
\begin{frame}[c]
761
82a1315c128d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 758
diff changeset
  1087
\frametitle{The Meaning of a Regex}
82a1315c128d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 758
diff changeset
  1088
82a1315c128d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 758
diff changeset
  1089
 ...all the strings a regular expression can match.   
82a1315c128d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 758
diff changeset
  1090
82a1315c128d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 758
diff changeset
  1091
\begin{center}
82a1315c128d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 758
diff changeset
  1092
 \begin{tabular}{rcl}
82a1315c128d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 758
diff changeset
  1093
 \bl{$L(\ZERO)$}  & \bl{$\dn$} & \bl{$\{\}$}\\
82a1315c128d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 758
diff changeset
  1094
 \bl{$L(\ONE)$}     & \bl{$\dn$} & \bl{$\{[]\}$}\\
82a1315c128d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 758
diff changeset
  1095
 \bl{$L(c)$}            & \bl{$\dn$} & \bl{$\{[c]\}$}\\
82a1315c128d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 758
diff changeset
  1096
 \bl{$L(r_1 + r_2)$}    & \bl{$\dn$} & \bl{$L(r_1) \cup L(r_2)$}\\
82a1315c128d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 758
diff changeset
  1097
 \bl{$L(r_1 \cdot r_2)$} & \bl{$\dn$} & \bl{$L(r_1) \,@\, L(r_2)$}\\
82a1315c128d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 758
diff changeset
  1098
 \bl{$L(r^*)$}           & \bl{$\dn$} & \\
82a1315c128d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 758
diff changeset
  1099
  \end{tabular}
82a1315c128d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 758
diff changeset
  1100
\end{center}
82a1315c128d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 758
diff changeset
  1101
82a1315c128d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 758
diff changeset
  1102
\begin{textblock}{14}(1.5,13.5)\small
82a1315c128d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 758
diff changeset
  1103
\bl{$L$} is a function from regular expressions to 
82a1315c128d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 758
diff changeset
  1104
sets of strings (languages):\smallskip\\
82a1315c128d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 758
diff changeset
  1105
\bl{\quad$L$ : Rexp $\Rightarrow$ Set$[$String$]$}
82a1315c128d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 758
diff changeset
  1106
\end{textblock}
82a1315c128d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 758
diff changeset
  1107
82a1315c128d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 758
diff changeset
  1108
\end{frame}
82a1315c128d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 758
diff changeset
  1109
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
82a1315c128d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 758
diff changeset
  1110
330
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
  1111
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1112
5
Christian Urban <urbanc@in.tum.de>
parents: 4
diff changeset
  1113
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1114
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1115
\begin{frame}[c]
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1116
  \frametitle{The Power Operation}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1117
  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1118
  \begin{itemize}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1119
  \item The \alert{\textbf{\boldmath$n$th Power}} of a language:
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1120
  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1121
  \begin{center}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1122
  \begin{tabular}{lcl}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1123
  \bl{$A^0$}    & \bl{$\dn$} & \bl{$\{[]\}$}\\
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1124
  \bl{$A^{n+1}$} & \bl{$\dn$} & \bl{$A \,@\, A^n$}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1125
  \end{tabular}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1126
  \end{center}\bigskip
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
  \item[] For example
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1129
  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1130
  \begin{center}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1131
  \begin{tabular}{lcl@{\hspace{10mm}}l}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1132
  \bl{$A^4$} & \bl{$=$} & \bl{$A \,@\, A \,@\, A \,@\, A$} & \bl{$(@\,\{[]\})$}\\
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1133
  \bl{$A^1$} & \bl{$=$} & \bl{$A$} & \bl{$(@\,\{[]\})$}\\
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1134
  \bl{$A^0$} & \bl{$=$} & \bl{$\{[]\}$}\\
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}
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
  \end{itemize}  
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
  \end{frame}
762
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1141
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1142
  
743
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1143
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1144
\begin{frame}[c]
745
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
  1145
\frametitle{The Meaning of a Regex}
743
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1146
762
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1147
\begin{textblock}{15}(1,4)
743
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1148
 \begin{tabular}{rcl}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1149
 \bl{$L(\ZERO)$}  & \bl{$\dn$} & \bl{$\{\}$}\\
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1150
 \bl{$L(\ONE)$}     & \bl{$\dn$} & \bl{$\{[]\}$}\\
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1151
 \bl{$L(c)$}            & \bl{$\dn$} & \bl{$\{[c]\}$}\\
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1152
 \bl{$L(r_1 + r_2)$}    & \bl{$\dn$} & \bl{$L(r_1) \cup L(r_2)$}\\
762
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1153
 \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) \}$}\\
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1154
 \bl{$L(r^*)$}           & \bl{$\dn$} & \onslide<2->{\bl{$\bigcup_{0 \le n} L(r)^n$}}\\
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1155
  \end{tabular}\bigskip
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1156
  
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1157
%\onslide<2->{
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1158
%\hspace{5mm}\bl{$L(r)^0 \;\dn\; \{[]\}$}\\
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1159
%\bl{$L(r)^{n+1} \;\dn\; L(r) \,@\, L(r)^n$}\hspace{9mm}\onslide<3->{\small\textcolor{gray}{(append on sets)}\\
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1160
%\small\hspace{5cm}\textcolor{gray}{$\{ s_1 @ s_2 \;|\; s_1\in L(r) \wedge s_2 \in L(r)^n \}$}}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1161
%}  
743
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1162
\end{textblock}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1163
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1164
\end{frame}
762
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1165
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
743
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1166
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 728
diff changeset
  1167
\begin{frame}[c]
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1168
  \frametitle{The Star Operation}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1169
  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1170
  \begin{itemize}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1171
  \item The \alert{\bf Kleene Star} of a \underline{language}:
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1172
  \bigskip
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1173
  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1174
  \begin{center}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1175
  \begin{tabular}{c}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1176
  \bl{$A\star \dn \bigcup_{0\le n} A^n$}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1177
  \end{tabular}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1178
  \end{center}\bigskip
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1179
  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1180
  \item[] This expands to 
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1181
  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1182
  \[
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1183
  \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
  1184
  \]
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1185
  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1186
  or
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1187
  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1188
  \small
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1189
  \[
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1190
  \bl{\{[]\} \;\cup\; A \;\cup\; A\,@\,A \;\cup\; 
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1191
    A\,@\,A\,@\,A \;\cup\; A\,@\,A\,@\,A\,@\,A \cup \ldots}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1192
  \]
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1193
  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1194
  \end{itemize}  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1195
  
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1196
  \end{frame}
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1197
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
762
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1198
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1199
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1200
\begin{frame}[c]
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1201
\frametitle{The Meaning of a Regex}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1202
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1203
\begin{textblock}{15}(1,4)
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1204
 \begin{tabular}{rcl}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1205
 \bl{$L(\ZERO)$}  & \bl{$\dn$} & \bl{$\{\}$}\\
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1206
 \bl{$L(\ONE)$}     & \bl{$\dn$} & \bl{$\{[]\}$}\\
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1207
 \bl{$L(c)$}            & \bl{$\dn$} & \bl{$\{[c]\}$}\\
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1208
 \bl{$L(r_1 + r_2)$}    & \bl{$\dn$} & \bl{$L(r_1) \cup L(r_2)$}\\
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1209
 \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) \}$}\\
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1210
 \bl{$L(r^*)$}           & \bl{$\dn$} & \bl{$(L(r))\star$}\\
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1211
  \end{tabular}
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1212
  
762
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1213
\end{textblock}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1214
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1215
\end{frame}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1216
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1217
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1218
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1219
\begin{frame}[c]
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1220
\frametitle{The Meaning of Matching}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1221
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1222
\begin{bubble}[10cm]
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1223
\large\bf 
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1224
A regular expression \bl{$r$} matches a string~\bl{$s$} 
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1225
provided
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1226
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1227
\begin{center}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1228
\bl{$s \in L(r)$}\\ 
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1229
\end{center}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1230
\end{bubble}\bigskip\bigskip
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1231
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1232
\ldots and the point of the next lecture is 
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1233
to decide this problem as fast as possible (unlike Python,
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1234
Ruby, Java)
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1235
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1236
\end{frame}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1237
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%      
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1238
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1239
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1240
\begin{frame}[c]
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1241
  \frametitle{Questions}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1242
  
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1243
  \begin{itemize}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1244
  \item Say \bl{$A = \{[a],[b],[c],[d]\}$}.\bigskip
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1245
  
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1246
  \item[]
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1247
  How many strings are in \bl{$A^4$}\,?
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1248
  \bigskip\medskip\pause
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1249
  
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1250
  
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1251
 \item[]
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1252
  What if \bl{$A = \{[a],[b],[c],[]\}$};\\ 
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1253
  how many strings are then in \bl{$A^4$}\,?
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1254
  \end{itemize}  
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1255
  
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1256
\end{frame}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1257
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1258
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1259
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1260
% \begin{frame}[c]
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1261
% \frametitle{Languages (Sets of Strings)}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1262
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1263
% \begin{itemize}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1264
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1265
% \item A \alert{\bf Language} is a set of strings, for example\medskip
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1266
% \begin{center}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1267
% \bl{$\{[], hello, foobar, a, abc\}$}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1268
% \end{center}\bigskip
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1269
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1270
% \item \alert{\bf Concatenation} for strings and languages
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1271
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1272
% \begin{center}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1273
% \begin{tabular}{rcl}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1274
% \bl{$foo\;@\;bar$} & \bl{$=$} & \bl{$foobar$}\medskip\\
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1275
% \bl{$A\;@\;B$}     & \bl{$\dn$} & \bl{$\{ s_1\,@\,s_2 \;\mid\; s_1 \in A \wedge s_2 \in B\}$}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1276
% \end{tabular}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1277
% \end{center}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1278
% \bigskip
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1279
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1280
% \small
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1281
% \item [] For example \bl{$A = \{foo, bar\}$}, \bl{$B = \{a, b\}$}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1282
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1283
% \[
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1284
% \bl{A \,@\, B = \{fooa, foob, bara, barb\}}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1285
% \]
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1286
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1287
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1288
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1289
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1290
% \end{itemize}  
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1291
% \end{frame}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1292
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1293
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1294
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1295
% \begin{frame}[c]
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1296
%   \frametitle{Two Corner Cases}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1297
   
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1298
%   \Large
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1299
%   \begin{center}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1300
%   \bl{$A \,@\, \{[]\} = \;?$}\bigskip\bigskip\pause\\
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1301
%   \bl{$A \,@\, \{\} = \;?$}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1302
%   \end{center}  
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1303
    
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1304
%   \end{frame}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1305
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1306
  
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1307
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1308
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1309
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1310
% \begin{frame}[c]
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1311
% \frametitle{The Meaning of a Regex}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1312
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1313
%  ...all the strings a regular expression can match.   
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1314
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1315
% \begin{center}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1316
%  \begin{tabular}{rcl}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1317
%  \bl{$L(\ZERO)$}  & \bl{$\dn$} & \bl{$\{\}$}\\
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1318
%  \bl{$L(\ONE)$}     & \bl{$\dn$} & \bl{$\{[]\}$}\\
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1319
%  \bl{$L(c)$}            & \bl{$\dn$} & \bl{$\{[c]\}$}\\
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1320
%  \bl{$L(r_1 + r_2)$}    & \bl{$\dn$} & \bl{$L(r_1) \cup L(r_2)$}\\
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1321
%  \bl{$L(r_1 \cdot r_2)$} & \bl{$\dn$} & \bl{$L(r_1) \,@\, L(r_2)$}\\
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1322
%  \bl{$L(r^*)$}           & \bl{$\dn$} & \\
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1323
%   \end{tabular}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1324
% \end{center}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1325
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1326
% \begin{textblock}{14}(1.5,13.5)\small
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1327
% \bl{$L$} is a function from regular expressions to 
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1328
% sets of strings (languages):\smallskip\\
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1329
% \bl{\quad$L$ : Rexp $\Rightarrow$ Set$[$String$]$}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1330
% \end{textblock}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1331
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1332
% \end{frame}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1333
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1334
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1335
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1336
% \begin{frame}[c]
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1337
% \frametitle{The Power Operation}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1338
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1339
% \begin{itemize}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1340
% \item The \alert{\textbf{\boldmath$n$th Power}} of a language:
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1341
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1342
% \begin{center}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1343
% \begin{tabular}{lcl}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1344
% \bl{$A^0$}    & \bl{$\dn$} & \bl{$\{[]\}$}\\
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1345
% \bl{$A^{n+1}$} & \bl{$\dn$} & \bl{$A \,@\, A^n$}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1346
% \end{tabular}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1347
% \end{center}\bigskip
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1348
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1349
% \item[] For example
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1350
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1351
% \begin{center}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1352
% \begin{tabular}{lcl@{\hspace{10mm}}l}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1353
% \bl{$A^4$} & \bl{$=$} & \bl{$A \,@\, A \,@\, A \,@\, A$} & \bl{$(@\,\{[]\})$}\\
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1354
% \bl{$A^1$} & \bl{$=$} & \bl{$A$} & \bl{$(@\,\{[]\})$}\\
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1355
% \bl{$A^0$} & \bl{$=$} & \bl{$\{[]\}$}\\
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1356
% \end{tabular}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1357
% \end{center}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1358
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1359
% \end{itemize}  
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1360
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1361
% \end{frame}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1362
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1363
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1364
631
f618dd4de24a updated
Christian Urban <urbanc@in.tum.de>
parents: 630
diff changeset
  1365
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1366
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1367
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
762
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1368
% \begin{frame}[c]
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1369
% \frametitle{Written Exam}
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
  1370
762
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1371
% \begin{itemize}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1372
% \item Accounts for 80\%.\bigskip
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
  1373
762
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1374
% \item The question ``\textit{Is this relevant for
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1375
%       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
  1376
762
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1377
% \item Deal: Whatever is in the homework (and is not marked
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1378
%       ``\textit{optional}'') is relevant for the exam.\bigskip
330
0806e45d873c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 328
diff changeset
  1379
      
762
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1380
% \item Each lecture has also a handout. There are also handouts about
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1381
% notation and Scala.      
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1382
% \end{itemize}
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
  1383
762
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1384
% \end{frame}
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
  1385
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
  1386
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
  1387
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
762
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1388
% \begin{frame}[t]
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1389
% \frametitle{Coursework}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1390
762
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1391
% \begin{itemize}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1392
% \item Accounts for 20\%. Two strands. Choose \alert{\bf one}!\bigskip
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1393
% \end{itemize}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1394
762
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1395
% \begin{columns}[t]
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1396
% \begin{column}{.5\textwidth}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1397
% \underline{\bf Strand 1}\medskip
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1398
% \begin{itemize}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1399
% \item 4 programming tasks:
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1400
% \begin{itemize}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1401
% \item matcher (4\%, 11.10.) 
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1402
% \item lexer (5\%, 04.11.)
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1403
% \item parser (5\%, 22.11.)
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1404
% \item compiler (6\%, 13.12.)
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1405
% \end{itemize}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1406
% \item in any lang.~you like,\\ but I want to see the\\ code
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1407
% \end{itemize}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1408
% \end{column}
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
  1409
762
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1410
% \hspace{-45pt}\vrule{}\hspace{10pt}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1411
% \begin{column}{.5\textwidth}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1412
% \underline{\bf Strand 2}\smallskip\begin{itemize}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1413
% \item one task: prove the correctness of a regular expression matcher in 
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1414
% the \underline{Isabelle} theorem prover
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1415
% \item 20\%, submission on~13.12.\hspace{-5mm}\mbox{}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1416
% \end{itemize}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1417
% \end{column}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1418
% \end{columns}\medskip
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
  1419
762
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1420
% \small
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1421
% \begin{itemize}
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1422
% \item Solving more than one strand will {\bf not} give you more 
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1423
% marks.
506
12a8f57f68ea updated
Christian Urban <urbanc@in.tum.de>
parents: 505
diff changeset
  1424
762
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1425
% \end{itemize}
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
  1426
762
e70df76926c0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 761
diff changeset
  1427
% \end{frame}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1428
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1429
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
  1430
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
745
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
  1431
%\begin{frame}[c]
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
  1432
%\frametitle{Lecture Capture}
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
  1433
%
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
  1434
%\begin{itemize}
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
  1435
%\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
  1436
%\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
  1437
%\begin{itemize}  
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
  1438
%\item Lecture recordings are a study and revision aid.
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
  1439
%\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
  1440
%  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
  1441
%\end{itemize}
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
  1442
%
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
  1443
%\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
  1444
%attend, you miss out!  
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
  1445
%  
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
  1446
%\end{itemize}
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
  1447
%
7dc3643a0cc5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 744
diff changeset
  1448
%\end{frame}
506
12a8f57f68ea updated
Christian Urban <urbanc@in.tum.de>
parents: 505
diff changeset
  1449
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
12a8f57f68ea updated
Christian Urban <urbanc@in.tum.de>
parents: 505
diff changeset
  1450
12a8f57f68ea updated
Christian Urban <urbanc@in.tum.de>
parents: 505
diff changeset
  1451
12a8f57f68ea updated
Christian Urban <urbanc@in.tum.de>
parents: 505
diff changeset
  1452
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12a8f57f68ea updated
Christian Urban <urbanc@in.tum.de>
parents: 505
diff changeset
  1453
\begin{frame}[c]
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
  1454
\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
  1455
769
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1456
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1457
\begin{tabular}{lll}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1458
  TAs: & Anton Luca-Dorin & (took the module last year)\\
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1459
       & Chengsong Tan    & (PhD student working on derivatives)  
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1460
\end{tabular}  
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
  1461
\mbox{}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
  1462
\end{frame}
769
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1463
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1464
\begin{frame}[c]
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1465
\begin{mybox3}{Coursework}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1466
  Do we need to provide instructions on running the coursework files
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1467
  if we're using languages other than Scala? Thanks
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1468
\end{mybox3}\pause
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1469
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1470
\begin{mybox2}{Zip-File for Coursework}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1471
  Please, please submit a zipfile that generates a subdirectory
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1472
  \begin{center}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1473
  \texttt{NameFamilyName}  
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1474
  \end{center}  
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1475
\end{mybox2}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1476
\end{frame}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1477
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1478
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1479
\begin{frame}[c]
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1480
\begin{mybox3}{Coursework}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1481
  What is the purpose of the workshop session on the timetable?
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1482
  
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1483
  Slightly confused about how to undertake cw1 and what exactly we
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1484
  should be implementing. This is more for clarification of the cw1
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1485
  structure, including the implementation and questions present in
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1486
  cw1.
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1487
\end{mybox3}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1488
\end{frame}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1489
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1490
\begin{frame}[c]
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1491
\begin{mybox3}{What is the trick?}\small
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1492
  What was the trick to improve the evil regular expressions matcher
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1493
  to have such good results compared to other programming languages?
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1494
  Is it working better on casual regular expressions (the ones that
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1495
  Python and Java handle pretty well), too? Or was it just optimised
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1496
  for these evil ones?
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1497
\end{mybox3}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1498
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1499
\begin{mybox3}{}\small
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1500
  It was shown in the lectures that the pattern matching algorithms
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1501
  currently implemented in popular programming languages (Python, JS,
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1502
  Java, etc) are far slower than the algorithm we are going to be
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1503
  implementing in this module. My question is why do these programming
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1504
  languages not implement the algorithm that we are going to implement
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1505
  in this module?
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1506
\end{mybox3}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1507
\end{frame}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1508
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1509
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1510
\begin{frame}[c]
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1511
  \frametitle{Thanks to Martin Mikusovic}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1512
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1513
\bigskip    
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1514
\begin{center}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1515
\begin{tikzpicture}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1516
  \begin{axis}[
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1517
    xlabel={$n$},
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1518
    x label style={at={(1.05,0.0)}},
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1519
    ylabel={time in secs},
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1520
    enlargelimits=false,
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1521
    xtick={0,5,...,30},
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1522
    xmax=33,
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1523
    ymax=35,
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1524
    ytick={0,10,...,30},
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1525
    scaled ticks=false,
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1526
    axis lines=left,
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1527
    width=9cm,
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1528
    height=5.5cm, 
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1529
    legend entries={Java 8, Python, JavaScript, Swift},  
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1530
    legend pos=north west,
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1531
    legend cell align=left]
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1532
\addplot[blue,mark=*, mark options={fill=white}] table {re-python2.data};
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1533
\addplot[cyan,mark=*, mark options={fill=white}] table {re-java.data};
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1534
\addplot[red,mark=*, mark options={fill=white}] table {re-js.data};
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1535
\addplot[magenta,mark=*, mark options={fill=white}] table {re-swift.data};
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1536
\end{axis}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1537
\end{tikzpicture}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1538
\end{center}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1539
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1540
Regex: \bl{$(a^*)^* \cdot b$}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1541
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1542
Strings of the form \bl{$\underbrace{\,a\ldots a\,}_{n}$}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1543
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1544
\end{frame}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1545
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1546
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1547
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1548
\begin{frame}[c]
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1549
\frametitle{Same Example in Java 9+}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1550
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1551
\begin{center}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1552
\begin{tikzpicture}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1553
  \begin{axis}[
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1554
    xlabel={$n$},
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1555
    x label style={at={(1.09,-0.15)}},
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1556
    ylabel={time in secs},
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1557
    scaled x ticks=false,
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1558
    enlargelimits=false,
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1559
    xtick distance=10000,
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1560
    xmax=44000, 
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1561
    ytick={0,10,...,30}, 
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1562
    ymax=35, 
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1563
    axis lines=left,
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1564
    width=9cm,
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1565
    height=5cm, 
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1566
    legend entries={Java \liningnums{9}+},
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1567
    legend pos=north west,
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1568
    legend cell align=left]
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1569
\addplot[blue,mark=square*,mark options={fill=white}] table {re-java9.data};
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1570
\end{axis}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1571
\end{tikzpicture}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1572
\end{center}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1573
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1574
Regex: \bl{$(a^*)^* \cdot b$}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1575
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1576
Strings of the form \bl{$\underbrace{\,a\ldots a\,}_{n}$}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1577
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1578
\end{frame}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1579
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
778
3e5f5d19f514 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 769
diff changeset
  1580
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3e5f5d19f514 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 769
diff changeset
  1581
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3e5f5d19f514 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 769
diff changeset
  1582
% Questions
769
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1583
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1584
\begin{frame}[c]
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1585
\begin{mybox3}{}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1586
  Are there any (common) languages that have a built-in regex
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1587
  implementation matching the set of functions of a formal 'simple'
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1588
  regular expression, as opposed to an 'extended' regular expression
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1589
  implemented in most regex-supporting languages?
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1590
\end{mybox3}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1591
\end{frame}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1592
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1593
\begin{frame}[c]
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1594
\begin{mybox3}{Passing Mark}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1595
  I believe the assessment is 70\% coursework (broken into 10\% weekly
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1596
  stuff, 15\% mid term exam and 45\% CW in any programming language)
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1597
  and 30\% January exam. However, I would like to know if we just need
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1598
  40\% overall to pass the module or pass the each component
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1599
  individually?
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1600
\end{mybox3}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1601
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1602
\hfill$\Rightarrow$ 40\% overall
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1603
\end{frame}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1604
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1605
\begin{frame}[c]
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1606
\begin{mybox3}{Regexes}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1607
  Can we determine all the possible regular expressions matching a
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1608
  certain string? If we take into account all the possible ways to
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1609
  combine the operations: \bl{$\ZERO$}, \bl{$\ONE$},
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1610
  \bl{$r_1 + r_2$}, \bl{$r_1 \cdot r_2$}, \bl{$r^*$}?
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1611
\end{mybox3}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1612
\end{frame}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1613
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1614
\begin{frame}[c]
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1615
\begin{mybox3}{\bl{$L$} + Equivalence}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1616
  When we explain why two regular expressions are not equivalent, what
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1617
  method is better for us, using mathematics formulas or making an
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1618
  example? 
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1619
\end{mybox3}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1620
\begin{mybox3}{}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1621
  Meaning of Regex and Operations
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1622
\end{mybox3}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1623
\end{frame}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1624
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1625
\begin{frame}[c]
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1626
\begin{mybox3}{\bl{$L$}}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1627
  Can the function L be applied to anything other than regular
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1628
  expressions? For example would L(L(c)) return anything?
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1629
\end{mybox3}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1630
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1631
\hfill $\Rightarrow$ No
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1632
\end{frame} 
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1633
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1634
\begin{frame}[c]
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1635
\begin{mybox3}{\bl{$(a?)\{n\} \cdot a\{n\}$}}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1636
  In the evil regexes section, is there any reason why in the regex
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1637
  \texttt{[a?]\{n\}[a]\{n\}} the square brackets are used? It is defined as a
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1638
  single character from the square brackets, however there is just one
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1639
  character, so it seems like it is not necessary. Maybe it is just
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1640
  necessary for the first part, because ? is a token instead of a
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1641
  character and we need to refer to a? as a ``unit''? Could regular
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1642
  brackets be used instead? Is there any difference apart from the
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1643
  fact that it would create a group? Also, are the regexes
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1644
  \texttt{[a?]\{n\}} and
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1645
  \texttt{a\{0,3\}} equivalent?
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1646
\end{mybox3}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1647
\end{frame} 
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1648
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1649
\begin{frame}[c]
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1650
\begin{mybox3}{Python + Parser Combinators (CW3)}\small
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1651
  Hi Christian,
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1652
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1653
  I don’t see a problem: you certainly have higher order functions and
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1654
  it is easy to implement algebraic data types using classes. As far
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1655
  as I can see that’s all you need. You don’t get the static types but
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1656
  that should be obvious. Basically if you can do it in LISP you can
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1657
  do it in Python. The only problem could be stack overflows due to a
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1658
  lack of tail recursion optimisation. On the other hand you can
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1659
  simulate laziness using generators.
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1660
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1661
  Cheers,
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1662
  Thorsten 
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1663
\end{mybox3}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1664
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1665
Trees \url{https://youtu.be/7tCNu4CnjVc}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1666
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1667
Laziness \url{https://youtu.be/5jwV3zxXc8E}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1668
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1669
\end{frame}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1670
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1671
\begin{frame}[c]
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1672
\begin{mybox3}{}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1673
  What suggestions do you have for us to get the most out of this
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1674
  module, especially in the online format? I.e. form discussion
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1675
  groups, will you have office hours?
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1676
\end{mybox3}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1677
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1678
\small
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1679
\hfill $\Rightarrow$\mbox{} Discussion Forum on KEATS
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1680
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1681
\hfill online tutorial sessions
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1682
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1683
\hfill ???
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1684
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1685
\hfill PL-groups for ``exotic'' langs
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1686
\end{frame}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1687
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1688
\begin{frame}[c]
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1689
 \small
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1690
\begin{mybox3}{}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1691
Where do most students struggle with this module? What will the format
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1692
of the exam be? What is the most efficient way of studying for the
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1693
exam? There are plenty of resources available on KEATS, but is there
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1694
anything else you'd recommend us to study? Although (just by skimming
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1695
the headings) the module seems to be a combination of practical and
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1696
theoretical matters, exactly in what field would the syllabus be
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1697
applied? Besides these questions and the ones other students asked, is
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1698
there anything else we should know? Thank you!
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1699
\end{mybox3}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1700
\end{frame}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1701
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1702
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1703
\begin{frame}[c]
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1704
\end{frame}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1705
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1706
\begin{frame}[c]
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1707
\end{frame}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1708
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1709
\begin{frame}[c]
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1710
\end{frame}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1711
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1712
\begin{frame}[c]
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1713
\end{frame}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1714
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1715
\begin{frame}[c]
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1716
\end{frame}
f9686b22db7e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 767
diff changeset
  1717
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
  1718
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1719
\end{document}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1720
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1721
%%% Local Variables:  
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1722
%%% mode: latex
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1723
%%% TeX-master: t
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1724
%%% End: 
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1725