slides/slides02.tex
author Christian Urban <christian dot urban at kcl dot ac dot uk>
Fri, 22 Nov 2013 16:56:51 +0000
changeset 198 f54972b0f641
parent 133 09efdf5cf07c
child 215 828303e8e4af
permissions -rw-r--r--
added
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}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
     3
%%\usepackage[T1]{fontenc}
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     4
\usepackage[latin1]{inputenc}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     5
\usepackage{mathpartir}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     6
\usepackage[absolute,overlay]{textpos}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     7
\usepackage{ifthen}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     8
\usepackage{tikz}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     9
\usepackage{pgf}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    10
\usepackage{calc} 
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    11
\usepackage{ulem}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    12
\usepackage{courier}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    13
\usepackage{listings}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    14
\renewcommand{\uline}[1]{#1}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    15
\usetikzlibrary{arrows}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    16
\usetikzlibrary{automata}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    17
\usetikzlibrary{shapes}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    18
\usetikzlibrary{shadows}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    19
\usetikzlibrary{positioning}
117
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    20
\usetikzlibrary{plotmarks}
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    21
\usetikzlibrary{calc}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    22
\usepackage{graphicx} 
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    23
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    24
\definecolor{javared}{rgb}{0.6,0,0} % for strings
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    25
\definecolor{javagreen}{rgb}{0.25,0.5,0.35} % comments
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    26
\definecolor{javapurple}{rgb}{0.5,0,0.35} % keywords
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    27
\definecolor{javadocblue}{rgb}{0.25,0.35,0.75} % javadoc
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    28
117
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    29
\makeatletter
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    30
\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
    31
\@empty\z@\@empty
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    32
\makeatother
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    33
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    34
\lstset{language=Java,
117
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    35
	basicstyle=\consolas,
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    36
	keywordstyle=\color{javapurple}\bfseries,
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    37
	stringstyle=\color{javagreen},
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    38
	commentstyle=\color{javagreen},
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    39
	morecomment=[s][\color{javadocblue}]{/**}{*/},
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    40
	numbers=left,
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    41
	numberstyle=\tiny\color{black},
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    42
	stepnumber=1,
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    43
	numbersep=10pt,
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    44
	tabsize=2,
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    45
	showspaces=false,
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    46
	showstringspaces=false}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    47
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    48
\lstdefinelanguage{scala}{
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    49
  morekeywords={abstract,case,catch,class,def,%
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    50
    do,else,extends,false,final,finally,%
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    51
    for,if,implicit,import,match,mixin,%
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    52
    new,null,object,override,package,%
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    53
    private,protected,requires,return,sealed,%
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    54
    super,this,throw,trait,true,try,%
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    55
    type,val,var,while,with,yield},
117
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    56
  otherkeywords={=>,<-,<\%,<:,>:,\#,@,->},
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    57
  sensitive=true,
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    58
  morecomment=[l]{//},
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    59
  morecomment=[n]{/*}{*/},
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    60
  morestring=[b]",
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    61
  morestring=[b]',
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    62
  morestring=[b]"""
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
\lstset{language=Scala,
117
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    66
	basicstyle=\consolas,
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    67
	keywordstyle=\color{javapurple}\bfseries,
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    68
	stringstyle=\color{javagreen},
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    69
	commentstyle=\color{javagreen},
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    70
	morecomment=[s][\color{javadocblue}]{/**}{*/},
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    71
	numbers=left,
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    72
	numberstyle=\tiny\color{black},
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    73
	stepnumber=1,
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    74
	numbersep=10pt,
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    75
	tabsize=2,
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    76
	showspaces=false,
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    77
	showstringspaces=false}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    78
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    79
% beamer stuff 
117
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    80
\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
    81
\newcommand{\bl}[1]{\textcolor{blue}{#1}}       
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
    82
\newcommand{\dn}{\stackrel{\mbox{\scriptsize def}}{=}}% for definitions
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    83
117
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    84
% The data files, written on the first run.
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    85
\begin{filecontents}{re-python.data}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    86
1 0.029
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    87
5 0.029
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    88
10 0.029
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    89
15 0.032
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    90
16 0.042
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    91
17 0.042
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    92
18 0.055
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    93
19 0.084
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    94
20 0.136
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    95
21 0.248
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    96
22 0.464
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    97
23 0.899
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    98
24 1.773
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    99
25 3.505
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   100
26 6.993
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   101
27 14.503
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   102
28 29.307
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   103
#29 58.886
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   104
\end{filecontents}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   105
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   106
\begin{filecontents}{re-ruby.data}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   107
1 0.00006
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   108
2 0.00003
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   109
3 0.00001
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   110
4 0.00001
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   111
5 0.00001
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   112
6 0.00002
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   113
7 0.00002
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   114
8 0.00004
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   115
9 0.00007
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   116
10 0.00013
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   117
11 0.00026
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   118
12 0.00055
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   119
13 0.00106
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   120
14 0.00196
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   121
15 0.00378
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   122
16 0.00764
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   123
17 0.01606
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   124
18 0.03094
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   125
19 0.06508
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   126
20 0.12420
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   127
21 0.25393
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   128
22 0.51449
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   129
23 1.02174
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   130
24 2.05998
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   131
25 4.22514
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   132
26 8.42479
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   133
27 16.88678
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   134
28 34.79653
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   135
\end{filecontents}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   136
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   137
\begin{filecontents}{re1.data}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   138
1 0.00179
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   139
2 0.00011
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   140
3 0.00014
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   141
4 0.00026
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   142
5 0.00050
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   143
6 0.00095
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   144
7 0.00190
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   145
8 0.00287
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   146
9 0.00779
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   147
10 0.01399
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   148
11 0.01894
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   149
12 0.03666
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   150
13 0.07994
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   151
14 0.08944
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   152
15 0.02377
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   153
16 0.07392
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   154
17 0.22798
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   155
18 0.65310
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   156
19 2.11360
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   157
20 6.31606
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   158
21 21.46013
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   159
\end{filecontents}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   160
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   161
\begin{filecontents}{re2a.data}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   162
1 0.00227
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   163
5 0.00027
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   164
10 0.00075
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   165
15 0.00178
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   166
20 0.00102
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   167
25 0.00028
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   168
30 0.00040
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   169
35 0.00052
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   170
40 0.00075
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   171
45 0.00125
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   172
50 0.00112
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   173
55 0.00099
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   174
60 0.00113
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   175
65 0.00137
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   176
70 0.00170
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   177
\end{filecontents}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   178
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   179
\begin{filecontents}{re2b.data}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   180
1 0.00020
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   181
51 0.00080
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   182
101 0.00678
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   183
151 0.01792
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   184
201 0.04815
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   185
251 0.09648
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   186
301 0.23195
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   187
351 0.52646
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   188
401 0.96277
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   189
451 1.57726
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   190
501 2.00166
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   191
551 2.98341
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   192
601 4.81181
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   193
651 6.57054
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   194
701 9.73973
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   195
751 14.25762
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   196
801 14.80760
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   197
851 19.60958
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   198
901 25.43550
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   199
951 31.96038
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   200
\end{filecontents}
117
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   201
121
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   202
\begin{filecontents}{re3.data}
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   203
1 0.001605
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   204
501 0.131066
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   205
1001 0.057885
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   206
1501 0.136875
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   207
2001 0.176238
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   208
2501 0.254363
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   209
3001 0.37262
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   210
3501 0.500946
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   211
4001 0.638384
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   212
4501 0.816605
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   213
5001 1.00491
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   214
5501 1.232505
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   215
6001 1.525672
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   216
6501 1.757502
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   217
7001 2.092784
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   218
7501 2.429224
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   219
8001 2.803037
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   220
8501 3.463045
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   221
9001 3.609
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   222
9501 4.081504
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   223
10001 4.54569
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   224
10501 6.17789
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   225
11001 6.77242
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   226
11501 7.95864
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   227
\end{filecontents}
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   228
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   229
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   230
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   231
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   232
\begin{document}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   233
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   234
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   235
\mode<presentation>{
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   236
\begin{frame}<1>[t]
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   237
\frametitle{%
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   238
  \begin{tabular}{@ {}c@ {}}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   239
  \\[-3mm]
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   240
  \LARGE Automata and \\[-2mm] 
16
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   241
  \LARGE Formal Languages (2)\\[3mm] 
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   242
  \end{tabular}}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   243
16
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   244
  %\begin{center}
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   245
  %\includegraphics[scale=0.3]{pics/ante1.jpg}\hspace{5mm}
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   246
  %\includegraphics[scale=0.31]{pics/ante2.jpg}\\
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   247
  %\footnotesize\textcolor{gray}{Antikythera automaton, 100 BC (Archimedes?)}
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   248
  %\end{center}
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   249
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   250
\normalsize
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   251
  \begin{center}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   252
  \begin{tabular}{ll}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   253
  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
   254
  Office: & S1.27 (1st floor Strand Building)\\
16
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   255
  Slides: & KEATS 
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   256
  \end{tabular}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   257
  \end{center}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   258
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   259
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   260
\end{frame}}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   261
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   262
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   263
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   264
\mode<presentation>{
16
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   265
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   266
\frametitle{\begin{tabular}{c}Languages\end{tabular}}
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   267
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   268
A \alert{language} is a set of strings.\bigskip
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   269
117
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   270
A \alert{regular expression} specifies a set of strings, or language.
16
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   271
  
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   272
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   273
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   274
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   275
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   276
\mode<presentation>{
15
Christian Urban <urbanc@in.tum.de>
parents: 11
diff changeset
   277
\begin{frame}[t]
117
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   278
\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
   279
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   280
Different ways of writing strings:
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   281
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   282
\begin{center}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   283
\begin{tabular}{ccc}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   284
\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
   285
\bl{\consolas ""}       &       \bl{$[]$}                & \bl{$N$\!$il$}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   286
\end{tabular}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   287
\end{center}\pause
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   288
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   289
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
   290
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   291
\begin{center}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   292
\begin{tabular}{l}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   293
\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
   294
\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
   295
\end{tabular}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   296
\end{center}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   297
  
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   298
\end{frame}}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   299
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   300
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   301
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   302
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   303
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   304
\mode<presentation>{
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   305
\begin{frame}[t]
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   306
\frametitle{\begin{tabular}{c}Regular Expressions\end{tabular}}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   307
15
Christian Urban <urbanc@in.tum.de>
parents: 11
diff changeset
   308
Their inductive definition:
Christian Urban <urbanc@in.tum.de>
parents: 11
diff changeset
   309
Christian Urban <urbanc@in.tum.de>
parents: 11
diff changeset
   310
117
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   311
\begin{textblock}{6}(2,6.5)
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   312
  \begin{tabular}{@ {}rrl@ {\hspace{13mm}}l}
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   313
  \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
   314
         & \bl{$\mid$} & \bl{$\epsilon$}        & empty string / {\consolas""} / $[]$\\
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   315
         & \bl{$\mid$} & \bl{$c$}                         & character\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   316
         & \bl{$\mid$} & \bl{$r_1 \cdot r_2$} & sequence\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   317
         & \bl{$\mid$} & \bl{$r_1 + r_2$}  & alternative / choice\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   318
         & \bl{$\mid$} & \bl{$r^*$}                   & star (zero or more)\\
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   319
  \end{tabular}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   320
  \end{textblock}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   321
  
117
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   322
  
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   323
\only<2->{
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   324
\begin{textblock}{9}(4,0.5)
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   325
\begin{tikzpicture}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   326
\draw (0,0) node[inner sep=2mm,fill=cream, ultra thick, draw=red, rounded corners=2mm] 
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   327
{\normalsize\color{darkgray}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   328
\begin{minipage}{9cm}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   329
\hspace{5mm}\mbox{{\lstset{language=Scala}\fontsize{8}{10}\selectfont
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   330
\texttt{\lstinputlisting{../progs/app51.scala}}}}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   331
\end{minipage}};
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   332
\end{tikzpicture}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   333
\end{textblock}}
16
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   334
  
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   335
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   336
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   337
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   338
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   339
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   340
\mode<presentation>{
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   341
\begin{frame}[c]
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   342
\frametitle{\begin{tabular}{c}The Meaning of a\\[-2mm] Regular Expression\end{tabular}}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   343
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   344
\begin{textblock}{15}(1,4)
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   345
 \begin{tabular}{@ {}rcl}
117
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   346
 \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
   347
 \bl{$L(\epsilon)$}          & \bl{$\dn$} & \bl{$\{$""$\}$}\\
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   348
 \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
   349
 \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
   350
 \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
   351
 \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
   352
  \end{tabular}\bigskip
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   353
  
117
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   354
\only<2->{  
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   355
\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
   356
\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
   357
\end{textblock}
7
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
16
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   360
117
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   361
\only<1->{
16
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   362
\begin{textblock}{6}(9,12)\small
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   363
\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
   364
\bl{$L$ : Rexp $\Rightarrow$ Set$[$String$]$}
16
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   365
\end{textblock}}
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   366
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   367
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   368
\end{frame}}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   369
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   370
16
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   371
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   372
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   373
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   374
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   375
\large
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   376
\begin{center}
117
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   377
What is \bl{$L(a^*)$}?
16
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   378
\end{center}  
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   379
  
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   380
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   381
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   382
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   383
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   384
11
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   385
\newcommand{\YES}{\textcolor{gray}{yes}}
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   386
\newcommand{\NO}{\textcolor{gray}{no}}
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   387
\newcommand{\FORALLR}{\textcolor{gray}{$\forall$ r.}}
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   388
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   389
\mode<presentation>{
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   390
\begin{frame}[c]
11
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   391
\frametitle{\begin{tabular}{c}Reg Exp Equivalences\end{tabular}}
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   392
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   393
\begin{center}
16
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   394
\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
   395
&\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
   396
&\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
   397
&\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
   398
&\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
   399
&\bl{$\epsilon^*$} & \bl{$\equiv^?$} & \bl{$\epsilon$} & \onslide<6->{\YES}\\
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   400
&\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
   401
\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
   402
\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
   403
\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
   404
\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
   405
&\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
   406
&\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
   407
\end{tabular}
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   408
\end{center}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   409
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   410
\end{frame}}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   411
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   412
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   413
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   414
\mode<presentation>{
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   415
\begin{frame}[c]
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   416
\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
   417
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   418
\large
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   419
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
   420
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   421
\begin{center}
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   422
\bl{$s \in L(r)$}\\ 
11
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   423
\end{center}\bigskip\bigskip\pause
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   424
117
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   425
\end{frame}}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   426
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   427
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   428
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   429
\mode<presentation>{
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   430
\begin{frame}[t]
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   431
\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
   432
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   433
\mbox{}\\[-13mm]
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   434
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   435
\begin{tikzpicture}[y=.2cm, x=.3cm]
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   436
 	%axis
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   437
	\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
   438
    	\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
   439
    	%ticks
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   440
    	\foreach \x in {0,5,...,30}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   441
     		\draw (\x,1pt) -- (\x,-3pt)
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   442
			node[anchor=north] {\x};
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   443
    	\foreach \y in {0,5,...,30}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   444
     		\draw (1pt,\y) -- (-3pt,\y) 
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   445
     			node[anchor=east] {\y}; 
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   446
	%labels      
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   447
	\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
   448
	\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
   449
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   450
	%plots
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   451
	\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
   452
		file {re-python.data};
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   453
	\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
   454
		file {re-ruby.data};
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   455
    
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   456
	%legend
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   457
	\begin{scope}[shift={(4,20)}] 
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   458
	\draw[color=blue] (0,0) -- 
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   459
		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
   460
		node[right]{\small Python};
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   461
	\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
   462
		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
   463
		node[right]{\small Ruby};
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   464
	\end{scope}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   465
\end{tikzpicture}
11
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   466
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   467
\end{frame}}
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   468
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   469
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   470
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   471
\mode<presentation>{
118
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
   472
\begin{frame}[c]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
   473
\frametitle{\begin{tabular}{c}Evil Regular Expressions\end{tabular}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
   474
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
   475
\begin{itemize}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
   476
\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
   477
\item Evil regular expressions\medskip
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
   478
\begin{itemize}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
   479
\item \bl{$(a?\{n\}) \cdot a\{n\}$}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
   480
\item \bl{$(a^+)^+$}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
   481
\item \bl{$([a$\,-\,$z]^+)^*$}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
   482
\item \bl{$(a + a \cdot a)^+$}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
   483
\item \bl{$(a + a?)^+$}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
   484
\end{itemize}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
   485
\end{itemize}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
   486
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
   487
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
   488
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
   489
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
   490
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 117
diff changeset
   491
\mode<presentation>{
11
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   492
\begin{frame}[t]
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   493
\frametitle{\begin{tabular}{c}A Matching Algorithm\end{tabular}}
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   494
117
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   495
\small
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   496
\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
   497
\begin{center}
117
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   498
\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
   499
\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
   500
\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
   501
\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
   502
\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
   503
\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
   504
\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
   505
\end{tabular}
16
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   506
\end{center}
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   507
117
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   508
\only<2->{
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   509
\begin{textblock}{9}(3.4,10)
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   510
\begin{tikzpicture}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   511
\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
   512
{\normalsize\color{darkgray}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   513
\begin{minipage}{9cm}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   514
\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
   515
\texttt{\lstinputlisting{../progs/app5.scala}}}}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   516
\end{minipage}};
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   517
\end{tikzpicture}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   518
\end{textblock}}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   519
  
11
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   520
\end{frame}}
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   521
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   522
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   523
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   524
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   525
\mode<presentation>{
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   526
\begin{frame}[c]
15
Christian Urban <urbanc@in.tum.de>
parents: 11
diff changeset
   527
\frametitle{\begin{tabular}{c}The Derivative of a Rexp\end{tabular}}
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   528
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   529
\large
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   530
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
   531
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   532
\small
117
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   533
\bl{$der\,c\,r$} gives the answer
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   534
\end{frame}}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   535
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   536
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   537
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   538
\mode<presentation>{
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   539
\begin{frame}[c]
19
Christian Urban <urbanc@in.tum.de>
parents: 17
diff changeset
   540
\frametitle{\begin{tabular}{c}The Derivative of a Rexp (2)\end{tabular}}
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   541
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   542
\begin{center}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   543
\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
   544
  \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
   545
  \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
   546
  \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
   547
  \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
   548
  \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
   549
  & & \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
   550
  & & \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
   551
  \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
   552
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   553
  \bl{$der\!s\, []\, r$}     & \bl{$\dn$} & \bl{$r$} & \\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   554
  \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
   555
  \end{tabular}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   556
\end{center}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   557
117
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   558
\only<3->{
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   559
\begin{textblock}{10.5}(2,5)
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   560
\begin{tikzpicture}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   561
\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
   562
{\normalsize\color{darkgray}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   563
\begin{minipage}{10.5cm}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   564
\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
   565
\texttt{\lstinputlisting{../progs/app6.scala}}}}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   566
\end{minipage}};
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   567
\end{tikzpicture}
25999de692b2 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   568
\end{textblock}}
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   569
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   570
\end{frame}}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   571
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   572
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   573
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   574
\mode<presentation>{
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   575
\begin{frame}[c]
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   576
\frametitle{\begin{tabular}{c}Examples\end{tabular}}
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   577
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   578
Given \bl{$r \dn ((a \cdot b) + b)^*$} what is
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   579
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   580
\begin{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   581
\begin{tabular}{l}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   582
\bl{$der\,a\,r$}\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   583
\bl{$der\,b\,r$}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   584
\end{tabular}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   585
\end{center}
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   586
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   587
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   588
\end{frame}}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   589
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   590
17
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   591
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   592
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   593
\begin{frame}[t]
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   594
\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
   595
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   596
\mbox{}\\[-13mm]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   597
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   598
\begin{tikzpicture}[y=.2cm, x=.3cm]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   599
 	%axis
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   600
	\draw (0,0) -- coordinate (x axis mid) (30,0);
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   601
    	\draw (0,0) -- coordinate (y axis mid) (0,30);
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   602
    	%ticks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   603
    	\foreach \x in {0,5,...,30}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   604
     		\draw (\x,1pt) -- (\x,-3pt)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   605
			node[anchor=north] {\x};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   606
    	\foreach \y in {0,5,...,30}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   607
     		\draw (1pt,\y) -- (-3pt,\y) 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   608
     			node[anchor=east] {\y}; 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   609
	%labels      
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   610
	\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
   611
	\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
   612
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   613
	%plots
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   614
	\draw[color=blue] plot[mark=*, mark options={fill=white}] 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   615
		file {re-python.data};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   616
	\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
   617
		file {re1.data};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   618
         \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
   619
		file {re-ruby.data};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   620
		
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   621
    
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   622
	%legend
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   623
	\begin{scope}[shift={(4,20)}] 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   624
	\draw[color=blue] (0,0) -- 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   625
		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
   626
		node[right]{\small Python};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   627
	\draw[yshift=-\baselineskip, color=brown] (0,0) -- 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   628
		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
   629
		node[right]{\small Ruby};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   630
        \draw[yshift=\baselineskip, color=red] (0,0) -- 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   631
		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
   632
		node[right]{\small Scala V1};	
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   633
	\end{scope}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   634
\end{tikzpicture}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   635
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   636
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   637
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   638
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   639
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   640
\mode<presentation>{
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}Proofs about Rexps\end{tabular}}
17
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   643
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   644
Remember their inductive definition:\\[5cm]
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   645
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   646
\begin{textblock}{6}(5,5)
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   647
  \begin{tabular}{@ {}rrl}
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   648
  \bl{$r$} & \bl{$::=$}  & \bl{$\varnothing$}\\
17
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   649
         & \bl{$\mid$} & \bl{$\epsilon$}       \\
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   650
         & \bl{$\mid$} & \bl{$c$}                        \\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   651
         & \bl{$\mid$} & \bl{$r_1 \cdot r_2$}\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   652
         & \bl{$\mid$} & \bl{$r_1 + r_2$}  \\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   653
         & \bl{$\mid$} & \bl{$r^*$}                  \\
17
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   654
  \end{tabular}
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   655
  \end{textblock}
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   656
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   657
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
   658
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   659
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   660
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   661
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   662
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   663
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   664
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   665
\frametitle{\begin{tabular}{c}Proofs about Rexp (2)\end{tabular}}
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   666
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   667
\begin{itemize}
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   668
\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
   669
\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
   670
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
   671
\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
   672
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
   673
\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
   674
holds for \bl{$r$}.
17
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   675
\end{itemize}
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   676
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   677
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   678
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   679
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   680
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   681
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   682
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   683
\frametitle{\begin{tabular}{c}Proofs about Rexp (3)\end{tabular}}
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   684
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   685
Assume \bl{$P(r)$} is the property:
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   686
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   687
\begin{center}
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   688
\bl{$nullable(r)$} if and only if \bl{$"" \in L(r)$}
17
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   689
\end{center}
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   690
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   691
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   692
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   693
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   694
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   695
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   696
\begin{frame}[c]
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   697
\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
   698
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   699
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
   700
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   701
\begin{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   702
\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
   703
\end{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   704
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   705
We can prove
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   706
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   707
\begin{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   708
\bl{$L(der\,c\,r) = Der\,c\,(L(r))$}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   709
\end{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   710
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   711
by induction on \bl{$r$}.
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   712
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   713
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   714
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   715
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   716
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   717
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   718
\mode<presentation>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   719
\begin{frame}[c]
17
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   720
\frametitle{\begin{tabular}{c}Proofs about Strings\end{tabular}}
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   721
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   722
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
   723
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   724
\begin{itemize}
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   725
\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
   726
\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
   727
already holds for \bl{$s$}
17
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   728
\end{itemize}
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   729
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   730
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   731
19
Christian Urban <urbanc@in.tum.de>
parents: 17
diff changeset
   732
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 17
diff changeset
   733
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 17
diff changeset
   734
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents: 17
diff changeset
   735
\frametitle{\begin{tabular}{c}Proofs about Strings (2)\end{tabular}}
Christian Urban <urbanc@in.tum.de>
parents: 17
diff changeset
   736
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   737
We can finally prove
19
Christian Urban <urbanc@in.tum.de>
parents: 17
diff changeset
   738
Christian Urban <urbanc@in.tum.de>
parents: 17
diff changeset
   739
\begin{center}
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   740
\bl{$matcher(r, s)$}  if and only if  \bl{$s \in L(r)$} 
19
Christian Urban <urbanc@in.tum.de>
parents: 17
diff changeset
   741
\end{center}
Christian Urban <urbanc@in.tum.de>
parents: 17
diff changeset
   742
Christian Urban <urbanc@in.tum.de>
parents: 17
diff changeset
   743
Christian Urban <urbanc@in.tum.de>
parents: 17
diff changeset
   744
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 17
diff changeset
   745
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
17
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   746
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   747
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 16
diff changeset
   748
\mode<presentation>{
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   749
\begin{frame}[t]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   750
\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
   751
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   752
\mbox{}\\[-13mm]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   753
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   754
\begin{tikzpicture}[y=.2cm, x=.3cm]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   755
 	%axis
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   756
	\draw (0,0) -- coordinate (x axis mid) (30,0);
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   757
    	\draw (0,0) -- coordinate (y axis mid) (0,30);
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   758
    	%ticks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   759
    	\foreach \x in {0,5,...,30}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   760
     		\draw (\x,1pt) -- (\x,-3pt)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   761
			node[anchor=north] {\x};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   762
    	\foreach \y in {0,5,...,30}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   763
     		\draw (1pt,\y) -- (-3pt,\y) 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   764
     			node[anchor=east] {\y}; 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   765
	%labels      
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   766
	\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
   767
	\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
   768
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   769
	%plots
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   770
	\draw[color=blue] plot[mark=*, mark options={fill=white}] 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   771
		file {re-python.data};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   772
	\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
   773
		file {re1.data};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   774
         \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
   775
		file {re-ruby.data};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   776
		
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   777
    
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   778
	%legend
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   779
	\begin{scope}[shift={(4,20)}] 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   780
	\draw[color=blue] (0,0) -- 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   781
		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
   782
		node[right]{\small Python};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   783
	\draw[yshift=-\baselineskip, color=brown] (0,0) -- 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   784
		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
   785
		node[right]{\small Ruby};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   786
        \draw[yshift=\baselineskip, color=red] (0,0) -- 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   787
		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
   788
		node[right]{\small Scala V1};	
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   789
	\end{scope}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   790
\end{tikzpicture}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   791
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   792
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   793
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   794
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   795
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   796
\mode<presentation>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   797
\begin{frame}[c]
120
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   798
\frametitle{\begin{tabular}{c}A Problem\end{tabular}}
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   799
120
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   800
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
   801
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   802
\begin{center}
120
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   803
\begin{tabular}{rl}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   804
1: & \bl{$a$}\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   805
2: & \bl{$a\cdot a$}\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   806
3: & \bl{$a\cdot a\cdot a$}\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   807
& \ldots\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   808
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
   809
& \ldots\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   810
20:
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   811
\end{tabular}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   812
\end{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   813
120
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   814
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
   815
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   816
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   817
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   818
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   819
\mode<presentation>{
120
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   820
\begin{frame}[c]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   821
\frametitle{\begin{tabular}{c}Solving the Problem\end{tabular}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   822
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   823
What happens if we extend our regular expressions
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   824
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   825
\begin{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   826
\begin{tabular}{rcl}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   827
\bl{$r$} & \bl{$::=$} & \bl{\ldots}\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   828
             & \bl{$\mid$} & \bl{$r\{n\}$}\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   829
             & \bl{$\mid$} & \bl{$r?$} 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   830
\end{tabular}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   831
\end{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   832
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   833
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
   834
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   835
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   836
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   837
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   838
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 119
diff changeset
   839
\mode<presentation>{
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   840
\begin{frame}[t]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   841
\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
   842
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   843
\mbox{}\\[-13mm]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   844
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   845
\begin{tikzpicture}[y=.2cm, x=.12cm]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   846
 	%axis
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   847
	\draw (0,0) -- coordinate (x axis mid) (70,0);
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   848
    	\draw (0,0) -- coordinate (y axis mid) (0,30);
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   849
    	%ticks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   850
    	\foreach \x in {0,10,...,70}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   851
     		\draw (\x,1pt) -- (\x,-3pt)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   852
			node[anchor=north] {\x};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   853
    	\foreach \y in {0,5,...,30}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   854
     		\draw (1pt,\y) -- (-3pt,\y) 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   855
     			node[anchor=east] {\y}; 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   856
	%labels      
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   857
	\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
   858
	\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
   859
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   860
	%plots
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   861
	\draw[color=blue] plot[mark=*, mark options={fill=white}] 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   862
		file {re-python.data};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   863
	\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
   864
		file {re1.data};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   865
         \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
   866
		file {re2a.data};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   867
         \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
   868
		file {re-ruby.data};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   869
    
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   870
	%legend
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   871
	\begin{scope}[shift={(4,20)}] 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   872
	\draw[color=blue] (0,0) -- 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   873
		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
   874
		node[right]{\small Python};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   875
	\draw[yshift=-\baselineskip, color=brown] (0,0) -- 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   876
		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
   877
		node[right]{\small Ruby};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   878
	\draw[yshift=\baselineskip, color=red] (0,0) -- 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   879
		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
   880
		node[right]{\small Scala V1};	
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   881
	\draw[yshift=2\baselineskip, color=green] (0,0) -- 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   882
		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
   883
		node[right]{\small Scala V2};	
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   884
	\end{scope}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   885
\end{tikzpicture}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   886
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   887
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   888
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   889
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   890
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   891
\mode<presentation>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   892
\begin{frame}[t]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   893
\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
   894
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   895
\mbox{}\\[-13mm]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   896
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   897
\begin{tabular}{@ {\hspace{-5mm}}l}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   898
\begin{tikzpicture}[y=.2cm, x=.01cm]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   899
 	%axis
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   900
	\draw (0,0) -- coordinate (x axis mid) (1000,0);
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   901
    	\draw (0,0) -- coordinate (y axis mid) (0,30);
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   902
    	%ticks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   903
    	\foreach \x in {0,100,...,1000}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   904
     		\draw (\x,1pt) -- (\x,-3pt)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   905
			node[anchor=north] {\x};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   906
    	\foreach \y in {0,5,...,30}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   907
     		\draw (1pt,\y) -- (-3pt,\y) 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   908
     			node[anchor=east] {\y}; 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   909
	%labels      
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   910
	\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
   911
	\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
   912
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   913
	%plots
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   914
	\draw[color=blue] plot[mark=*, mark options={fill=white}] 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   915
		file {re-python.data};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   916
	\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
   917
		file {re1.data};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   918
         \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
   919
		file {re2b.data};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   920
         \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
   921
		file {re-ruby.data};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   922
    
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   923
	%legend
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   924
	\begin{scope}[shift={(100,20)}] 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   925
	\draw[color=blue] (0,0) -- 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   926
		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
   927
		node[right]{\small Python};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   928
	\draw[yshift=-13, color=brown] (0,0) -- 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   929
		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
   930
		node[right]{\small Ruby};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   931
	\draw[yshift=13, color=red] (0,0) -- 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   932
		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
   933
		node[right]{\small Scala V1};	
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   934
	\draw[yshift=26, color=green] (0,0) -- 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   935
		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
   936
		node[right]{\small Scala V2};	
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   937
	\end{scope}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   938
\end{tikzpicture}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   939
\end{tabular}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   940
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   941
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   942
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
   943
121
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   944
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   945
\mode<presentation>{
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   946
\begin{frame}[c]
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   947
\frametitle{\begin{tabular}{c}Examples\end{tabular}}
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   948
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   949
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
   950
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   951
\begin{center}
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   952
\begin{tabular}{l}
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   953
\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
   954
\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
   955
\end{tabular}
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   956
\end{center}
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   957
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   958
What are these regular expressions equal to?
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   959
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   960
\end{frame}}
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   961
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   962
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   963
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   964
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   965
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   966
\mode<presentation>{
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   967
\begin{frame}[t]
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   968
\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
   969
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   970
\mbox{}\\[-9mm]
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   971
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   972
\begin{tabular}{@ {\hspace{-5mm}}l}
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   973
\begin{tikzpicture}[y=.2cm, x=.0008cm]
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   974
 	%axis
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   975
	\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
   976
    	\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
   977
    	%ticks
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   978
    	\foreach \x in {0,2000,...,12000}
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   979
     		\draw (\x,1pt) -- (\x,-3pt)
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   980
			node[anchor=north] {\x};
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   981
    	\foreach \y in {0,5,...,30}
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   982
     		\draw (1pt,\y) -- (-3pt,\y) 
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   983
     			node[anchor=east] {\y}; 
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   984
	%labels      
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   985
	\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
   986
	\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
   987
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   988
	%plots
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   989
	\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
   990
		file {re1.data};
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   991
         \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
   992
		file {re2b.data};
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   993
	\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
   994
		file {re3.data};	 
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   995
    
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   996
	%legend
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   997
	\begin{scope}[shift={(2000,20)}] 
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   998
	\draw[color=red] (0,0) -- 
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
   999
		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
  1000
		node[right]{\small Scala V1};
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
  1001
	\draw[yshift=13, color=green] (0,0) -- 
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
  1002
		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
  1003
		node[right]{\small Scala V2};	
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
  1004
	\draw[yshift=26, color=black] (0,0) -- 
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
  1005
		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
  1006
		node[right]{\small Scala V3};	
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
  1007
	\end{scope}
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
  1008
\end{tikzpicture}
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
  1009
\end{tabular}
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
  1010
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
  1011
\end{frame}}
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
  1012
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
43c116860e47 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 120
diff changeset
  1013
119
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 118
diff changeset
  1014
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1015
\end{document}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1016
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1017
%%% Local Variables:  
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1018
%%% mode: latex
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1019
%%% TeX-master: t
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1020
%%% End: 
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1021