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