slides/slides02.tex
author Christian Urban <christian dot urban at kcl dot ac dot uk>
Fri, 26 Sep 2014 14:06:55 +0100
changeset 258 1e4da6d2490c
parent 215 828303e8e4af
child 261 24531cfaa36a
permissions -rw-r--r--
updated programs
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     1
\documentclass[dvipsnames,14pt,t]{beamer}
258
1e4da6d2490c updated programs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
     2
\usepackage{../slides}
1e4da6d2490c updated programs
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: 133
diff changeset
     4
\usepackage{../langs}
828303e8e4af updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 133
diff changeset
     5
\usepackage{../data}
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     6
258
1e4da6d2490c updated programs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
     7
%\usepackage{beamerthemeplaincu}
1e4da6d2490c updated programs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
     8
%\usepackage[absolute,overlay]{textpos}
1e4da6d2490c updated programs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
     9
%\usepackage{ifthen}
1e4da6d2490c updated programs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
    10
%\usepackage{tikz}
1e4da6d2490c updated programs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
    11
%\usepackage{pgf}
1e4da6d2490c updated programs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
    12
%\usepackage{calc} 
1e4da6d2490c updated programs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
    13
%\usepackage{ulem}
1e4da6d2490c updated programs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
    14
%\usepackage{courier}
1e4da6d2490c updated programs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
    15
%\usepackage{listings}
1e4da6d2490c updated programs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
    16
