slides/slides01.tex
author Christian Urban <christian dot urban at kcl dot ac dot uk>
Fri, 28 Nov 2014 13:11:17 +0000
changeset 313 90ccc385c547
parent 255 96a99237fa42
child 327 9470cd124667
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
95
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
     1
\documentclass[dvipsnames,14pt,t,xelatex]{beamer}
252
e8ef8f38ca84 added style files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
     2
\usepackage{../slides}
e8ef8f38ca84 added style files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
     3
\usepackage{../graphics}
215
828303e8e4af updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 98
diff changeset
     4
\usepackage{../langs}
828303e8e4af updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 98
diff changeset
     5
\usepackage{../data}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     6
252
e8ef8f38ca84 added style files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
     7
\hfuzz=220pt 
e8ef8f38ca84 added style files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
     8
254
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
     9
%\setmonofont[Scale=.88]{Consolas}
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
    10
%\newfontfamily{\consolas}{Consolas}
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
    11
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
    12
\lstset{language=Scala,
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
    13
        style=mystyle,
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
    14
        numbersep=0pt,
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
    15
        numbers=none,
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
    16
        xleftmargin=0mm}
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
    17
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
    18
\newcommand{\bl}[1]{\textcolor{blue}{#1}}     
95
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    19
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    20
% beamer stuff 
252
e8ef8f38ca84 added style files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
    21
\renewcommand{\slidecaption}{AFL 01, King's College London}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    22
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    23
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    24
\begin{document}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    25
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    26
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
    27
\begin{frame}[t]
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    28
\frametitle{%
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    29
  \begin{tabular}{@ {}c@ {}}
1
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
    30
  \\[-3mm]
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
    31
  \LARGE Automata and \\[-2mm] 
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
    32
  \LARGE Formal Languages (1)\\[-3mm] 
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    33
  \end{tabular}}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    34
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    35
  \begin{center}
1
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
    36
  \includegraphics[scale=0.3]{pics/ante1.jpg}\hspace{5mm}
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
    37
  \includegraphics[scale=0.31]{pics/ante2.jpg}\\
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
    38
  \footnotesize\textcolor{gray}{Antikythera automaton, 100 BC (Archimedes?)}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    39
  \end{center}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    40
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    41
\normalsize
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    42
  \begin{center}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    43
  \begin{tabular}{ll}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    44
  Email:  & christian.urban at kcl.ac.uk\\
95
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    45
  Office: & S1.27 (1st floor Strand Building)\\
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    46
  Slides: & KEATS
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    47
  \end{tabular}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    48
  \end{center}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    49
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    50
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
    51
\end{frame}
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
    52
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    53
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    54
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    55
\begin{frame}[c]
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
    56
\frametitle{The Goal of this Course}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    57
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
    58
\begin{center}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
    59
  \begin{tikzpicture}[scale=1,
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
    60
                      node/.style={
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
    61
                      rectangle,rounded corners=3mm,
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
    62
                      very thick,draw=black!50,minimum height=18mm, minimum width=20mm,
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
    63
                      top color=white,bottom color=black!20}]
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
    64
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
    65
  \node at (3.05, 1.8) {\Large\bf A Compiler};
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
    66
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
    67
  \node (0) at (-2.3,0) {}; 
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
    68
  
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
    69
  \node (A) at (0,0)  [node] {};
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
    70
  \node [below right] at (A.north west) {lexer};
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
    71
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
    72
  \node (B) at (3,0)  [node] {};
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
    73
  \node [below right=1mm] at (B.north west) {\mbox{}\hspace{-1mm}parser};
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    74
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
    75
  \node (C) at (6,0)  [node] {};
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
    76
  \node [below right] at (C.north west) {\mbox{}\hspace{-1mm}code gen};
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
    77
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
    78
  \node (1) at (8.4,0) {}; 
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
    79
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
    80
  \draw [->,line width=4mm] (0) -- (A); 
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
    81
  \draw [->,line width=4mm] (A) -- (B); 
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
    82
  \draw [->,line width=4mm] (B) -- (C); 
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
    83
  \draw [->,line width=4mm] (C) -- (1); 
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    84
  \end{tikzpicture}
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
    85
  \end{center}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    86
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
    87
\only<2,3>{
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
    88
\begin{textblock}{1}(1,2)
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
    89
\begin{bubble}[9.8cm]
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
    90
\normalsize
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
    91
lexer input: a string\smallskip\\
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
    92
\hspace{5mm}\code{"read(n);"}\medskip\\
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
    93
lexer output: a sequence of tokens\smallskip\\
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
    94
\hspace{5mm}\code{key(read); lpar; id(n); rpar; semi}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
    95
\end{bubble}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
    96
\end{textblock}}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    97
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
    98
\only<3>{
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
    99
\begin{textblock}{1}(6,7.8)
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   100
\begin{tabular}{c}
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   101
\includegraphics[scale=0.2]{../pics/rosetta.jpg}\\[-2mm]
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   102
\footnotesize lexing $\Rightarrow$ recognising words (Stone of Rosetta)
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   103
\end{tabular}
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   104
\end{textblock}}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   105
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   106
\only<4>{
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   107
\begin{textblock}{1}(1,1.5)
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   108
\begin{bubble}[8.5cm]
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   109
\normalsize
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   110
parser input: a sequence of token\smallskip\\
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   111
parser output: an abstract syntax tree\smallskip\\
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   112
\footnotesize
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   113
\hspace{2cm}\begin{tikzpicture}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   114
  \node {\code{read}}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   115
    child {node {\code{lpar}}}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   116
    child {node {\code{n}}}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   117
    child {node {\code{rpar}}};
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   118
\end{tikzpicture}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   119
\end{bubble}
1
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   120
\end{textblock}}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   121
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   122
\only<5,6>{
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   123
\begin{textblock}{1}(1,1.5)
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   124
\begin{bubble}[4cm]
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   125
\normalsize
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   126
code generator:\smallskip\\
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   127
\hspace{5mm}\code{istore 2}\\ 
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   128
\hspace{5mm}\code{iload 2}\\ 
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   129
\hspace{5mm}\code{ldc 10}\\
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   130
\hspace{5mm}\code{isub}\\
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   131
\hspace{5mm}\code{ifeq Label2}\\ 
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   132
\hspace{5mm}\code{iload 2}\\
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   133
\hspace{5mm}\code{...}\\
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   134
\end{bubble}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   135
\end{textblock}}
1
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   136
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   137
\only<6>{
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   138
\begin{textblock}{6}(8.4,7)
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   139
\begin{bubble}[5cm]
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   140
\mbox{\begin{tikzpicture}[scale=0.58,rounded corners=0mm]
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   141
\begin{axis}[axis x line=bottom, axis y line=left, ylabel=secs,
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   142
    xlabel=n,
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   143
    enlargelimits=0.05,
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   144
    ybar interval=0.7, legend style=small]
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   145
\addplot file {interpreted2.data};
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   146
\addplot file {compiled2.data};
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   147
%\legend{interpreted, compiled}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   148
\end{axis}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   149
\end{tikzpicture}}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   150
\end{bubble}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   151
\end{textblock}}
1
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   152
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   153
\end{frame}
1
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   154
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   155
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   156
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   157
\begin{frame}[c]
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   158
\frametitle{The subject is quite old}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   159
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   160
\begin{itemize}
1
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   161
\item Turing Machines, 1936
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   162
\item Regular Expressions, 1956\\
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   163
\item The first compiler for COBOL, 1957\\ (Grace Hopper)
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   164
\item But surprisingly research papers are still published nowadays
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   165
\end{itemize}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   166
1
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   167
\begin{flushright}
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   168
\includegraphics[scale=0.3]{pics/hopper.jpg}\\
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   169
\footnotesize\textcolor{gray}{Grace Hopper}
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   170
\end{flushright}
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   171
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   172
\mbox{}\\[-10mm]
1
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   173
{\footnotesize\textcolor{gray}{(she made it to David Letterman's Tonight Show, \url{http://www.youtube.com/watch?v=aZOxtURhfEU})}}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   174
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   175
\end{frame}
1
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   176
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   177
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   178
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   179
\begin{frame}[c]
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   180
\frametitle{Why Bother?}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   181
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   182
\begin{columns}[b]
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   183
\begin{column}{.5\textwidth}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   184
Ruby, Python\\ and Others\bigskip\\
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   185
\begin{tikzpicture}[y=.08cm, x=.10cm]
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   186
   %axis
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   187
   \draw (0,0) -- coordinate (x axis mid) (30,0);
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   188
   \draw (0,0) -- coordinate (y axis mid) (0,30);
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   189
   %ticks
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   190
   \foreach \x in {0,5,...,30}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   191
     \draw (\x,1pt) -- (\x,-3pt) node[anchor=north] {\footnotesize\x};
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   192
   \foreach \y in {0,5,...,30}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   193
     \draw (1pt,\y) -- (-3pt,\y) node[anchor=east] {\footnotesize\y}; 
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   194
	%labels      
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   195
	\node[below=0.6cm] at (x axis mid) {\footnotesize number of \texttt{a}s};
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   196
	\node[rotate=90,left=1cm] at (y axis mid) {\footnotesize time in secs};
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   197
	%plots
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   198
	\draw[color=blue] plot[mark=*] 
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   199
		file {re-python.data};
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   200
	\draw[color=brown] plot[mark=triangle*] 
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   201
		file {re-ruby.data};	 
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   202
   %legend
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   203
	\begin{scope}[shift={(4,20)}] 
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   204
	\draw[color=blue] (0,0) -- 
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   205
		plot[mark=*] (0.25,0) -- (0.5,0) 
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   206
		node[right]{\small Python};
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   207
	\draw[yshift=-\baselineskip, color=brown] (0,0) -- 
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   208
		plot[mark=triangle*] (0.25,0) -- (0.5,0)
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   209
		node[right]{\small Ruby};
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   210
	\end{scope}	
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   211
\end{tikzpicture}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   212
\end{column}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   213
\begin{column}{.5\textwidth}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   214
Us (after this course)\\\mbox{}\bigskip\\
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   215
\begin{tikzpicture}[y=.08cm, x=.0003cm]
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   216
 	%axis
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   217
	\draw (0,0) -- coordinate (x axis mid) (12000,0);
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   218
   \draw (0,0) -- coordinate (y axis mid) (0,30);
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   219
   %ticks
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   220
   \foreach \x in {0,4000,...,12000}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   221
     	\draw (\x,1pt) -- (\x,-3pt) node[anchor=north] {\footnotesize\x};
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   222
   \foreach \y in {0,5,...,30}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   223
     	\draw (1pt,\y) -- (-3pt,\y) node[anchor=east] {\footnotesize\y}; 
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   224
	%labels      
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   225
	\node[below=0.6cm] at (x axis mid) {\footnotesize number of \texttt{a}s};
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   226
	\node[rotate=90, left=1cm] at (y axis mid) {\footnotesize time in secs};
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   227
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   228
	%plots
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   229
   \draw[color=green] plot[mark=square*, mark options={fill=white} ] 
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   230
		file {re2b.data};
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   231
	\draw[color=black] plot[mark=square*, mark options={fill=white} ] 
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   232
		file {re3.data};	 
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   233
\end{tikzpicture}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   234
\end{column}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   235
\end{columns}\bigskip\medskip
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   236
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   237
\hspace{2cm}matching \texttt{[a?]\{n\}[a]\{n\}} against 
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   238
$\underbrace{\texttt{a}...\texttt{a}}_n$
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   239
\end{frame}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   240
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   241
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   242
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   243
\begin{frame}[c]
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   244
\frametitle{Lectures 1 - 6}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   245
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   246
transforming strings into structured data\\[10mm]
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   247
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   248
\alert<2>{\LARGE\bf Lexing} \onslide<2>{\hfill{}baseed on regular expressions}\medskip\\
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   249
\hspace{5mm}(recognising ``words'')\\[6mm]
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   250
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   251
{\LARGE\bf Parsing}\medskip\\
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   252
\hspace{5mm}(recognising ``sentences'')
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   253
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   254
\begin{textblock}{1}(10,9.1)
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   255
\begin{tabular}{c}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   256
\includegraphics[scale=0.1]{../pics/rosetta.jpg}\\[-2mm]
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   257
\footnotesize Stone of Rosetta
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   258
\end{tabular}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   259
\end{textblock}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   260
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   261
\end{frame}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   262
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   263
1
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   264
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   265
\begin{frame}[t]
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   266
\frametitle{Familiar Regular Expr.}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   267
\small
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   268
\begin{center}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   269
\texttt{[a-z0-9\_.-]+ @ [a-z0-9.-]+ . [a-z.]\{2,6\}}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   270
\end{center}\smallskip
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   271
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   272
\begin{center}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   273
\begin{tabular}{@{}lp{8.5cm}@{}}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   274
\pcode{re*} & matches 0 or more times\\
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   275
\pcode{re+} & matches 1 or more times\\
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   276
\pcode{re?} & matches 0 or 1 times\\
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   277
\pcode{re\{n\}}	& matches exactly \pcode{n} number of times\\
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   278
\pcode{re\{n,m\}} & matches at least \pcode{n} and at most {\tt m} times\\
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   279
\pcode{[...]} & matches any single character inside the brackets\\
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   280
\pcode{[^...]} & matches any single character not inside the 
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   281
brackets\\
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   282
\pcode{a-zA-Z} & character ranges\\
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   283
\pcode{\\d} & matches digits; equivalent to \pcode{[0-9]}\\
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   284
\pcode{.} & matches every character except newline\\
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   285
\pcode{(re)}	& groups regular expressions and remembers 
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   286
the matched text
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   287
\end{tabular}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   288
\end{center}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   289
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   290
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   291
\end{frame}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   292
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   293
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   294
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   295
\begin{frame}[c]
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   296
\frametitle{Today}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   297
1
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   298
\begin{itemize}
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   299
\item the ultimate goal is to implement a small compiler 
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   300
(a really small one for the JVM)\bigskip
1
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   301
\end{itemize}
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   302
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   303
Let's start with:
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   304
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   305
\begin{itemize}
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   306
\item a web-crawler
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   307
\item an email harvester
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   308
\item a web-scraper
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   309
\end{itemize}
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   310
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   311
\end{frame}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   312
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   313
2
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   314
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   315
\begin{frame}[t]
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   316
\frametitle{A Web-Crawler}
2
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   317
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   318
\mbox{}\\[10mm]
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   319
2
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   320
\begin{enumerate}
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   321
\item given an URL, read the corresponding webpage
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   322
\item extract all links from it
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   323
\item call the web-crawler again for all these links
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   324
\end{enumerate}
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   325
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   326
\end{frame}
2
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   327
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   328
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   329
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   330
\mode<presentation>{
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   331
\begin{frame}[t]
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   332
\frametitle{A Web-Crawler}
2
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   333
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   334
\mbox{}\\[10mm]
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   335
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   336
2
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   337
\begin{enumerate}
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   338
\item given an URL, read the corresponding webpage
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   339
\item if not possible print, out a problem
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   340
\item if possible, extract all links from it
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   341
\item call the web-crawler again for all these links
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   342
\end{enumerate}\bigskip\pause
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   343
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   344
\small (we need a bound for the number of recursive calls)
2
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   345
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   346
\small (the purpose is to check all links on my own webpage)
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   347
\end{frame}}
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   348
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   349
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   350
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   351
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   352
\begin{frame}[c]
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   353
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   354
\begin{textblock}{1}(2,5)
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   355
\begin{tabular}{c}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   356
\includegraphics[scale=0.15]{pics/servers.png}\\[-2mm]
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   357
\small Server
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   358
\end{tabular}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   359
\end{textblock}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   360
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   361
\begin{textblock}{1}(5.6,4)
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   362
  \begin{tikzpicture}[scale=1.1]
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   363
  \draw[white] (0,1) node (X) {};
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   364
  \draw[white] (2,1) node (Y) {};
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   365
   \draw[white] (0,0) node (X1) {};
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   366
  \draw[white] (2,0) node (Y1) {};
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   367
   \draw[white] (0,-1) node (X2) {};
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   368
  \draw[white] (2,-1) node (Y2) {};
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   369
  \draw[red, <-, line width = 2mm] (X) -- (Y);
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   370
  \node [inner sep=5pt,label=above:\textcolor{black}{GET request}] at ($ (X)!.5!(Y) $) {};
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   371
  \draw[red, ->, line width = 2mm] (X1) -- (Y1);
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   372
  \node [inner sep=5pt,label=above:\textcolor{black}{webpage}] at ($ (X1)!.5!(Y1) $) {};
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   373
  \draw[red, <-, line width = 2mm] (X2) -- (Y2);
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   374
  \node [inner sep=7pt,label=above:\textcolor{black}{POST data}] at ($ (X2)!.5!(Y2) $) {};
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   375
  \end{tikzpicture}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   376
\end{textblock}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   377
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   378
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   379
\begin{textblock}{1}(9,5.5)
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   380
\begin{tabular}{c}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   381
\includegraphics[scale=0.15]{pics/laptop.png}\\[-2mm]
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   382
\small Browser
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   383
\end{tabular}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   384
\end{textblock}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   385
\end{frame}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   386
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   387
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   388
  
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   389
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   390
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   391
\begin{frame}[c]
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   392
\frametitle{Scala}
1
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   393
254
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   394
\small A simple Scala function for reading webpages:
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   395
\smallskip
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   396
98
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   397
\footnotesize
254
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   398
\lstinputlisting{../progs/app0.scala}
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   399
\medskip\pause
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   400
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   401
\lstinline{get_page("""http://www.inf.kcl.ac.uk/staff/urbanc/""")}
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   402
\bigskip\medskip\pause
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   403
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   404
254
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   405
\small A slightly more complicated version for handling errors properly:
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   406
\smallskip
2
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   407
98
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   408
\footnotesize
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   409
\lstinputlisting{../progs/app1.scala}
1
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   410
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   411
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   412
\end{frame}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   413
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   414
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   415
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
98
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   416
\begin{frame}[c]
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   417
\frametitle{Why Scala?}
98
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   418
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   419
\begin{textblock}{6}(1,3)
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   420
\begin{tabular}{l}
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   421
\mbox{}\hspace{-1mm}\includegraphics[scale=0.36]{pics/twitter.png}\\[-1mm]
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   422
\includegraphics[scale=0.30]{pics/linked.png}\\
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   423
\includegraphics[scale=0.30]{pics/guardian.jpg}\\[-3mm]
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   424
\mbox{}\hspace{-2mm}\includegraphics[scale=0.38]{pics/morgan.png}\\[-3mm]
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   425
\includegraphics[scale=0.30]{pics/suisse.png}\\
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   426
\includegraphics[scale=0.20]{pics/edf.png}\\[-1mm]
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   427
\includegraphics[scale=0.08]{pics/novell.png}\\[-1mm]
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   428
\includegraphics[scale=0.30]{pics/foursquare.png}\\
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   429
\includegraphics[scale=0.30]{pics/hsbc.png}\\
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   430
{\large\bf ...}
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   431
\end{tabular}
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   432
\end{textblock}
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   433
 
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   434
\only<2->{  
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   435
\begin{textblock}{6}(6,3)
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   436
\includegraphics[scale=0.35]{pics/jobgraph.png}\\
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   437
\end{textblock}}  
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   438
  
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   439
\only<3->{  
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   440
\begin{textblock}{6}(7.3,9.2)
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   441
\begin{tabular}{l}
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   442
\footnotesize 2013: 1$\%$\\[-2mm]
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   443
\footnotesize 2014: 3$\%$\\[-2mm]
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   444
\footnotesize 2015: 9$\%$\\[-2mm]
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   445
\footnotesize 2016: 27$\%$\\[-2mm]
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   446
\footnotesize 2017: 81$\%$\\[-2mm]
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   447
\footnotesize 2018: 243$\%$ \raisebox{-1mm}{\includegraphics[scale=0.02]{pics/smiley.jpg}}
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   448
\end{tabular}
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   449
\end{textblock}} 
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   450
  
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   451
\only<3->{  
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   452
\begin{textblock}{6}(6,9.5)
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   453
\footnotesize 5 yrs $\begin{cases}\mbox{}\\[1.4cm]\end{cases}$
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   454
\end{textblock}}
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   455
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   456
\only<4->{  
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   457
\begin{textblock}{11}(5,14.1)
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   458
\textcolor{gray}{
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   459
\footnotesize {\bf in London today:} 1 Scala job for every 30 Java jobs;\\[-2mm]
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   460
Scala programmers seem to get up to 20\% better salary}
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   461
\end{textblock}}
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   462
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   463
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   464
\only<5->{
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   465
\begin{textblock}{1}(3,6)
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   466
\begin{bubble}[8.5cm]
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   467
\normalsize
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   468
Scala is a functional and object-oriented programming
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   469
language; compiles to the JVM; does not need null-pointer
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   470
exceptions; a course on Coursera\\
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   471
\mbox{}\hfill\url{http://www.scala-lang.org}
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   472
\end{bubble}
98
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   473
\end{textblock}}
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   474
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   475
\end{frame}
98
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   476
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   477
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   478
1f3d89fe9820 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 97
diff changeset
   479
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   480
\begin{frame}[t]
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   481
\frametitle{A Regular Expression}
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   482
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   483
\begin{itemize}
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   484
\item \ldots{} is a pattern or template for specifying strings
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   485
\end{itemize}\bigskip
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   486
  
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   487
\begin{center}  
254
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   488
\only<1>{\scode{"https?://[^"]*"}}%
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   489
\only<2>{\scode{""""https?://[^"]*"""".r}}
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   490
\end{center}\bigskip\bigskip
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   491
254
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   492
matches for example\smallskip\\  
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   493
\hspace{2mm}\code{"http://www.foobar.com"}\\
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   494
\hspace{2mm}\code{"https://www.tls.org"}\\
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   495
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   496
\end{frame}
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   497
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   498
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   499
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
254
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   500
\begin{frame}[t]
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   501
\frametitle{Finding Operations}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   502
254
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   503
{\bf\code{rexp.findAllIn(string)}}\medskip
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   504
  
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   505
returns a list of all (sub)strings that match the 
254
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   506
regular expression
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   507
\bigskip\bigskip  
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   508
  
254
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   509
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   510
{\bf\code{rexp.findFirstIn(string)}}\medskip
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   511
 
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   512
returns either 
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   513
254
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   514
\begin{itemize}
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   515
\item \code{None} if no (sub)string matches or 
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   516
\item \code{Some(s)} with the first (sub)string
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   517
\end{itemize}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   518
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   519
\end{frame}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   520
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   521
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   522
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   523
\begin{frame}[c]
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   524
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   525
\footnotesize
254
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   526
\lstinputlisting{../progs/app2.scala}
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   527
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   528
\end{frame}
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   529
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   530
254
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   531
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   532
\begin{frame}[c]
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   533
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   534
\small
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   535
A version that only crawls links in ``my'' domain:
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   536
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   537
\footnotesize
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   538
\lstinputlisting{../progs/app3.scala}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   539
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   540
\end{frame}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   541
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   542
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   543
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   544
\begin{frame}[c]
254
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   545
\lstset{xleftmargin=-4mm}
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   546
\small
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   547
A little email harvester:
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   548
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   549
\footnotesize
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   550
\lstinputlisting{../progs/app4.scala}\bigskip
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   551
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   552
\tiny
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   553
\url{http://net.tutsplus.com/tutorials/other/8-regular-expressions-you-should-know/}
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   554
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   555
\end{frame}
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   556
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   557
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   558
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
14
Christian Urban <urbanc@in.tum.de>
parents: 13
diff changeset
   559
\begin{frame}[t]
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   560
\frametitle{\begin{tabular}{c}Regular Expressions\end{tabular}}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   561
14
Christian Urban <urbanc@in.tum.de>
parents: 13
diff changeset
   562
Their inductive definition:\medskip
Christian Urban <urbanc@in.tum.de>
parents: 13
diff changeset
   563
Christian Urban <urbanc@in.tum.de>
parents: 13
diff changeset
   564
\begin{textblock}{6}(2,5)
254
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   565
  \begin{tabular}{rrl@ {\hspace{13mm}}l}
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   566
  \bl{$r$} & \bl{$::=$}  & \bl{$\varnothing$}   & null\\
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   567
           & \bl{$\mid$} & \bl{$\epsilon$}      & empty string / \pcode{""} / \pcode{[]}\\
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   568
           & \bl{$\mid$} & \bl{$c$}             & character\\
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   569
           & \bl{$\mid$} & \bl{$r_1 \cdot r_2$} & sequence\\
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   570
           & \bl{$\mid$} & \bl{$r_1 + r_2$}     & alternative / choice\\
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   571
           & \bl{$\mid$} & \bl{$r^*$}           & star (zero or more)\\
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   572
  \end{tabular}
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   573
  \end{textblock}
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   574
  
254
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   575
\end{frame}
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   576
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   577
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   578
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   579
\begin{frame}[t]
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   580
\frametitle{Regular Expressions}
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   581
14
Christian Urban <urbanc@in.tum.de>
parents: 13
diff changeset
   582
\small
254
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   583
In Scala:\bigskip
14
Christian Urban <urbanc@in.tum.de>
parents: 13
diff changeset
   584
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   585
\footnotesize
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   586
\lstinputlisting{../progs/app51.scala}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   587
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   588
  
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   589
\end{frame}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   590
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   591
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   592
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   593
\begin{frame}[t]
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   594
\frametitle{Strings}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   595
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   596
\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
   597
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   598
\begin{center}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   599
\bl{$[h, e, l, l, o]$}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   600
\end{center}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   601
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   602
the empty string: $[]$ or \pcode{""}\bigskip\\
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   603
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   604
the concatenation of two strings:
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   605
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   606
\begin{center}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   607
\bl{$s_1 \,@\, s_2$}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   608
\end{center}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   609
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   610
\textit{foo $@$ bar = foobar}, \textit{baz $@\, []$ = baz}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   611
  
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   612
\end{frame}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   613
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   614
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   615
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   616
\mode<presentation>{
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   617
\begin{frame}[c]
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   618
\frametitle{\begin{tabular}{c}The Meaning of a\\[-2mm] 
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   619
  Regular Expression\end{tabular}}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   620
4
Christian Urban <urbanc@in.tum.de>
parents: 3
diff changeset
   621
\begin{textblock}{15}(1,4)
254
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   622
 \begin{tabular}{rcl}
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   623
 \bl{$L(\varnothing)$}  & \bl{$\dn$} & \bl{$\varnothing$}\\
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   624
 \bl{$L(\epsilon)$}     & \bl{$\dn$} & \bl{$\{[]\}$}\\
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   625
 \bl{$L(c)$}            & \bl{$\dn$} & \bl{$\{[c]\}$}\\
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   626
 \bl{$L(r_1 + r_2)$}    & \bl{$\dn$} & \bl{$L(r_1) \cup L(r_2)$}\\
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   627
 \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) \}$}\\
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   628
 \bl{$L(r^*)$}           & \bl{$\dn$} & \onslide<4->{\bl{$\bigcup_{n \ge 0} L(r)^n$}}\\
4
Christian Urban <urbanc@in.tum.de>
parents: 3
diff changeset
   629
  \end{tabular}\bigskip
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   630
  
4
Christian Urban <urbanc@in.tum.de>
parents: 3
diff changeset
   631
\onslide<2->{
254
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   632
\hspace{5mm}\bl{$L(r)^0 \;\dn\; \{[]\}$}\\
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   633
\bl{$L(r)^{n+1} \;\dn\; L(r) \,@\, L(r)^n$}\hspace{9mm}\onslide<3->{\small\textcolor{gray}{(append on sets)}\\
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   634
\small\hspace{5cm}\textcolor{gray}{$\{ s_1 @ s_2 \;|\; s_1\in L(r) \wedge s_2 \in L(r)^n \}$}}
4
Christian Urban <urbanc@in.tum.de>
parents: 3
diff changeset
   635
}  
Christian Urban <urbanc@in.tum.de>
parents: 3
diff changeset
   636
    \end{textblock}
Christian Urban <urbanc@in.tum.de>
parents: 3
diff changeset
   637
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   638
\end{frame}}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   639
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   640
5
Christian Urban <urbanc@in.tum.de>
parents: 4
diff changeset
   641
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 4
diff changeset
   642
\begin{frame}[c]
254
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   643
\frametitle{The Meaning of Matching}
5
Christian Urban <urbanc@in.tum.de>
parents: 4
diff changeset
   644
254
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   645
\begin{bubble}[10cm]
5
Christian Urban <urbanc@in.tum.de>
parents: 4
diff changeset
   646
\large
254
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   647
A regular expression \bl{$r$} matches a string \bl{$s$} 
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   648
provided
5
Christian Urban <urbanc@in.tum.de>
parents: 4
diff changeset
   649
Christian Urban <urbanc@in.tum.de>
parents: 4
diff changeset
   650
\begin{center}
254
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   651
\bl{$s \in L(r)$}\\ 
5
Christian Urban <urbanc@in.tum.de>
parents: 4
diff changeset
   652
\end{center}
254
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   653
\end{bubble}
5
Christian Urban <urbanc@in.tum.de>
parents: 4
diff changeset
   654
254
dcd4688690ce updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
   655
\end{frame}
5
Christian Urban <urbanc@in.tum.de>
parents: 4
diff changeset
   656
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 4
diff changeset
   657
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   658
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   659
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   660
\begin{frame}[c]
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   661
\frametitle{Written Exam}
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   662
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   663
\begin{itemize}
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   664
\item Accounts for 75\%.\bigskip
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   665
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   666
\item You will understand the question ``Is this relevant for
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   667
      the exam?'' is very demotivating for the lecturer!\bigskip\\
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   668
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   669
\item Deal: Whatever is in the homework (and is not marked
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   670
      ``optional'') is relevant for the exam.
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   671
\end{itemize}
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   672
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   673
\end{frame}
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   674
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   675
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   676
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   677
\begin{frame}[t]
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   678
\frametitle{Coursework}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   679
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   680
\begin{itemize}
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   681
\item Accounts for 25\%. Two strands. Choose \alert{\bf one}!\bigskip
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   682
\end{itemize}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   683
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   684
\begin{columns}[t]
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   685
\begin{column}{.5\textwidth}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   686
\underline{\bf Strand 1}\medskip
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   687
\begin{itemize}
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   688
\item four programming subtasks:
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   689
\begin{itemize}
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   690
\item matcher (5\%, 13.10.) 
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   691
\item lexer (5\%, 03.11.)
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   692
\item parser (5\%, 27.11.)
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   693
\item compiler (10\%, 12.12.)
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   694
\end{itemize}
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   695
\end{itemize}
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   696
\end{column}
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   697
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   698
\hspace{-45pt}\vrule{}\hspace{10pt}
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   699
\begin{column}{.5\textwidth}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   700
\underline{\bf Strand 2}\smallskip\begin{itemize}
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   701
\item one task: prove the correctness of a regular expression matcher in 
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   702
the Isabelle theorem prover
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   703
\item 25\%, submission 12.12.
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   704
\end{itemize}
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   705
\end{column}
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   706
\end{columns}\medskip
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   707
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   708
\small
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   709
\begin{itemize}
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   710
\item Solving more than one strand will {\bf not} give you more 
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   711
marks.\\[-2mm]
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   712
\item The exam will contain in much, much smaller form 
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   713
elements from both (but will also be in lectures and HW).
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   714
\end{itemize}
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   715
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
   716
\end{frame}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   717
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   718
255
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   719
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   720
\begin{frame}[c]
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   721
\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
   722
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   723
\mbox{}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   724
\end{frame}
96a99237fa42 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 254
diff changeset
   725
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   726
\end{document}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   727
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   728
%%% Local Variables:  
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   729
%%% mode: latex
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   730
%%% TeX-master: t
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   731
%%% End: 
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   732