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