%\renewcommand{\uline}[1]{#1}
1e4da6d2490c updated programs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
    17
%\usetikzlibrary{arrows}
1e4da6d2490c updated programs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
    18
%\usetikzlibrary{automata}
1e4da6d2490c updated programs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
    19
%\usetikzlibrary{shapes}
1e4da6d2490c updated programs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
    20
%\usetikzlibrary{shadows}
1e4da6d2490c updated programs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
    21
%\usetikzlibrary{positioning}
1e4da6d2490c updated programs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
    22
%\usetikzlibrary{plotmarks}
1e4da6d2490c updated programs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
    23
%\usetikzlibrary{calc}
1e4da6d2490c updated programs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
    24
%\usepackage{graphicx} 
1e4da6d2490c updated programs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
    25
%\usepackage{../langs}
1e4da6d2490c updated programs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
    26
%\usepackage{../data}
1e4da6d2490c updated programs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
    27
1e4da6d2490c updated programs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
    28
%\makeatletter
1e4da6d2490c updated programs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
    29
%\lst@CCPutMacro\lst@ProcessOther {"2D}{\lst@ttfamily{-{}}{-{}}}
1e4da6d2490c updated programs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
    30
%\@empty\z@\@empty
1e4da6d2490c updated programs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
    31
%\makeatother
1e4da6d2490c updated programs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
    32
1e4da6d2490c updated programs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
    33
\hfuzz=220pt 
1e4da6d2490c updated programs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
    34
1e4da6d2490c updated programs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
    35
\lstset{language=Scala,
1e4da6d2490c updated programs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
    36
        style=mystyle,
1e4da6d2490c updated programs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
    37
        numbersep=0pt,
1e4da6d2490c updated programs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
    38
        numbers=none,
1e4da6d2490c updated programs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
    39
        xleftmargin=0mm}
1e4da6d2490c updated programs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
    40
1e4da6d2490c updated programs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
    41
\newcommand{\bl}[1]{\textcolor{blue}{#1}}     
117
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    42
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    43
% beamer stuff 
258
1e4da6d2490c updated programs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
    44
\renewcommand{\slidecaption}{AFL 02, King's College London}
1e4da6d2490c updated programs
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
    45
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    46
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    47
\begin{document}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    48
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    49
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    50
\mode<presentation>{
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    51
\begin{frame}<1>[t]
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    52
\frametitle{%
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    53
  \begin{tabular}{@ {}c@ {}}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    54
  \\[-3mm]
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    55
  \LARGE Automata and \\[-2mm] 
16
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
    56
  \LARGE Formal Languages (2)\\[3mm] 
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    57
  \end{tabular}}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    58
16
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
    59
  %\begin{center}
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
    60
  %\includegraphics[scale=0.3]{pics/ante1.jpg}\hspace{5mm}
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
    61
  %\includegraphics[scale=0.31]{pics/ante2.jpg}\\
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
    62
  %\footnotesize\textcolor{gray}{Antikythera automaton, 100 BC (Archimedes?)}
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
    63
  %\end{center}
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    64
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    65
\normalsize
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    66
  \begin{center}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    67
  \begin{tabular}{ll}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    68
  Email:  & christian.urban at kcl.ac.uk\\
117
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    69
  Office: & S1.27 (1st floor Strand Building)\\
16
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
    70
  Slides: & KEATS 
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    71
  \end{tabular}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    72
  \end{center}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    73
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    74
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    75
\end{frame}}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    76
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    77
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    78
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    79
\mode<presentation>{
16
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
    80
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
    81
\frametitle{\begin{tabular}{c}Languages\end{tabular}}
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
    82
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
    83
A \alert{language} is a set of strings.\bigskip
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
    84
117
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    85
A \alert{regular expression} specifies a set of strings, or language.
16
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
    86
  
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
    87
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
    88
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
    89
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
    90
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
    91
\mode<presentation>{
15
Christian Urban <urbanc@in.tum.de>
parents: 11
diff changeset
    92
\begin{frame}[t]
117
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    93
\frametitle{\begin{tabular}{c}Strings\end{tabular}}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    94
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    95
Different ways of writing strings:
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    96
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    97
\begin{center}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    98
\begin{tabular}{ccc}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    99
\bl{\consolas"$hello$"}\quad{} &  \bl{$[h, e, l, l, o]$} & \quad\bl{$h\!::\!e\!::\!l\!::\!l\!::\!o\!::\!N\!il$}\bigskip\\
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   100
\bl{\consolas ""}       &       \bl{$[]$}                & \bl{$N$\!$il$}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   101
\end{tabular}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   102
\end{center}\pause
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   103
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   104
The concatenation operation on strings and sets of strings:
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   105
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   106
\begin{center}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   107
\begin{tabular}{l}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   108
\bl{{\consolas"$f\!oo$"}$\;@\;${\consolas"$bar$"}$\;=\;${\consolas"$f\!oobar$"}}\medskip\\
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   109
\bl{$A \;@\; B \dn \{ s_1 @ s_2 \mid s_1 \in A \wedge s_2 \in B\}$}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   110
\end{tabular}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   111
\end{center}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   112
  
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   113
\end{frame}}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   114
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   115
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   116
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   117
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   118
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   119
\mode<presentation>{
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   120
\begin{frame}[t]
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   121
\frametitle{\begin{tabular}{c}Regular Expressions\end{tabular}}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   122
15
Christian Urban <urbanc@in.tum.de>
parents: 11
diff changeset
   123
Their inductive definition:
Christian Urban <urbanc@in.tum.de>
parents: 11
diff changeset
   124
Christian Urban <urbanc@in.tum.de>
parents: 11
diff changeset
   125
117
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   126
\begin{textblock}{6}(2,6.5)
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   127
  \begin{tabular}{@ {}rrl@ {\hspace{13mm}}l}
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   128
  \bl{$r$} & \bl{$::=$}  & \bl{$\varnothing$}  & null\\
117
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   129
         & \bl{$\mid$} & \bl{$\epsilon$}        & empty string / {\consolas""} / $[]$\\
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   130
         & \bl{$\mid$} & \bl{$c$}                         & character\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   131
         & \bl{$\mid$} & \bl{$r_1 \cdot r_2$} & sequence\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   132
         & \bl{$\mid$} & \bl{$r_1 + r_2$}  & alternative / choice\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   133
         & \bl{$\mid$} & \bl{$r^*$}                   & star (zero or more)\\
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   134
  \end{tabular}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   135
  \end{textblock}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   136
  
117
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   137
  
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   138
\only<2->{
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   139
\begin{textblock}{9}(4,0.5)
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   140
\begin{tikzpicture}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   141
\draw (0,0) node[inner sep=2mm,fill=cream, ultra thick, draw=red, rounded corners=2mm] 
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   142
{\normalsize\color{darkgray}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   143
\begin{minipage}{9cm}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   144
\hspace{5mm}\mbox{{\lstset{language=Scala}\fontsize{8}{10}\selectfont
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   145
\texttt{\lstinputlisting{../progs/app51.scala}}}}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   146
\end{minipage}};
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   147
\end{tikzpicture}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   148
\end{textblock}}
16
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   149
  
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   150
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   151
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   152
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   153
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   154
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   155
\mode<presentation>{
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   156
\begin{frame}[c]
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   157
\frametitle{\begin{tabular}{c}The Meaning of a\\[-2mm] Regular Expression\end{tabular}}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   158
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   159
\begin{textblock}{15}(1,4)
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   160
 \begin{tabular}{@ {}rcl}
117
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   161
 \bl{$L(\varnothing)$}     & \bl{$\dn$} & \bl{$\varnothing$}\\
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   162
 \bl{$L(\epsilon)$}          & \bl{$\dn$} & \bl{$\{$""$\}$}\\
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   163
 \bl{$L(c)$}                     & \bl{$\dn$} & \bl{$\{"c"\}$}\\
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   164
 \bl{$L(r_1 + r_2)$}        & \bl{$\dn$} & \bl{$L(r_1) \cup L(r_2)$}\\
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   165
 \bl{$L(r_1 \cdot r_2)$}  & \bl{$\dn$} & \bl{$L(r_1) \,@\, L(r_2)$}\\
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   166
 \bl{$L(r^*)$}                   & \bl{$\dn$} & \bl{$\bigcup_{n \ge 0} L(r)^n$}\\
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   167
  \end{tabular}\bigskip
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   168
  
117
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   169
\only<2->{  
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   170
\hspace{5mm}\textcolor{blue}{$L(r)^0 \;\dn\; \{""\}$}\\
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   171
\textcolor{blue}{$L(r)^{n+1} \;\dn\; L(r) \,@\, L(r)^n$}}  
11
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   172
\end{textblock}
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   173
117
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   174
16
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   175
117
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   176
\only<1->{
16
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   177
\begin{textblock}{6}(9,12)\small
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   178
\bl{$L$} is a function from regular expressions to sets of strings\\
117
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   179
\bl{$L$ : Rexp $\Rightarrow$ Set$[$String$]$}
16
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   180
\end{textblock}}
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   181
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   182
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   183
\end{frame}}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   184
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   185
16
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   186
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   187
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   188
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   189
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   190
\large
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   191
\begin{center}
117
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   192
What is \bl{$L(a^*)$}?
16
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   193
\end{center}  
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   194
  
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   195
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   196
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   197
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   198
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   199
11
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   200
\newcommand{\YES}{\textcolor{gray}{yes}}
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   201
\newcommand{\NO}{\textcolor{gray}{no}}
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   202
\newcommand{\FORALLR}{\textcolor{gray}{$\forall$ r.}}
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   203
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   204
\mode<presentation>{
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   205
\begin{frame}[c]
11
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   206
\frametitle{\begin{tabular}{c}Reg Exp Equivalences\end{tabular}}
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   207
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   208
\begin{center}
16
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   209
\begin{tabular}{l@ {\hspace{7mm}}rcl@ {\hspace{7mm}}l}
117
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   210
&\bl{$(a + b)  + c$} & \bl{$\equiv^?$} & \bl{$a + (b + c)$} & \onslide<2->{\YES}\\
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   211
&\bl{$a + a$} & \bl{$\equiv^?$} & \bl{$a$} & \onslide<3->{\YES}\\
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   212
&\bl{$(a \cdot b)  \cdot c$} & \bl{$\equiv^?$} & \bl{$a \cdot (b \cdot c)$} & \onslide<4->{\YES}\\
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   213
&\bl{$a \cdot a$} & \bl{$\equiv^?$} & \bl{$a$} & \onslide<5->{\NO}\\
11
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   214
&\bl{$\epsilon^*$} & \bl{$\equiv^?$} & \bl{$\epsilon$} & \onslide<6->{\YES}\\
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   215
&\bl{$\varnothing^*$} & \bl{$\equiv^?$} & \bl{$\varnothing$} & \onslide<7->{\NO}\\
117
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   216
\FORALLR &\bl{$r \cdot \epsilon$} & \bl{$\equiv^?$} & \bl{$r$} & \onslide<8->{\YES}\\
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   217
\FORALLR &\bl{$r + \epsilon$} & \bl{$\equiv^?$} & \bl{$r$} & \onslide<9->{\NO}\\
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   218
\FORALLR &\bl{$r + \varnothing$} & \bl{$\equiv^?$} & \bl{$r$} & \onslide<10->{\YES}\\
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   219
\FORALLR &\bl{$r \cdot \varnothing$} & \bl{$\equiv^?$} & \bl{$r$} & \onslide<11->{\NO}\\
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   220
&\bl{$c \cdot (a + b)$} & \bl{$\equiv^?$} & \bl{$(c \cdot a) + (c \cdot b)$} & \onslide<12->{\YES}\\
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   221
&\bl{$a^*$} & \bl{$\equiv^?$} & \bl{$\epsilon + (a \cdot a^*)$} & \onslide<13->{\YES}
11
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   222
\end{tabular}
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   223
\end{center}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   224
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   225
\end{frame}}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   226
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   227
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   228
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   229
\mode<presentation>{
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   230
\begin{frame}[c]
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   231
\frametitle{\begin{tabular}{c}The Specification\\[-1mm] for Matching\end{tabular}}
11
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   232
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   233
\large
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   234
a regular expression \bl{$r$} matches a string \bl{$s$}\\ if and only if
11
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   235
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   236
\begin{center}
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   237
\bl{$s \in L(r)$}\\ 
11
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   238
\end{center}\bigskip\bigskip\pause
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   239
117
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   240
\end{frame}}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   241
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   242
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   243
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   244
\mode<presentation>{
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   245
\begin{frame}[t]
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   246
\frametitle{\begin{tabular}{c}\bl{$(a?\{n\}) \cdot a\{n\}$}\end{tabular}}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   247
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   248
\mbox{}\\[-13mm]
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   249
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   250
\begin{tikzpicture}[y=.2cm, x=.3cm]
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   251
 	%axis
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   252
	\draw (0,0) -- coordinate (x axis mid) (30,0);
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   253
    	\draw (0,0) -- coordinate (y axis mid) (0,30);
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   254
    	%ticks
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   255
    	\foreach \x in {0,5,...,30}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   256
     		\draw (\x,1pt) -- (\x,-3pt)
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   257
			node[anchor=north] {\x};
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   258
    	\foreach \y in {0,5,...,30}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   259
     		\draw (1pt,\y) -- (-3pt,\y) 
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   260
     			node[anchor=east] {\y}; 
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   261
	%labels      
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   262
	\node[below=0.6cm] at (x axis mid) {\bl{a}s};
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   263
	\node[rotate=90, left=1.2cm] at (y axis mid) {secs};
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   264
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   265
	%plots
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   266
	\draw[color=blue] plot[mark=*, mark options={fill=white}] 
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   267
		file {re-python.data};
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   268
	\draw[color=brown] plot[mark=pentagon*, mark options={fill=white} ] 
117
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   269
		file {re-ruby.data};
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   270
    
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   271
	%legend
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   272
	\begin{scope}[shift={(4,20)}] 
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   273
	\draw[color=blue] (0,0) -- 
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   274
		plot[mark=*, mark options={fill=white}] (0.25,0) -- (0.5,0) 
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   275
		node[right]{\small Python};
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   276
	\draw[yshift=-\baselineskip, color=brown] (0,0) -- 
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   277
		plot[mark=pentagon*, mark options={fill=white}] (0.25,0) -- (0.5,0)
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   278
		node[right]{\small Ruby};
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   279
	\end{scope}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   280
\end{tikzpicture}
11
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   281
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   282
\end{frame}}
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   283
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   284
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   285
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   286
\mode<presentation>{
118
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
   287
\begin{frame}[c]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
   288
\frametitle{\begin{tabular}{c}Evil Regular Expressions\end{tabular}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
   289
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
   290
\begin{itemize}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
   291
\item \alert{R}egular \alert{e}xpression \alert{D}enial \alert{o}f \alert{S}ervice (ReDoS)\bigskip
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
   292
\item Evil regular expressions\medskip
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
   293
\begin{itemize}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
   294
\item \bl{$(a?\{n\}) \cdot a\{n\}$}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
   295
\item \bl{$(a^+)^+$}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
   296
\item \bl{$([a$\,-\,$z]^+)^*$}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
   297
\item \bl{$(a + a \cdot a)^+$}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
   298
\item \bl{$(a + a?)^+$}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
   299
\end{itemize}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
   300
\end{itemize}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
   301
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
   302
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
   303
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
   304
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
   305
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
   306
\mode<presentation>{
11
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   307
\begin{frame}[t]
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   308
\frametitle{\begin{tabular}{c}A Matching Algorithm\end{tabular}}
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   309
117
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   310
\small
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   311
\ldots{}whether a regular expression can match the empty string:
11
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   312
\begin{center}
117
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   313
\begin{tabular}{@ {}l@ {\hspace{2mm}}c@ {\hspace{2mm}}l@ {}}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   314
\bl{$nullable(\varnothing)$}      & \bl{$\dn$} & \bl{$f\!\/alse$}\\
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   315
\bl{$nullable(\epsilon)$}           & \bl{$\dn$} &  \bl{$true$}\\
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   316
\bl{$nullable (c)$}                    & \bl{$\dn$} &  \bl{$f\!alse$}\\
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   317
\bl{$nullable (r_1 + r_2)$}       & \bl{$\dn$} &  \bl{$nullable(r_1) \vee nullable(r_2)$} \\ 
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   318
\bl{$nullable (r_1 \cdot r_2)$} & \bl{$\dn$} &  \bl{$nullable(r_1) \wedge nullable(r_2)$} \\
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   319
\bl{$nullable (r^*)$}                 & \bl{$\dn$} & \bl{$true$} \\
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   320
\end{tabular}
16
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   321
\end{center}
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   322
117
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   323
\only<2->{
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   324
\begin{textblock}{9}(3.4,10)
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   325
\begin{tikzpicture}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   326
\draw (0,0) node[inner sep=2mm,fill=cream, ultra thick, draw=red, rounded corners=2mm] 
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   327
{\normalsize\color{darkgray}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   328
\begin{minipage}{9cm}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   329
\hspace{5mm}\mbox{{\lstset{language=Scala}\fontsize{8}{10}\selectfont
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   330
\texttt{\lstinputlisting{../progs/app5.scala}}}}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   331
\end{minipage}};
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   332
\end{tikzpicture}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   333
\end{textblock}}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   334
  
11
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   335
\end{frame}}
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   336
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   337
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   338
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   339
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   340
\mode<presentation>{
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   341
\begin{frame}[c]
15
Christian Urban <urbanc@in.tum.de>
parents: 11
diff changeset
   342
\frametitle{\begin{tabular}{c}The Derivative of a Rexp\end{tabular}}
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   343
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   344
\large
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   345
If \bl{$r$} matches the string \bl{$c\!::\!s$}, what is a regular expression that matches \bl{$s$}?\bigskip\bigskip\bigskip\bigskip
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   346
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   347
\small
117
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   348
\bl{$der\,c\,r$} gives the answer
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   349
\end{frame}}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   350
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   351
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   352
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   353
\mode<presentation>{
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   354
\begin{frame}[c]
19
Christian Urban <urbanc@in.tum.de>
parents: 17
diff changeset
   355
\frametitle{\begin{tabular}{c}The Derivative of a Rexp (2)\end{tabular}}
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   356
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   357
\begin{center}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   358
\begin{tabular}{@ {}l@ {\hspace{2mm}}c@ {\hspace{2mm}}l@ {\hspace{-10mm}}l@ {}}
117
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   359
  \bl{$der\, c\, (\varnothing)$}      & \bl{$\dn$} & \bl{$\varnothing$} & \\
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   360
  \bl{$der\, c\, (\epsilon)$}           & \bl{$\dn$} & \bl{$\varnothing$} & \\
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   361
  \bl{$der\, c\, (d)$}                     & \bl{$\dn$} & \bl{if $c = d$ then $\epsilon$ else $\varnothing$} & \\
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   362
  \bl{$der\, c\, (r_1 + r_2)$}        & \bl{$\dn$} & \bl{$der\, c\, r_1 + der\, c\, r_2$} & \\
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   363
  \bl{$der\, c\, (r_1 \cdot r_2)$}  & \bl{$\dn$}  & \bl{if $nullable (r_1)$}\\
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   364
  & & \bl{then $(der\,c\,r_1) \cdot r_2 + der\, c\, r_2$}\\ 
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   365
  & & \bl{else $(der\, c\, r_1) \cdot r_2$}\\
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   366
  \bl{$der\, c\, (r^*)$}          & \bl{$\dn$} & \bl{$(der\,c\,r) \cdot (r^*)$} &\smallskip\\\pause
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   367
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   368
  \bl{$der\!s\, []\, r$}     & \bl{$\dn$} & \bl{$r$} & \\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   369
  \bl{$der\!s\, (c\!::\!s)\, r$} & \bl{$\dn$} & \bl{$der\!s\,s\,(der\,c\,r)$} & \\
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   370
  \end{tabular}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   371
\end{center}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   372
117
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   373
\only<3->{
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   374
\begin{textblock}{10.5}(2,5)
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   375
\begin{tikzpicture}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   376
\draw (0,0) node[inner sep=2mm,fill=cream, ultra thick, draw=red, rounded corners=2mm] 
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   377
{\normalsize\color{darkgray}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   378
\begin{minipage}{10.5cm}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   379
\hspace{5mm}\mbox{{\lstset{language=Scala}\fontsize{8}{10}\selectfont
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   380
\texttt{\lstinputlisting{../progs/app6.scala}}}}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   381
\end{minipage}};
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   382
\end{tikzpicture}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   383
\end{textblock}}
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   384
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   385
\end{frame}}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   386
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   387
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   388
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   389
\mode<presentation>{
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   390
\begin{frame}[c]
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   391
\frametitle{\begin{tabular}{c}Examples\end{tabular}}
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   392
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   393
Given \bl{$r \dn ((a \cdot b) + b)^*$} what is
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   394
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   395
\begin{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   396
\begin{tabular}{l}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   397
\bl{$der\,a\,r$}\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   398
\bl{$der\,b\,r$}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   399
\end{tabular}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   400
\end{center}
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   401
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   402
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   403
\end{frame}}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   404
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   405
17
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   406
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   407
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   408
\begin{frame}[t]
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   409
\frametitle{\begin{tabular}{c}\bl{$(a?\{n\}) \cdot a\{n\}$}\end{tabular}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   410
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   411
\mbox{}\\[-13mm]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   412
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   413
\begin{tikzpicture}[y=.2cm, x=.3cm]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   414
 	%axis
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   415
	\draw (0,0) -- coordinate (x axis mid) (30,0);
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   416
    	\draw (0,0) -- coordinate (y axis mid) (0,30);
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   417
    	%ticks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   418
    	\foreach \x in {0,5,...,30}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   419
     		\draw (\x,1pt) -- (\x,-3pt)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   420
			node[anchor=north] {\x};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   421
    	\foreach \y in {0,5,...,30}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   422
     		\draw (1pt,\y) -- (-3pt,\y) 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   423
     			node[anchor=east] {\y}; 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   424
	%labels      
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   425
	\node[below=0.6cm] at (x axis mid) {\bl{a}s};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   426
	\node[rotate=90, left=1.2cm] at (y axis mid) {secs};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   427
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   428
	%plots
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   429
	\draw[color=blue] plot[mark=*, mark options={fill=white}] 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   430
		file {re-python.data};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   431
	\draw[color=red] plot[mark=triangle*, mark options={fill=white} ] 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   432
		file {re1.data};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   433
         \draw[color=brown] plot[mark=pentagon*, mark options={fill=white} ] 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   434
		file {re-ruby.data};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   435
		
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   436
    
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   437
	%legend
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   438
	\begin{scope}[shift={(4,20)}] 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   439
	\draw[color=blue] (0,0) -- 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   440
		plot[mark=*, mark options={fill=white}] (0.25,0) -- (0.5,0) 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   441
		node[right]{\small Python};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   442
	\draw[yshift=-\baselineskip, color=brown] (0,0) -- 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   443
		plot[mark=pentagon*, mark options={fill=white}] (0.25,0) -- (0.5,0)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   444
		node[right]{\small Ruby};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   445
        \draw[yshift=\baselineskip, color=red] (0,0) -- 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   446
		plot[mark=triangle*, mark options={fill=white}] (0.25,0) -- (0.5,0)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   447
		node[right]{\small Scala V1};	
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   448
	\end{scope}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   449
\end{tikzpicture}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   450
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   451
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   452
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   453
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   454
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   455
\mode<presentation>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   456
\begin{frame}[t]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   457
\frametitle{\begin{tabular}{c}Proofs about Rexps\end{tabular}}
17
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   458
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   459
Remember their inductive definition:\\[5cm]
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   460
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   461
\begin{textblock}{6}(5,5)
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   462
  \begin{tabular}{@ {}rrl}
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   463
  \bl{$r$} & \bl{$::=$}  & \bl{$\varnothing$}\\
17
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   464
         & \bl{$\mid$} & \bl{$\epsilon$}       \\
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   465
         & \bl{$\mid$} & \bl{$c$}                        \\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   466
         & \bl{$\mid$} & \bl{$r_1 \cdot r_2$}\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   467
         & \bl{$\mid$} & \bl{$r_1 + r_2$}  \\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   468
         & \bl{$\mid$} & \bl{$r^*$}                  \\
17
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   469
  \end{tabular}
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   470
  \end{textblock}
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   471
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   472
If we want to prove something, say a property \bl{$P(r)$}, for all regular expressions \bl{$r$} then \ldots
17
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   473
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   474
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   475
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   476
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   477
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   478
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   479
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   480
\frametitle{\begin{tabular}{c}Proofs about Rexp (2)\end{tabular}}
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   481
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   482
\begin{itemize}
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   483
\item \bl{$P$} holds for \bl{$\varnothing$}, \bl{$\epsilon$} and \bl{c}\bigskip
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   484
\item \bl{$P$} holds for \bl{$r_1 + r_2$} under the assumption that \bl{$P$} already
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   485
holds for \bl{$r_1$} and \bl{$r_2$}.\bigskip
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   486
\item \bl{$P$} holds for \bl{$r_1 \cdot r_2$} under the assumption that \bl{$P$} already
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   487
holds for \bl{$r_1$} and \bl{$r_2$}.\bigskip
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   488
\item \bl{$P$} holds for \bl{$r^*$} under the assumption that \bl{$P$} already
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   489
holds for \bl{$r$}.
17
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   490
\end{itemize}
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   491
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   492
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   493
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   494
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   495
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   496
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   497
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   498
\frametitle{\begin{tabular}{c}Proofs about Rexp (3)\end{tabular}}
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   499
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   500
Assume \bl{$P(r)$} is the property:
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   501
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   502
\begin{center}
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   503
\bl{$nullable(r)$} if and only if \bl{$"" \in L(r)$}
17
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   504
\end{center}
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   505
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   506
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   507
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   508
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   509
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   510
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   511
\begin{frame}[c]
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   512
\frametitle{\begin{tabular}{c}Proofs about Rexp (4)\end{tabular}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   513
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   514
Let \bl{$Der\,c\,A$} be the set defined as
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   515
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   516
\begin{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   517
\bl{$Der\,c\,A \dn \{ s \;|\;  c\!::\!s \in A\}$ } 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   518
\end{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   519
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   520
We can prove
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   521
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   522
\begin{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   523
\bl{$L(der\,c\,r) = Der\,c\,(L(r))$}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   524
\end{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   525
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   526
by induction on \bl{$r$}.
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   527
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   528
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   529
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   530
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   531
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   532
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   533
\mode<presentation>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   534
\begin{frame}[c]
17
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   535
\frametitle{\begin{tabular}{c}Proofs about Strings\end{tabular}}
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   536
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   537
If we want to prove something, say a property \bl{$P(s)$}, for all strings \bl{$s$} then \ldots\bigskip
17
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   538
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   539
\begin{itemize}
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   540
\item \bl{$P$} holds for the empty string, and\medskip
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   541
\item \bl{$P$} holds for the string \bl{$c\!::\!s$} under the assumption that \bl{$P$}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   542
already holds for \bl{$s$}
17
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   543
\end{itemize}
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   544
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   545
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   546
19
Christian Urban <urbanc@in.tum.de>
parents: 17
diff changeset
   547
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 17
diff changeset
   548
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 17
diff changeset
   549
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents: 17
diff changeset
   550
\frametitle{\begin{tabular}{c}Proofs about Strings (2)\end{tabular}}
Christian Urban <urbanc@in.tum.de>
parents: 17
diff changeset
   551
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   552
We can finally prove
19
Christian Urban <urbanc@in.tum.de>
parents: 17
diff changeset
   553
Christian Urban <urbanc@in.tum.de>
parents: 17
diff changeset
   554
\begin{center}
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   555
\bl{$matcher(r, s)$}  if and only if  \bl{$s \in L(r)$} 
19
Christian Urban <urbanc@in.tum.de>
parents: 17
diff changeset
   556
\end{center}
Christian Urban <urbanc@in.tum.de>
parents: 17
diff changeset
   557
Christian Urban <urbanc@in.tum.de>
parents: 17
diff changeset
   558
Christian Urban <urbanc@in.tum.de>
parents: 17
diff changeset
   559
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 17
diff changeset
   560
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
17
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   561
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   562
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   563
\mode<presentation>{
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   564
\begin{frame}[t]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   565
\frametitle{\begin{tabular}{c}\bl{$(a?\{n\}) \cdot a\{n\}$}\end{tabular}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   566
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   567
\mbox{}\\[-13mm]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   568
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   569
\begin{tikzpicture}[y=.2cm, x=.3cm]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   570
 	%axis
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   571
	\draw (0,0) -- coordinate (x axis mid) (30,0);
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   572
    	\draw (0,0) -- coordinate (y axis mid) (0,30);
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   573
    	%ticks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   574
    	\foreach \x in {0,5,...,30}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   575
     		\draw (\x,1pt) -- (\x,-3pt)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   576
			node[anchor=north] {\x};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   577
    	\foreach \y in {0,5,...,30}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   578
     		\draw (1pt,\y) -- (-3pt,\y) 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   579
     			node[anchor=east] {\y}; 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   580
	%labels      
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   581
	\node[below=0.6cm] at (x axis mid) {\bl{a}s};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   582
	\node[rotate=90, left=1.2cm] at (y axis mid) {secs};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   583
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   584
	%plots
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   585
	\draw[color=blue] plot[mark=*, mark options={fill=white}] 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   586
		file {re-python.data};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   587
	\draw[color=red] plot[mark=triangle*, mark options={fill=white} ] 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   588
		file {re1.data};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   589
         \draw[color=brown] plot[mark=pentagon*, mark options={fill=white} ] 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   590
		file {re-ruby.data};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   591
		
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   592
    
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   593
	%legend
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   594
	\begin{scope}[shift={(4,20)}] 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   595
	\draw[color=blue] (0,0) -- 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   596
		plot[mark=*, mark options={fill=white}] (0.25,0) -- (0.5,0) 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   597
		node[right]{\small Python};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   598
	\draw[yshift=-\baselineskip, color=brown] (0,0) -- 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   599
		plot[mark=pentagon*, mark options={fill=white}] (0.25,0) -- (0.5,0)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   600
		node[right]{\small Ruby};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   601
        \draw[yshift=\baselineskip, color=red] (0,0) -- 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   602
		plot[mark=triangle*, mark options={fill=white}] (0.25,0) -- (0.5,0)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   603
		node[right]{\small Scala V1};	
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   604
	\end{scope}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   605
\end{tikzpicture}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   606
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   607
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   608
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   609
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   610
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   611
\mode<presentation>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   612
\begin{frame}[c]
120
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   613
\frametitle{\begin{tabular}{c}A Problem\end{tabular}}
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   614
120
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   615
We represented the ``n-times'' \bl{$a\{n\}$} as a sequence regular expression:
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   616
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   617
\begin{center}
120
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   618
\begin{tabular}{rl}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   619
1: & \bl{$a$}\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   620
2: & \bl{$a\cdot a$}\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   621
3: & \bl{$a\cdot a\cdot a$}\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   622
& \ldots\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   623
13: & \bl{$a\cdot a\cdot a\cdot a\cdot a\cdot a\cdot a\cdot a\cdot a\cdot a\cdot a\cdot a\cdot a$}\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   624
& \ldots\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   625
20:
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   626
\end{tabular}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   627
\end{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   628
120
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   629
This problem is aggravated with \bl{$a?$} being represented as \bl{$\epsilon + a$}.
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   630
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   631
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   632
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   633
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   634
\mode<presentation>{
120
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   635
\begin{frame}[c]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   636
\frametitle{\begin{tabular}{c}Solving the Problem\end{tabular}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   637
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   638
What happens if we extend our regular expressions
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   639
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   640
\begin{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   641
\begin{tabular}{rcl}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   642
\bl{$r$} & \bl{$::=$} & \bl{\ldots}\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   643
             & \bl{$\mid$} & \bl{$r\{n\}$}\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   644
             & \bl{$\mid$} & \bl{$r?$} 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   645
\end{tabular}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   646
\end{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   647
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   648
What is their meaning? What are the cases for \bl{$nullable$} and \bl{$der$}?
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   649
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   650
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   651
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   652
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   653
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   654
\mode<presentation>{
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   655
\begin{frame}[t]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   656
\frametitle{\begin{tabular}{c}\bl{$(a?\{n\}) \cdot a\{n\}$}\end{tabular}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   657
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   658
\mbox{}\\[-13mm]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   659
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   660
\begin{tikzpicture}[y=.2cm, x=.12cm]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   661
 	%axis
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   662
	\draw (0,0) -- coordinate (x axis mid) (70,0);
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   663
    	\draw (0,0) -- coordinate (y axis mid) (0,30);
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   664
    	%ticks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   665
    	\foreach \x in {0,10,...,70}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   666
     		\draw (\x,1pt) -- (\x,-3pt)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   667
			node[anchor=north] {\x};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   668
    	\foreach \y in {0,5,...,30}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   669
     		\draw (1pt,\y) -- (-3pt,\y) 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   670
     			node[anchor=east] {\y}; 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   671
	%labels      
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   672
	\node[below=0.6cm] at (x axis mid) {\bl{a}s};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   673
	\node[rotate=90, left=1.2cm] at (y axis mid) {secs};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   674
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   675
	%plots
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   676
	\draw[color=blue] plot[mark=*, mark options={fill=white}] 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   677
		file {re-python.data};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   678
	\draw[color=red] plot[mark=triangle*, mark options={fill=white} ] 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   679
		file {re1.data};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   680
         \draw[color=green] plot[mark=square*, mark options={fill=white} ] 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   681
		file {re2a.data};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   682
         \draw[color=brown] plot[mark=pentagon*, mark options={fill=white} ] 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   683
		file {re-ruby.data};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   684
    
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   685
	%legend
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   686
	\begin{scope}[shift={(4,20)}] 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   687
	\draw[color=blue] (0,0) -- 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   688
		plot[mark=*, mark options={fill=white}] (0.25,0) -- (0.5,0) 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   689
		node[right]{\small Python};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   690
	\draw[yshift=-\baselineskip, color=brown] (0,0) -- 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   691
		plot[mark=pentagon*, mark options={fill=white}] (0.25,0) -- (0.5,0)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   692
		node[right]{\small Ruby};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   693
	\draw[yshift=\baselineskip, color=red] (0,0) -- 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   694
		plot[mark=triangle*, mark options={fill=white}] (0.25,0) -- (0.5,0)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   695
		node[right]{\small Scala V1};	
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   696
	\draw[yshift=2\baselineskip, color=green] (0,0) -- 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   697
		plot[mark=square*, mark options={fill=white}] (0.25,0) -- (0.5,0)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   698
		node[right]{\small Scala V2};	
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   699
	\end{scope}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   700
\end{tikzpicture}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   701
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   702
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   703
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   704
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   705
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   706
\mode<presentation>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   707
\begin{frame}[t]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   708
\frametitle{\begin{tabular}{c}\bl{$(a?\{n\}) \cdot a\{n\}$}\end{tabular}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   709
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   710
\mbox{}\\[-13mm]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   711
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   712
\begin{tabular}{@ {\hspace{-5mm}}l}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   713
\begin{tikzpicture}[y=.2cm, x=.01cm]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   714
 	%axis
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   715
	\draw (0,0) -- coordinate (x axis mid) (1000,0);
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   716
    	\draw (0,0) -- coordinate (y axis mid) (0,30);
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   717
    	%ticks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   718
    	\foreach \x in {0,100,...,1000}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   719
     		\draw (\x,1pt) -- (\x,-3pt)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   720
			node[anchor=north] {\x};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   721
    	\foreach \y in {0,5,...,30}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   722
     		\draw (1pt,\y) -- (-3pt,\y) 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   723
     			node[anchor=east] {\y}; 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   724
	%labels      
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   725
	\node[below=0.6cm] at (x axis mid) {\bl{a}s};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   726
	\node[rotate=90, left=1.2cm] at (y axis mid) {secs};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   727
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   728
	%plots
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   729
	\draw[color=blue] plot[mark=*, mark options={fill=white}] 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   730
		file {re-python.data};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   731
	\draw[color=red] plot[mark=triangle*, mark options={fill=white} ] 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   732
		file {re1.data};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   733
         \draw[color=green] plot[mark=square*, mark options={fill=white} ] 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   734
		file {re2b.data};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   735
         \draw[color=brown] plot[mark=pentagon*, mark options={fill=white} ] 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   736
		file {re-ruby.data};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   737
    
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   738
	%legend
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   739
	\begin{scope}[shift={(100,20)}] 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   740
	\draw[color=blue] (0,0) -- 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   741
		plot[mark=*, mark options={fill=white}] (0.25,0) -- (50,0) 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   742
		node[right]{\small Python};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   743
	\draw[yshift=-13, color=brown] (0,0) -- 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   744
		plot[mark=pentagon*, mark options={fill=white}] (0.25,0) -- (50,0)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   745
		node[right]{\small Ruby};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   746
	\draw[yshift=13, color=red] (0,0) -- 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   747
		plot[mark=triangle*, mark options={fill=white}] (0.25,0) -- (50,0)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   748
		node[right]{\small Scala V1};	
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   749
	\draw[yshift=26, color=green] (0,0) -- 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   750
		plot[mark=square*, mark options={fill=white}] (0.25,0) -- (50,0)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   751
		node[right]{\small Scala V2};	
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   752
	\end{scope}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   753
\end{tikzpicture}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   754
\end{tabular}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   755
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   756
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   757
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   758
121
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   759
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   760
\mode<presentation>{
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   761
\begin{frame}[c]
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   762
\frametitle{\begin{tabular}{c}Examples\end{tabular}}
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   763
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   764
Recall the example of \bl{$r \dn ((a \cdot b) + b)^*$} with
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   765
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   766
\begin{center}
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   767
\begin{tabular}{l}
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   768
\bl{$der\,a\,r = ((\epsilon \cdot b) + \varnothing) \cdot r$}\\
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   769
\bl{$der\,b\,r = ((\varnothing \cdot b) + \epsilon)\cdot r$}
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   770
\end{tabular}
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   771
\end{center}
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   772
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   773
What are these regular expressions equal to?
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   774
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   775
\end{frame}}
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   776
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   777
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   778
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   779
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   780
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   781
\mode<presentation>{
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   782
\begin{frame}[t]
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   783
\frametitle{\begin{tabular}{c}\bl{$(a?\{n\}) \cdot a\{n\}$}\end{tabular}}
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   784
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   785
\mbox{}\\[-9mm]
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   786
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   787
\begin{tabular}{@ {\hspace{-5mm}}l}
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   788
\begin{tikzpicture}[y=.2cm, x=.0008cm]
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   789
 	%axis
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   790
	\draw (0,0) -- coordinate (x axis mid) (12000,0);
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   791
    	\draw (0,0) -- coordinate (y axis mid) (0,30);
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   792
    	%ticks
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   793
    	\foreach \x in {0,2000,...,12000}
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   794
     		\draw (\x,1pt) -- (\x,-3pt)
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   795
			node[anchor=north] {\x};
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   796
    	\foreach \y in {0,5,...,30}
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   797
     		\draw (1pt,\y) -- (-3pt,\y) 
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   798
     			node[anchor=east] {\y}; 
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   799
	%labels      
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   800
	\node[below=0.6cm] at (x axis mid) {\bl{a}s};
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   801
	\node[rotate=90, left=1.2cm] at (y axis mid) {secs};
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   802
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   803
	%plots
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   804
	\draw[color=red] plot[mark=triangle*, mark options={fill=white} ] 
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   805
		file {re1.data};
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   806
         \draw[color=green] plot[mark=square*, mark options={fill=white} ] 
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   807
		file {re2b.data};
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   808
	\draw[color=black] plot[mark=square*, mark options={fill=white} ] 
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   809
		file {re3.data};	 
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   810
    
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   811
	%legend
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   812
	\begin{scope}[shift={(2000,20)}] 
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   813
	\draw[color=red] (0,0) -- 
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   814
		plot[mark=triangle*, mark options={fill=white}] (0.25,0) -- (50,0) 
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   815
		node[right]{\small Scala V1};
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   816
	\draw[yshift=13, color=green] (0,0) -- 
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   817
		plot[mark=square*, mark options={fill=white}] (0.25,0) -- (50,0)
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   818
		node[right]{\small Scala V2};	
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   819
	\draw[yshift=26, color=black] (0,0) -- 
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   820
		plot[mark=square*, mark options={fill=white}] (0.25,0) -- (50,0)
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   821
		node[right]{\small Scala V3};	
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   822
	\end{scope}
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   823
\end{tikzpicture}
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   824
\end{tabular}
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   825
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   826
\end{frame}}
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   827
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   828
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   829
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   830
\end{document}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   831
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   832
%%% Local Variables:  
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   833
%%% mode: latex
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   834
%%% TeX-master: t
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   835
%%% End: 
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   836