author | Christian Urban <christian dot urban at kcl dot ac dot uk> |
Tue, 01 Oct 2013 23:59:36 +0100 | |
changeset 119 | a6684e8961d0 |
parent 118 | 6a5b59690f7d |
child 120 | 3e71efb25ce9 |
permissions | -rw-r--r-- |
7 | 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 | 4 |
\usepackage[latin1]{inputenc} |
5 |
\usepackage{mathpartir} |
|
6 |
\usepackage[absolute,overlay]{textpos} |
|
7 |
\usepackage{ifthen} |
|
8 |
\usepackage{tikz} |
|
9 |
\usepackage{pgf} |
|
10 |
\usepackage{calc} |
|
11 |
\usepackage{ulem} |
|
12 |
\usepackage{courier} |
|
13 |
\usepackage{listings} |
|
14 |
\renewcommand{\uline}[1]{#1} |
|
15 |
\usetikzlibrary{arrows} |
|
16 |
\usetikzlibrary{automata} |
|
17 |
\usetikzlibrary{shapes} |
|
18 |
\usetikzlibrary{shadows} |
|
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 | 21 |
\usetikzlibrary{calc} |
22 |
\usepackage{graphicx} |
|
23 |
||
24 |
\definecolor{javared}{rgb}{0.6,0,0} % for strings |
|
25 |
\definecolor{javagreen}{rgb}{0.25,0.5,0.35} % comments |
|
26 |
\definecolor{javapurple}{rgb}{0.5,0,0.35} % keywords |
|
27 |
\definecolor{javadocblue}{rgb}{0.25,0.35,0.75} % javadoc |
|
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 | 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 | 36 |
keywordstyle=\color{javapurple}\bfseries, |
37 |
stringstyle=\color{javagreen}, |
|
38 |
commentstyle=\color{javagreen}, |
|
39 |
morecomment=[s][\color{javadocblue}]{/**}{*/}, |
|
40 |
numbers=left, |
|
41 |
numberstyle=\tiny\color{black}, |
|
42 |
stepnumber=1, |
|
43 |
numbersep=10pt, |
|
44 |
tabsize=2, |
|
45 |
showspaces=false, |
|
46 |
showstringspaces=false} |
|
47 |
||
48 |
\lstdefinelanguage{scala}{ |
|
49 |
morekeywords={abstract,case,catch,class,def,% |
|
50 |
do,else,extends,false,final,finally,% |
|
51 |
for,if,implicit,import,match,mixin,% |
|
52 |
new,null,object,override,package,% |
|
53 |
private,protected,requires,return,sealed,% |
|
54 |
super,this,throw,trait,true,try,% |
|
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 | 57 |
sensitive=true, |
58 |
morecomment=[l]{//}, |
|
59 |
morecomment=[n]{/*}{*/}, |
|
60 |
morestring=[b]", |
|
61 |
morestring=[b]', |
|
62 |
morestring=[b]""" |
|
63 |
} |
|
64 |
||
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 | 67 |
keywordstyle=\color{javapurple}\bfseries, |
68 |
stringstyle=\color{javagreen}, |
|
69 |
commentstyle=\color{javagreen}, |
|
70 |
morecomment=[s][\color{javadocblue}]{/**}{*/}, |
|
71 |
numbers=left, |
|
72 |
numberstyle=\tiny\color{black}, |
|
73 |
stepnumber=1, |
|
74 |
numbersep=10pt, |
|
75 |
tabsize=2, |
|
76 |
showspaces=false, |
|
77 |
showstringspaces=false} |
|
78 |
||
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 | 81 |
\newcommand{\bl}[1]{\textcolor{blue}{#1}} |
82 |
\newcommand{\dn}{\stackrel{\mbox{\scriptsize def}}{=}}% for definitions |
|
7 | 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
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
137 |
\begin{filecontents}{re1.data} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
138 |
1 0.00179 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
139 |
2 0.00011 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
140 |
3 0.00014 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
141 |
4 0.00026 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
142 |
5 0.00050 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
143 |
6 0.00095 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
144 |
7 0.00190 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
145 |
8 0.00287 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
146 |
9 0.00779 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
147 |
10 0.01399 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
148 |
11 0.01894 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
149 |
12 0.03666 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
150 |
13 0.07994 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
151 |
14 0.08944 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
152 |
15 0.02377 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
153 |
16 0.07392 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
154 |
17 0.22798 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
155 |
18 0.65310 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
156 |
19 2.11360 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
157 |
20 6.31606 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
158 |
21 21.46013 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
159 |
\end{filecontents} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
160 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
161 |
\begin{filecontents}{re2a.data} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
162 |
1 0.00227 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
163 |
5 0.00027 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
164 |
10 0.00075 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
165 |
15 0.00178 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
166 |
20 0.00102 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
167 |
25 0.00028 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
168 |
30 0.00040 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
169 |
35 0.00052 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
170 |
40 0.00075 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
171 |
45 0.00125 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
172 |
50 0.00112 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
173 |
55 0.00099 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
174 |
60 0.00113 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
175 |
65 0.00137 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
176 |
70 0.00170 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
177 |
\end{filecontents} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
178 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
179 |
\begin{filecontents}{re2b.data} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
180 |
1 0.00020 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
181 |
51 0.00080 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
182 |
101 0.00678 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
183 |
151 0.01792 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
184 |
201 0.04815 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
185 |
251 0.09648 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
186 |
301 0.23195 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
187 |
351 0.52646 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
188 |
401 0.96277 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
189 |
451 1.57726 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
190 |
501 2.00166 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
191 |
551 2.98341 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
192 |
601 4.81181 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
193 |
651 6.57054 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
194 |
701 9.73973 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
195 |
751 14.25762 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
196 |
801 14.80760 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
197 |
851 19.60958 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
198 |
901 25.43550 |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
199 |
951 31.96038 |
a6684e8961d0
added
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 |
|
7 | 202 |
\begin{document} |
203 |
||
204 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
205 |
\mode<presentation>{ |
|
206 |
\begin{frame}<1>[t] |
|
207 |
\frametitle{% |
|
208 |
\begin{tabular}{@ {}c@ {}} |
|
209 |
\\[-3mm] |
|
210 |
\LARGE Automata and \\[-2mm] |
|
16 | 211 |
\LARGE Formal Languages (2)\\[3mm] |
7 | 212 |
\end{tabular}} |
213 |
||
16 | 214 |
%\begin{center} |
215 |
%\includegraphics[scale=0.3]{pics/ante1.jpg}\hspace{5mm} |
|
216 |
%\includegraphics[scale=0.31]{pics/ante2.jpg}\\ |
|
217 |
%\footnotesize\textcolor{gray}{Antikythera automaton, 100 BC (Archimedes?)} |
|
218 |
%\end{center} |
|
7 | 219 |
|
220 |
\normalsize |
|
221 |
\begin{center} |
|
222 |
\begin{tabular}{ll} |
|
223 |
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
|
224 |
Office: & S1.27 (1st floor Strand Building)\\ |
16 | 225 |
Slides: & KEATS |
7 | 226 |
\end{tabular} |
227 |
\end{center} |
|
228 |
||
229 |
||
230 |
\end{frame}} |
|
231 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
232 |
||
233 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
234 |
\mode<presentation>{ |
|
16 | 235 |
\begin{frame}[c] |
236 |
\frametitle{\begin{tabular}{c}Languages\end{tabular}} |
|
237 |
||
238 |
A \alert{language} is a set of strings.\bigskip |
|
239 |
||
117
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
240 |
A \alert{regular expression} specifies a set of strings, or language. |
16 | 241 |
|
242 |
\end{frame}} |
|
243 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
244 |
||
245 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
246 |
\mode<presentation>{ |
|
15 | 247 |
\begin{frame}[t] |
117
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
248 |
\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
|
249 |
|
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
250 |
Different ways of writing strings: |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
251 |
|
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
252 |
\begin{center} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
253 |
\begin{tabular}{ccc} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
254 |
\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
|
255 |
\bl{\consolas ""} & \bl{$[]$} & \bl{$N$\!$il$} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
256 |
\end{tabular} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
257 |
\end{center}\pause |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
258 |
|
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
259 |
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
|
260 |
|
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
261 |
\begin{center} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
262 |
\begin{tabular}{l} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
263 |
\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
|
264 |
\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
|
265 |
\end{tabular} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
266 |
\end{center} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
267 |
|
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
268 |
\end{frame}} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
269 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
270 |
|
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
271 |
|
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
272 |
|
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
273 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
274 |
\mode<presentation>{ |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
275 |
\begin{frame}[t] |
7 | 276 |
\frametitle{\begin{tabular}{c}Regular Expressions\end{tabular}} |
277 |
||
15 | 278 |
Their inductive definition: |
279 |
||
280 |
||
117
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
281 |
\begin{textblock}{6}(2,6.5) |
7 | 282 |
\begin{tabular}{@ {}rrl@ {\hspace{13mm}}l} |
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
283 |
\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
|
284 |
& \bl{$\mid$} & \bl{$\epsilon$} & empty string / {\consolas""} / $[]$\\ |
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
285 |
& \bl{$\mid$} & \bl{$c$} & character\\ |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
286 |
& \bl{$\mid$} & \bl{$r_1 \cdot r_2$} & sequence\\ |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
287 |
& \bl{$\mid$} & \bl{$r_1 + r_2$} & alternative / choice\\ |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
288 |
& \bl{$\mid$} & \bl{$r^*$} & star (zero or more)\\ |
7 | 289 |
\end{tabular} |
290 |
\end{textblock} |
|
291 |
||
117
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
292 |
|
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
293 |
\only<2->{ |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
294 |
\begin{textblock}{9}(4,0.5) |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
295 |
\begin{tikzpicture} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
296 |
\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
|
297 |
{\normalsize\color{darkgray} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
298 |
\begin{minipage}{9cm} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
299 |
\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
|
300 |
\texttt{\lstinputlisting{../progs/app51.scala}}}} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
301 |
\end{minipage}}; |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
302 |
\end{tikzpicture} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
303 |
\end{textblock}} |
16 | 304 |
|
305 |
\end{frame}} |
|
306 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
307 |
||
308 |
||
309 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
310 |
\mode<presentation>{ |
|
7 | 311 |
\begin{frame}[c] |
312 |
\frametitle{\begin{tabular}{c}The Meaning of a\\[-2mm] Regular Expression\end{tabular}} |
|
313 |
||
314 |
\begin{textblock}{15}(1,4) |
|
315 |
\begin{tabular}{@ {}rcl} |
|
117
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
316 |
\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
|
317 |
\bl{$L(\epsilon)$} & \bl{$\dn$} & \bl{$\{$""$\}$}\\ |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
318 |
\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
|
319 |
\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
|
320 |
\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
|
321 |
\bl{$L(r^*)$} & \bl{$\dn$} & \bl{$\bigcup_{n \ge 0} L(r)^n$}\\ |
7 | 322 |
\end{tabular}\bigskip |
323 |
||
117
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
324 |
\only<2->{ |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
325 |
\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
|
326 |
\textcolor{blue}{$L(r)^{n+1} \;\dn\; L(r) \,@\, L(r)^n$}} |
11 | 327 |
\end{textblock} |
7 | 328 |
|
117
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
329 |
|
16 | 330 |
|
117
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
331 |
\only<1->{ |
16 | 332 |
\begin{textblock}{6}(9,12)\small |
333 |
\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
|
334 |
\bl{$L$ : Rexp $\Rightarrow$ Set$[$String$]$} |
16 | 335 |
\end{textblock}} |
336 |
||
337 |
||
7 | 338 |
\end{frame}} |
339 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
340 |
||
16 | 341 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
342 |
\mode<presentation>{ |
|
343 |
\begin{frame}[c] |
|
344 |
||
345 |
\large |
|
346 |
\begin{center} |
|
117
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
347 |
What is \bl{$L(a^*)$}? |
16 | 348 |
\end{center} |
349 |
||
350 |
\end{frame}} |
|
351 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
352 |
||
353 |
||
354 |
||
11 | 355 |
\newcommand{\YES}{\textcolor{gray}{yes}} |
356 |
\newcommand{\NO}{\textcolor{gray}{no}} |
|
357 |
\newcommand{\FORALLR}{\textcolor{gray}{$\forall$ r.}} |
|
7 | 358 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
359 |
\mode<presentation>{ |
|
360 |
\begin{frame}[c] |
|
11 | 361 |
\frametitle{\begin{tabular}{c}Reg Exp Equivalences\end{tabular}} |
7 | 362 |
|
363 |
\begin{center} |
|
16 | 364 |
\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
|
365 |
&\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
|
366 |
&\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
|
367 |
&\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
|
368 |
&\bl{$a \cdot a$} & \bl{$\equiv^?$} & \bl{$a$} & \onslide<5->{\NO}\\ |
11 | 369 |
&\bl{$\epsilon^*$} & \bl{$\equiv^?$} & \bl{$\epsilon$} & \onslide<6->{\YES}\\ |
370 |
&\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
|
371 |
\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
|
372 |
\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
|
373 |
\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
|
374 |
\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
|
375 |
&\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
|
376 |
&\bl{$a^*$} & \bl{$\equiv^?$} & \bl{$\epsilon + (a \cdot a^*)$} & \onslide<13->{\YES} |
11 | 377 |
\end{tabular} |
7 | 378 |
\end{center} |
379 |
||
380 |
\end{frame}} |
|
381 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
382 |
||
383 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
384 |
\mode<presentation>{ |
|
385 |
\begin{frame}[c] |
|
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
386 |
\frametitle{\begin{tabular}{c}The Specification\\[-1mm] for Matching\end{tabular}} |
11 | 387 |
|
388 |
\large |
|
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
389 |
a regular expression \bl{$r$} matches a string \bl{$s$}\\ if and only if |
11 | 390 |
|
391 |
\begin{center} |
|
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
392 |
\bl{$s \in L(r)$}\\ |
11 | 393 |
\end{center}\bigskip\bigskip\pause |
394 |
||
117
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
395 |
\end{frame}} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
396 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
397 |
|
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
398 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
399 |
\mode<presentation>{ |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
400 |
\begin{frame}[t] |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
401 |
\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
|
402 |
|
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
403 |
\mbox{}\\[-13mm] |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
404 |
|
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
405 |
\begin{tikzpicture}[y=.2cm, x=.3cm] |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
406 |
%axis |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
407 |
\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
|
408 |
\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
|
409 |
%ticks |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
410 |
\foreach \x in {0,5,...,30} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
411 |
\draw (\x,1pt) -- (\x,-3pt) |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
412 |
node[anchor=north] {\x}; |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
413 |
\foreach \y in {0,5,...,30} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
414 |
\draw (1pt,\y) -- (-3pt,\y) |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
415 |
node[anchor=east] {\y}; |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
416 |
%labels |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
417 |
\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
|
418 |
\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
|
419 |
|
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
420 |
%plots |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
421 |
\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
|
422 |
file {re-python.data}; |
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
423 |
\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
|
424 |
file {re-ruby.data}; |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
425 |
|
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
426 |
%legend |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
427 |
\begin{scope}[shift={(4,20)}] |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
428 |
\draw[color=blue] (0,0) -- |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
429 |
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
|
430 |
node[right]{\small Python}; |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
431 |
\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
|
432 |
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
|
433 |
node[right]{\small Ruby}; |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
434 |
\end{scope} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
435 |
\end{tikzpicture} |
11 | 436 |
|
437 |
\end{frame}} |
|
438 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
439 |
||
440 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
441 |
\mode<presentation>{ |
|
118
6a5b59690f7d
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
117
diff
changeset
|
442 |
\begin{frame}[c] |
6a5b59690f7d
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
117
diff
changeset
|
443 |
\frametitle{\begin{tabular}{c}Evil Regular Expressions\end{tabular}} |
6a5b59690f7d
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
117
diff
changeset
|
444 |
|
6a5b59690f7d
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
117
diff
changeset
|
445 |
\begin{itemize} |
6a5b59690f7d
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
117
diff
changeset
|
446 |
\item \alert{R}egular \alert{e}xpression \alert{D}enial \alert{o}f \alert{S}ervice (ReDoS)\bigskip |
6a5b59690f7d
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
117
diff
changeset
|
447 |
\item Evil regular expressions\medskip |
6a5b59690f7d
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
117
diff
changeset
|
448 |
\begin{itemize} |
6a5b59690f7d
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
117
diff
changeset
|
449 |
\item \bl{$(a?\{n\}) \cdot a\{n\}$} |
6a5b59690f7d
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
117
diff
changeset
|
450 |
\item \bl{$(a^+)^+$} |
6a5b59690f7d
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
117
diff
changeset
|
451 |
\item \bl{$([a$\,-\,$z]^+)^*$} |
6a5b59690f7d
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
117
diff
changeset
|
452 |
\item \bl{$(a + a \cdot a)^+$} |
6a5b59690f7d
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
117
diff
changeset
|
453 |
\item \bl{$(a + a?)^+$} |
6a5b59690f7d
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
117
diff
changeset
|
454 |
\end{itemize} |
6a5b59690f7d
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
117
diff
changeset
|
455 |
\end{itemize} |
6a5b59690f7d
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
117
diff
changeset
|
456 |
|
6a5b59690f7d
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
117
diff
changeset
|
457 |
\end{frame}} |
6a5b59690f7d
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
117
diff
changeset
|
458 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
6a5b59690f7d
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
117
diff
changeset
|
459 |
|
6a5b59690f7d
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
117
diff
changeset
|
460 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
6a5b59690f7d
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
117
diff
changeset
|
461 |
\mode<presentation>{ |
11 | 462 |
\begin{frame}[t] |
463 |
\frametitle{\begin{tabular}{c}A Matching Algorithm\end{tabular}} |
|
464 |
||
117
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
465 |
\small |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
466 |
\ldots{}whether a regular expression can match the empty string: |
11 | 467 |
\begin{center} |
117
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
468 |
\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
|
469 |
\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
|
470 |
\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
|
471 |
\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
|
472 |
\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
|
473 |
\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
|
474 |
\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
|
475 |
\end{tabular} |
16 | 476 |
\end{center} |
477 |
||
117
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
478 |
\only<2->{ |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
479 |
\begin{textblock}{9}(3.4,10) |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
480 |
\begin{tikzpicture} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
481 |
\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
|
482 |
{\normalsize\color{darkgray} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
483 |
\begin{minipage}{9cm} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
484 |
\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
|
485 |
\texttt{\lstinputlisting{../progs/app5.scala}}}} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
486 |
\end{minipage}}; |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
487 |
\end{tikzpicture} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
488 |
\end{textblock}} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
489 |
|
11 | 490 |
\end{frame}} |
491 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
492 |
||
493 |
||
494 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
495 |
\mode<presentation>{ |
|
496 |
\begin{frame}[c] |
|
15 | 497 |
\frametitle{\begin{tabular}{c}The Derivative of a Rexp\end{tabular}} |
7 | 498 |
|
499 |
\large |
|
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
500 |
If \bl{$r$} matches the string \bl{$c\!::\!s$}, what is a regular expression that matches \bl{$s$}?\bigskip\bigskip\bigskip\bigskip |
7 | 501 |
|
502 |
\small |
|
117
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
503 |
\bl{$der\,c\,r$} gives the answer |
7 | 504 |
\end{frame}} |
505 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
506 |
||
507 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
508 |
\mode<presentation>{ |
|
509 |
\begin{frame}[c] |
|
19 | 510 |
\frametitle{\begin{tabular}{c}The Derivative of a Rexp (2)\end{tabular}} |
7 | 511 |
|
512 |
\begin{center} |
|
513 |
\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
|
514 |
\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
|
515 |
\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
|
516 |
\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
|
517 |
\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
|
518 |
\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
|
519 |
& & \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
|
520 |
& & \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
|
521 |
\bl{$der\, c\, (r^*)$} & \bl{$\dn$} & \bl{$(der\,c\,r) \cdot (r^*)$} &\smallskip\\\pause |
7 | 522 |
|
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
523 |
\bl{$der\!s\, []\, r$} & \bl{$\dn$} & \bl{$r$} & \\ |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
524 |
\bl{$der\!s\, (c\!::\!s)\, r$} & \bl{$\dn$} & \bl{$der\!s\,s\,(der\,c\,r)$} & \\ |
7 | 525 |
\end{tabular} |
526 |
\end{center} |
|
527 |
||
117
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
528 |
\only<3->{ |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
529 |
\begin{textblock}{10.5}(2,5) |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
530 |
\begin{tikzpicture} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
531 |
\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
|
532 |
{\normalsize\color{darkgray} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
533 |
\begin{minipage}{10.5cm} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
534 |
\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
|
535 |
\texttt{\lstinputlisting{../progs/app6.scala}}}} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
536 |
\end{minipage}}; |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
537 |
\end{tikzpicture} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
538 |
\end{textblock}} |
7 | 539 |
|
540 |
\end{frame}} |
|
541 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
542 |
||
543 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
544 |
\mode<presentation>{ |
|
545 |
\begin{frame}[c] |
|
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
546 |
\frametitle{\begin{tabular}{c}Examples\end{tabular}} |
7 | 547 |
|
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
548 |
Given \bl{$r \dn ((a \cdot b) + b)^*$} what is |
7 | 549 |
|
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
550 |
\begin{center} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
551 |
\begin{tabular}{l} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
552 |
\bl{$der\,a\,r$}\\ |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
553 |
\bl{$der\,b\,r$} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
554 |
\end{tabular} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
555 |
\end{center} |
7 | 556 |
|
557 |
||
558 |
\end{frame}} |
|
559 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
560 |
||
17 | 561 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
562 |
\mode<presentation>{ |
|
563 |
\begin{frame}[t] |
|
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
564 |
\frametitle{\begin{tabular}{c}\bl{$(a?\{n\}) \cdot a\{n\}$}\end{tabular}} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
565 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
566 |
\mbox{}\\[-13mm] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
567 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
568 |
\begin{tikzpicture}[y=.2cm, x=.3cm] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
569 |
%axis |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
570 |
\draw (0,0) -- coordinate (x axis mid) (30,0); |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
571 |
\draw (0,0) -- coordinate (y axis mid) (0,30); |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
572 |
%ticks |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
573 |
\foreach \x in {0,5,...,30} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
574 |
\draw (\x,1pt) -- (\x,-3pt) |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
575 |
node[anchor=north] {\x}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
576 |
\foreach \y in {0,5,...,30} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
577 |
\draw (1pt,\y) -- (-3pt,\y) |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
578 |
node[anchor=east] {\y}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
579 |
%labels |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
580 |
\node[below=0.6cm] at (x axis mid) {\bl{a}s}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
581 |
\node[rotate=90, left=1.2cm] at (y axis mid) {secs}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
582 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
583 |
%plots |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
584 |
\draw[color=blue] plot[mark=*, mark options={fill=white}] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
585 |
file {re-python.data}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
586 |
\draw[color=red] plot[mark=triangle*, mark options={fill=white} ] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
587 |
file {re1.data}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
588 |
\draw[color=brown] plot[mark=pentagon*, mark options={fill=white} ] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
589 |
file {re-ruby.data}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
590 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
591 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
592 |
%legend |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
593 |
\begin{scope}[shift={(4,20)}] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
594 |
\draw[color=blue] (0,0) -- |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
595 |
plot[mark=*, mark options={fill=white}] (0.25,0) -- (0.5,0) |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
596 |
node[right]{\small Python}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
597 |
\draw[yshift=-\baselineskip, color=brown] (0,0) -- |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
598 |
plot[mark=pentagon*, mark options={fill=white}] (0.25,0) -- (0.5,0) |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
599 |
node[right]{\small Ruby}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
600 |
\draw[yshift=\baselineskip, color=red] (0,0) -- |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
601 |
plot[mark=triangle*, mark options={fill=white}] (0.25,0) -- (0.5,0) |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
602 |
node[right]{\small Scala V1}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
603 |
\end{scope} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
604 |
\end{tikzpicture} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
605 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
606 |
\end{frame}} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
607 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
608 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
609 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
610 |
\mode<presentation>{ |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
611 |
\begin{frame}[t] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
612 |
\frametitle{\begin{tabular}{c}Proofs about Rexps\end{tabular}} |
17 | 613 |
|
614 |
Remember their inductive definition:\\[5cm] |
|
615 |
||
616 |
\begin{textblock}{6}(5,5) |
|
617 |
\begin{tabular}{@ {}rrl} |
|
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
618 |
\bl{$r$} & \bl{$::=$} & \bl{$\varnothing$}\\ |
17 | 619 |
& \bl{$\mid$} & \bl{$\epsilon$} \\ |
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
620 |
& \bl{$\mid$} & \bl{$c$} \\ |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
621 |
& \bl{$\mid$} & \bl{$r_1 \cdot r_2$}\\ |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
622 |
& \bl{$\mid$} & \bl{$r_1 + r_2$} \\ |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
623 |
& \bl{$\mid$} & \bl{$r^*$} \\ |
17 | 624 |
\end{tabular} |
625 |
\end{textblock} |
|
626 |
||
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
627 |
If we want to prove something, say a property \bl{$P(r)$}, for all regular expressions \bl{$r$} then \ldots |
17 | 628 |
|
629 |
\end{frame}} |
|
630 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
631 |
||
632 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
633 |
\mode<presentation>{ |
|
634 |
\begin{frame}[c] |
|
635 |
\frametitle{\begin{tabular}{c}Proofs about Rexp (2)\end{tabular}} |
|
636 |
||
637 |
\begin{itemize} |
|
638 |
\item \bl{$P$} holds for \bl{$\varnothing$}, \bl{$\epsilon$} and \bl{c}\bigskip |
|
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
639 |
\item \bl{$P$} holds for \bl{$r_1 + r_2$} under the assumption that \bl{$P$} already |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
640 |
holds for \bl{$r_1$} and \bl{$r_2$}.\bigskip |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
641 |
\item \bl{$P$} holds for \bl{$r_1 \cdot r_2$} under the assumption that \bl{$P$} already |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
642 |
holds for \bl{$r_1$} and \bl{$r_2$}.\bigskip |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
643 |
\item \bl{$P$} holds for \bl{$r^*$} under the assumption that \bl{$P$} already |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
644 |
holds for \bl{$r$}. |
17 | 645 |
\end{itemize} |
646 |
||
647 |
\end{frame}} |
|
648 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
649 |
||
650 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
651 |
\mode<presentation>{ |
|
652 |
\begin{frame}[c] |
|
653 |
\frametitle{\begin{tabular}{c}Proofs about Rexp (3)\end{tabular}} |
|
654 |
||
655 |
Assume \bl{$P(r)$} is the property: |
|
656 |
||
657 |
\begin{center} |
|
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
658 |
\bl{$nullable(r)$} if and only if \bl{$"" \in L(r)$} |
17 | 659 |
\end{center} |
660 |
||
661 |
\end{frame}} |
|
662 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
663 |
||
664 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
665 |
\mode<presentation>{ |
|
666 |
\begin{frame}[c] |
|
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
667 |
\frametitle{\begin{tabular}{c}Proofs about Rexp (4)\end{tabular}} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
668 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
669 |
Let \bl{$Der\,c\,A$} be the set defined as |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
670 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
671 |
\begin{center} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
672 |
\bl{$Der\,c\,A \dn \{ s \;|\; c\!::\!s \in A\}$ } |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
673 |
\end{center} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
674 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
675 |
We can prove |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
676 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
677 |
\begin{center} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
678 |
\bl{$L(der\,c\,r) = Der\,c\,(L(r))$} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
679 |
\end{center} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
680 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
681 |
by induction on \bl{$r$}. |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
682 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
683 |
\end{frame}} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
684 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
685 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
686 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
687 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
688 |
\mode<presentation>{ |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
689 |
\begin{frame}[c] |
17 | 690 |
\frametitle{\begin{tabular}{c}Proofs about Strings\end{tabular}} |
691 |
||
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
692 |
If we want to prove something, say a property \bl{$P(s)$}, for all strings \bl{$s$} then \ldots\bigskip |
17 | 693 |
|
694 |
\begin{itemize} |
|
695 |
\item \bl{$P$} holds for the empty string, and\medskip |
|
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
696 |
\item \bl{$P$} holds for the string \bl{$c\!::\!s$} under the assumption that \bl{$P$} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
697 |
already holds for \bl{$s$} |
17 | 698 |
\end{itemize} |
699 |
\end{frame}} |
|
700 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
701 |
||
19 | 702 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
703 |
\mode<presentation>{ |
|
704 |
\begin{frame}[c] |
|
705 |
\frametitle{\begin{tabular}{c}Proofs about Strings (2)\end{tabular}} |
|
706 |
||
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
707 |
We can finally prove |
19 | 708 |
|
709 |
\begin{center} |
|
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
710 |
\bl{$matcher(r, s)$} if and only if \bl{$s \in L(r)$} |
19 | 711 |
\end{center} |
712 |
||
713 |
||
714 |
\end{frame}} |
|
715 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
17 | 716 |
|
717 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
718 |
\mode<presentation>{ |
|
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
719 |
\begin{frame}[t] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
720 |
\frametitle{\begin{tabular}{c}\bl{$(a?\{n\}) \cdot a\{n\}$}\end{tabular}} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
721 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
722 |
\mbox{}\\[-13mm] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
723 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
724 |
\begin{tikzpicture}[y=.2cm, x=.3cm] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
725 |
%axis |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
726 |
\draw (0,0) -- coordinate (x axis mid) (30,0); |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
727 |
\draw (0,0) -- coordinate (y axis mid) (0,30); |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
728 |
%ticks |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
729 |
\foreach \x in {0,5,...,30} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
730 |
\draw (\x,1pt) -- (\x,-3pt) |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
731 |
node[anchor=north] {\x}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
732 |
\foreach \y in {0,5,...,30} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
733 |
\draw (1pt,\y) -- (-3pt,\y) |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
734 |
node[anchor=east] {\y}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
735 |
%labels |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
736 |
\node[below=0.6cm] at (x axis mid) {\bl{a}s}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
737 |
\node[rotate=90, left=1.2cm] at (y axis mid) {secs}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
738 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
739 |
%plots |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
740 |
\draw[color=blue] plot[mark=*, mark options={fill=white}] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
741 |
file {re-python.data}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
742 |
\draw[color=red] plot[mark=triangle*, mark options={fill=white} ] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
743 |
file {re1.data}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
744 |
\draw[color=brown] plot[mark=pentagon*, mark options={fill=white} ] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
745 |
file {re-ruby.data}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
746 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
747 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
748 |
%legend |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
749 |
\begin{scope}[shift={(4,20)}] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
750 |
\draw[color=blue] (0,0) -- |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
751 |
plot[mark=*, mark options={fill=white}] (0.25,0) -- (0.5,0) |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
752 |
node[right]{\small Python}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
753 |
\draw[yshift=-\baselineskip, color=brown] (0,0) -- |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
754 |
plot[mark=pentagon*, mark options={fill=white}] (0.25,0) -- (0.5,0) |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
755 |
node[right]{\small Ruby}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
756 |
\draw[yshift=\baselineskip, color=red] (0,0) -- |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
757 |
plot[mark=triangle*, mark options={fill=white}] (0.25,0) -- (0.5,0) |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
758 |
node[right]{\small Scala V1}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
759 |
\end{scope} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
760 |
\end{tikzpicture} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
761 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
762 |
\end{frame}} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
763 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
764 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
765 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
766 |
\mode<presentation>{ |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
767 |
\begin{frame}[c] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
768 |
\frametitle{\begin{tabular}{c}Problem\end{tabular}} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
769 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
770 |
We represented ``n-times'' as a sequence regular expression: |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
771 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
772 |
\begin{center} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
773 |
\begin{tabular}{ll} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
774 |
1: |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
775 |
\end{tabular} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
776 |
\end{center} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
777 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
778 |
\end{frame}} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
779 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
780 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
781 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
782 |
\mode<presentation>{ |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
783 |
\begin{frame}[t] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
784 |
\frametitle{\begin{tabular}{c}\bl{$(a?\{n\}) \cdot a\{n\}$}\end{tabular}} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
785 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
786 |
\mbox{}\\[-13mm] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
787 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
788 |
\begin{tikzpicture}[y=.2cm, x=.12cm] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
789 |
%axis |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
790 |
\draw (0,0) -- coordinate (x axis mid) (70,0); |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
791 |
\draw (0,0) -- coordinate (y axis mid) (0,30); |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
792 |
%ticks |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
793 |
\foreach \x in {0,10,...,70} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
794 |
\draw (\x,1pt) -- (\x,-3pt) |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
795 |
node[anchor=north] {\x}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
796 |
\foreach \y in {0,5,...,30} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
797 |
\draw (1pt,\y) -- (-3pt,\y) |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
798 |
node[anchor=east] {\y}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
799 |
%labels |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
800 |
\node[below=0.6cm] at (x axis mid) {\bl{a}s}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
801 |
\node[rotate=90, left=1.2cm] at (y axis mid) {secs}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
802 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
803 |
%plots |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
804 |
\draw[color=blue] plot[mark=*, mark options={fill=white}] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
805 |
file {re-python.data}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
806 |
\draw[color=red] plot[mark=triangle*, mark options={fill=white} ] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
807 |
file {re1.data}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
808 |
\draw[color=green] plot[mark=square*, mark options={fill=white} ] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
809 |
file {re2a.data}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
810 |
\draw[color=brown] plot[mark=pentagon*, mark options={fill=white} ] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
811 |
file {re-ruby.data}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
812 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
813 |
%legend |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
814 |
\begin{scope}[shift={(4,20)}] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
815 |
\draw[color=blue] (0,0) -- |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
816 |
plot[mark=*, mark options={fill=white}] (0.25,0) -- (0.5,0) |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
817 |
node[right]{\small Python}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
818 |
\draw[yshift=-\baselineskip, color=brown] (0,0) -- |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
819 |
plot[mark=pentagon*, mark options={fill=white}] (0.25,0) -- (0.5,0) |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
820 |
node[right]{\small Ruby}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
821 |
\draw[yshift=\baselineskip, color=red] (0,0) -- |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
822 |
plot[mark=triangle*, mark options={fill=white}] (0.25,0) -- (0.5,0) |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
823 |
node[right]{\small Scala V1}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
824 |
\draw[yshift=2\baselineskip, color=green] (0,0) -- |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
825 |
plot[mark=square*, mark options={fill=white}] (0.25,0) -- (0.5,0) |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
826 |
node[right]{\small Scala V2}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
827 |
\end{scope} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
828 |
\end{tikzpicture} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
829 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
830 |
\end{frame}} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
831 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
832 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
833 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
834 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
835 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
836 |
\mode<presentation>{ |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
837 |
\begin{frame}[t] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
838 |
\frametitle{\begin{tabular}{c}\bl{$(a?\{n\}) \cdot a\{n\}$}\end{tabular}} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
839 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
840 |
\mbox{}\\[-13mm] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
841 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
842 |
\begin{tabular}{@ {\hspace{-5mm}}l} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
843 |
\begin{tikzpicture}[y=.2cm, x=.01cm] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
844 |
%axis |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
845 |
\draw (0,0) -- coordinate (x axis mid) (1000,0); |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
846 |
\draw (0,0) -- coordinate (y axis mid) (0,30); |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
847 |
%ticks |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
848 |
\foreach \x in {0,100,...,1000} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
849 |
\draw (\x,1pt) -- (\x,-3pt) |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
850 |
node[anchor=north] {\x}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
851 |
\foreach \y in {0,5,...,30} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
852 |
\draw (1pt,\y) -- (-3pt,\y) |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
853 |
node[anchor=east] {\y}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
854 |
%labels |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
855 |
\node[below=0.6cm] at (x axis mid) {\bl{a}s}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
856 |
\node[rotate=90, left=1.2cm] at (y axis mid) {secs}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
857 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
858 |
%plots |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
859 |
\draw[color=blue] plot[mark=*, mark options={fill=white}] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
860 |
file {re-python.data}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
861 |
\draw[color=red] plot[mark=triangle*, mark options={fill=white} ] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
862 |
file {re1.data}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
863 |
\draw[color=green] plot[mark=square*, mark options={fill=white} ] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
864 |
file {re2b.data}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
865 |
\draw[color=brown] plot[mark=pentagon*, mark options={fill=white} ] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
866 |
file {re-ruby.data}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
867 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
868 |
%legend |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
869 |
\begin{scope}[shift={(100,20)}] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
870 |
\draw[color=blue] (0,0) -- |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
871 |
plot[mark=*, mark options={fill=white}] (0.25,0) -- (50,0) |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
872 |
node[right]{\small Python}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
873 |
\draw[yshift=-13, color=brown] (0,0) -- |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
874 |
plot[mark=pentagon*, mark options={fill=white}] (0.25,0) -- (50,0) |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
875 |
node[right]{\small Ruby}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
876 |
\draw[yshift=13, color=red] (0,0) -- |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
877 |
plot[mark=triangle*, mark options={fill=white}] (0.25,0) -- (50,0) |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
878 |
node[right]{\small Scala V1}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
879 |
\draw[yshift=26, color=green] (0,0) -- |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
880 |
plot[mark=square*, mark options={fill=white}] (0.25,0) -- (50,0) |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
881 |
node[right]{\small Scala V2}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
882 |
\end{scope} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
883 |
\end{tikzpicture} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
884 |
\end{tabular} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
885 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
886 |
\end{frame}} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
887 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
888 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
889 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
890 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
891 |
\mode<presentation>{ |
17 | 892 |
\begin{frame}[c] |
893 |
\frametitle{\begin{tabular}{c}Regular Languages\end{tabular}} |
|
894 |
||
895 |
A language (set of strings) is \alert{regular} iff there exists |
|
896 |
a regular expression that recognises all its strings. |
|
897 |
||
898 |
\end{frame}} |
|
899 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
900 |
||
901 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
902 |
\mode<presentation>{ |
|
903 |
\begin{frame}[c] |
|
904 |
\frametitle{\begin{tabular}{c}Automata\end{tabular}} |
|
905 |
||
906 |
A deterministic finite automaton consists of: |
|
907 |
||
908 |
\begin{itemize} |
|
909 |
\item a set of states |
|
910 |
\item one of these states is the start state |
|
911 |
\item some states are accepting states, and |
|
912 |
\item there is transition function\medskip |
|
913 |
||
914 |
\small |
|
915 |
which takes a state as argument and a character and produces a new state\smallskip\\ |
|
916 |
this function might not always be defined |
|
917 |
\end{itemize} |
|
918 |
||
919 |
\end{frame}} |
|
920 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
921 |
||
7 | 922 |
|
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
923 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
924 |
\mode<presentation>{ |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
925 |
\begin{frame}[c] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
926 |
\frametitle{\begin{tabular}{c}The Rexp Matcher\end{tabular}} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
927 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
928 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
929 |
{\lstset{language=Scala}\fontsize{8}{10}\selectfont |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
930 |
\texttt{\lstinputlisting{../progs/app7.scala}}} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
931 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
932 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
933 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
934 |
\end{frame}} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
935 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
936 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
937 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
938 |
|
7 | 939 |
\end{document} |
940 |
||
941 |
%%% Local Variables: |
|
942 |
%%% mode: latex |
|
943 |
%%% TeX-master: t |
|
944 |
%%% End: |
|
945 |