author | Christian Urban <christian dot urban at kcl dot ac dot uk> |
Wed, 02 Oct 2013 01:16:30 +0100 | |
changeset 122 | 4123344e6915 |
parent 121 | 43c116860e47 |
child 133 | 09efdf5cf07c |
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 |
|
121
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
202 |
\begin{filecontents}{re3.data} |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
203 |
1 0.001605 |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
204 |
501 0.131066 |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
205 |
1001 0.057885 |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
206 |
1501 0.136875 |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
207 |
2001 0.176238 |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
208 |
2501 0.254363 |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
209 |
3001 0.37262 |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
210 |
3501 0.500946 |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
211 |
4001 0.638384 |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
212 |
4501 0.816605 |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
213 |
5001 1.00491 |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
214 |
5501 1.232505 |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
215 |
6001 1.525672 |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
216 |
6501 1.757502 |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
217 |
7001 2.092784 |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
218 |
7501 2.429224 |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
219 |
8001 2.803037 |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
220 |
8501 3.463045 |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
221 |
9001 3.609 |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
222 |
9501 4.081504 |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
223 |
10001 4.54569 |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
224 |
10501 6.17789 |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
225 |
11001 6.77242 |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
226 |
11501 7.95864 |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
227 |
\end{filecontents} |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
228 |
|
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
229 |
|
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
230 |
|
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
231 |
|
7 | 232 |
\begin{document} |
233 |
||
234 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
235 |
\mode<presentation>{ |
|
236 |
\begin{frame}<1>[t] |
|
237 |
\frametitle{% |
|
238 |
\begin{tabular}{@ {}c@ {}} |
|
239 |
\\[-3mm] |
|
240 |
\LARGE Automata and \\[-2mm] |
|
16 | 241 |
\LARGE Formal Languages (2)\\[3mm] |
7 | 242 |
\end{tabular}} |
243 |
||
16 | 244 |
%\begin{center} |
245 |
%\includegraphics[scale=0.3]{pics/ante1.jpg}\hspace{5mm} |
|
246 |
%\includegraphics[scale=0.31]{pics/ante2.jpg}\\ |
|
247 |
%\footnotesize\textcolor{gray}{Antikythera automaton, 100 BC (Archimedes?)} |
|
248 |
%\end{center} |
|
7 | 249 |
|
250 |
\normalsize |
|
251 |
\begin{center} |
|
252 |
\begin{tabular}{ll} |
|
253 |
Email: & christian.urban at kcl.ac.uk\\ |
|
117
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
254 |
Office: & S1.27 (1st floor Strand Building)\\ |
16 | 255 |
Slides: & KEATS |
7 | 256 |
\end{tabular} |
257 |
\end{center} |
|
258 |
||
259 |
||
260 |
\end{frame}} |
|
261 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
262 |
||
263 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
264 |
\mode<presentation>{ |
|
16 | 265 |
\begin{frame}[c] |
266 |
\frametitle{\begin{tabular}{c}Languages\end{tabular}} |
|
267 |
||
268 |
A \alert{language} is a set of strings.\bigskip |
|
269 |
||
117
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
270 |
A \alert{regular expression} specifies a set of strings, or language. |
16 | 271 |
|
272 |
\end{frame}} |
|
273 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
274 |
||
275 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
276 |
\mode<presentation>{ |
|
15 | 277 |
\begin{frame}[t] |
117
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
278 |
\frametitle{\begin{tabular}{c}Strings\end{tabular}} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
279 |
|
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
280 |
Different ways of writing strings: |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
281 |
|
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
282 |
\begin{center} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
283 |
\begin{tabular}{ccc} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
284 |
\bl{\consolas"$hello$"}\quad{} & \bl{$[h, e, l, l, o]$} & \quad\bl{$h\!::\!e\!::\!l\!::\!l\!::\!o\!::\!N\!il$}\bigskip\\ |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
285 |
\bl{\consolas ""} & \bl{$[]$} & \bl{$N$\!$il$} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
286 |
\end{tabular} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
287 |
\end{center}\pause |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
288 |
|
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
289 |
The concatenation operation on strings and sets of strings: |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
290 |
|
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
291 |
\begin{center} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
292 |
\begin{tabular}{l} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
293 |
\bl{{\consolas"$f\!oo$"}$\;@\;${\consolas"$bar$"}$\;=\;${\consolas"$f\!oobar$"}}\medskip\\ |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
294 |
\bl{$A \;@\; B \dn \{ s_1 @ s_2 \mid s_1 \in A \wedge s_2 \in B\}$} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
295 |
\end{tabular} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
296 |
\end{center} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
297 |
|
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
298 |
\end{frame}} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
299 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
300 |
|
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
301 |
|
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
302 |
|
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
303 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
304 |
\mode<presentation>{ |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
305 |
\begin{frame}[t] |
7 | 306 |
\frametitle{\begin{tabular}{c}Regular Expressions\end{tabular}} |
307 |
||
15 | 308 |
Their inductive definition: |
309 |
||
310 |
||
117
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
311 |
\begin{textblock}{6}(2,6.5) |
7 | 312 |
\begin{tabular}{@ {}rrl@ {\hspace{13mm}}l} |
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
313 |
\bl{$r$} & \bl{$::=$} & \bl{$\varnothing$} & null\\ |
117
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
314 |
& \bl{$\mid$} & \bl{$\epsilon$} & empty string / {\consolas""} / $[]$\\ |
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
315 |
& \bl{$\mid$} & \bl{$c$} & character\\ |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
316 |
& \bl{$\mid$} & \bl{$r_1 \cdot r_2$} & sequence\\ |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
317 |
& \bl{$\mid$} & \bl{$r_1 + r_2$} & alternative / choice\\ |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
318 |
& \bl{$\mid$} & \bl{$r^*$} & star (zero or more)\\ |
7 | 319 |
\end{tabular} |
320 |
\end{textblock} |
|
321 |
||
117
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
322 |
|
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
323 |
\only<2->{ |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
324 |
\begin{textblock}{9}(4,0.5) |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
325 |
\begin{tikzpicture} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
326 |
\draw (0,0) node[inner sep=2mm,fill=cream, ultra thick, draw=red, rounded corners=2mm] |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
327 |
{\normalsize\color{darkgray} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
328 |
\begin{minipage}{9cm} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
329 |
\hspace{5mm}\mbox{{\lstset{language=Scala}\fontsize{8}{10}\selectfont |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
330 |
\texttt{\lstinputlisting{../progs/app51.scala}}}} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
331 |
\end{minipage}}; |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
332 |
\end{tikzpicture} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
333 |
\end{textblock}} |
16 | 334 |
|
335 |
\end{frame}} |
|
336 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
337 |
||
338 |
||
339 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
340 |
\mode<presentation>{ |
|
7 | 341 |
\begin{frame}[c] |
342 |
\frametitle{\begin{tabular}{c}The Meaning of a\\[-2mm] Regular Expression\end{tabular}} |
|
343 |
||
344 |
\begin{textblock}{15}(1,4) |
|
345 |
\begin{tabular}{@ {}rcl} |
|
117
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
346 |
\bl{$L(\varnothing)$} & \bl{$\dn$} & \bl{$\varnothing$}\\ |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
347 |
\bl{$L(\epsilon)$} & \bl{$\dn$} & \bl{$\{$""$\}$}\\ |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
348 |
\bl{$L(c)$} & \bl{$\dn$} & \bl{$\{"c"\}$}\\ |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
349 |
\bl{$L(r_1 + r_2)$} & \bl{$\dn$} & \bl{$L(r_1) \cup L(r_2)$}\\ |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
350 |
\bl{$L(r_1 \cdot r_2)$} & \bl{$\dn$} & \bl{$L(r_1) \,@\, L(r_2)$}\\ |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
351 |
\bl{$L(r^*)$} & \bl{$\dn$} & \bl{$\bigcup_{n \ge 0} L(r)^n$}\\ |
7 | 352 |
\end{tabular}\bigskip |
353 |
||
117
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
354 |
\only<2->{ |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
355 |
\hspace{5mm}\textcolor{blue}{$L(r)^0 \;\dn\; \{""\}$}\\ |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
356 |
\textcolor{blue}{$L(r)^{n+1} \;\dn\; L(r) \,@\, L(r)^n$}} |
11 | 357 |
\end{textblock} |
7 | 358 |
|
117
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
359 |
|
16 | 360 |
|
117
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
361 |
\only<1->{ |
16 | 362 |
\begin{textblock}{6}(9,12)\small |
363 |
\bl{$L$} is a function from regular expressions to sets of strings\\ |
|
117
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
364 |
\bl{$L$ : Rexp $\Rightarrow$ Set$[$String$]$} |
16 | 365 |
\end{textblock}} |
366 |
||
367 |
||
7 | 368 |
\end{frame}} |
369 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
370 |
||
16 | 371 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
372 |
\mode<presentation>{ |
|
373 |
\begin{frame}[c] |
|
374 |
||
375 |
\large |
|
376 |
\begin{center} |
|
117
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
377 |
What is \bl{$L(a^*)$}? |
16 | 378 |
\end{center} |
379 |
||
380 |
\end{frame}} |
|
381 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
382 |
||
383 |
||
384 |
||
11 | 385 |
\newcommand{\YES}{\textcolor{gray}{yes}} |
386 |
\newcommand{\NO}{\textcolor{gray}{no}} |
|
387 |
\newcommand{\FORALLR}{\textcolor{gray}{$\forall$ r.}} |
|
7 | 388 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
389 |
\mode<presentation>{ |
|
390 |
\begin{frame}[c] |
|
11 | 391 |
\frametitle{\begin{tabular}{c}Reg Exp Equivalences\end{tabular}} |
7 | 392 |
|
393 |
\begin{center} |
|
16 | 394 |
\begin{tabular}{l@ {\hspace{7mm}}rcl@ {\hspace{7mm}}l} |
117
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
395 |
&\bl{$(a + b) + c$} & \bl{$\equiv^?$} & \bl{$a + (b + c)$} & \onslide<2->{\YES}\\ |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
396 |
&\bl{$a + a$} & \bl{$\equiv^?$} & \bl{$a$} & \onslide<3->{\YES}\\ |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
397 |
&\bl{$(a \cdot b) \cdot c$} & \bl{$\equiv^?$} & \bl{$a \cdot (b \cdot c)$} & \onslide<4->{\YES}\\ |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
398 |
&\bl{$a \cdot a$} & \bl{$\equiv^?$} & \bl{$a$} & \onslide<5->{\NO}\\ |
11 | 399 |
&\bl{$\epsilon^*$} & \bl{$\equiv^?$} & \bl{$\epsilon$} & \onslide<6->{\YES}\\ |
400 |
&\bl{$\varnothing^*$} & \bl{$\equiv^?$} & \bl{$\varnothing$} & \onslide<7->{\NO}\\ |
|
117
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
401 |
\FORALLR &\bl{$r \cdot \epsilon$} & \bl{$\equiv^?$} & \bl{$r$} & \onslide<8->{\YES}\\ |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
402 |
\FORALLR &\bl{$r + \epsilon$} & \bl{$\equiv^?$} & \bl{$r$} & \onslide<9->{\NO}\\ |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
403 |
\FORALLR &\bl{$r + \varnothing$} & \bl{$\equiv^?$} & \bl{$r$} & \onslide<10->{\YES}\\ |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
404 |
\FORALLR &\bl{$r \cdot \varnothing$} & \bl{$\equiv^?$} & \bl{$r$} & \onslide<11->{\NO}\\ |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
405 |
&\bl{$c \cdot (a + b)$} & \bl{$\equiv^?$} & \bl{$(c \cdot a) + (c \cdot b)$} & \onslide<12->{\YES}\\ |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
406 |
&\bl{$a^*$} & \bl{$\equiv^?$} & \bl{$\epsilon + (a \cdot a^*)$} & \onslide<13->{\YES} |
11 | 407 |
\end{tabular} |
7 | 408 |
\end{center} |
409 |
||
410 |
\end{frame}} |
|
411 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
412 |
||
413 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
414 |
\mode<presentation>{ |
|
415 |
\begin{frame}[c] |
|
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
416 |
\frametitle{\begin{tabular}{c}The Specification\\[-1mm] for Matching\end{tabular}} |
11 | 417 |
|
418 |
\large |
|
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
419 |
a regular expression \bl{$r$} matches a string \bl{$s$}\\ if and only if |
11 | 420 |
|
421 |
\begin{center} |
|
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
422 |
\bl{$s \in L(r)$}\\ |
11 | 423 |
\end{center}\bigskip\bigskip\pause |
424 |
||
117
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
425 |
\end{frame}} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
426 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
427 |
|
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
428 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
429 |
\mode<presentation>{ |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
430 |
\begin{frame}[t] |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
431 |
\frametitle{\begin{tabular}{c}\bl{$(a?\{n\}) \cdot a\{n\}$}\end{tabular}} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
432 |
|
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
433 |
\mbox{}\\[-13mm] |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
434 |
|
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
435 |
\begin{tikzpicture}[y=.2cm, x=.3cm] |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
436 |
%axis |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
437 |
\draw (0,0) -- coordinate (x axis mid) (30,0); |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
438 |
\draw (0,0) -- coordinate (y axis mid) (0,30); |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
439 |
%ticks |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
440 |
\foreach \x in {0,5,...,30} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
441 |
\draw (\x,1pt) -- (\x,-3pt) |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
442 |
node[anchor=north] {\x}; |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
443 |
\foreach \y in {0,5,...,30} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
444 |
\draw (1pt,\y) -- (-3pt,\y) |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
445 |
node[anchor=east] {\y}; |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
446 |
%labels |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
447 |
\node[below=0.6cm] at (x axis mid) {\bl{a}s}; |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
448 |
\node[rotate=90, left=1.2cm] at (y axis mid) {secs}; |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
449 |
|
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
450 |
%plots |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
451 |
\draw[color=blue] plot[mark=*, mark options={fill=white}] |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
452 |
file {re-python.data}; |
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
453 |
\draw[color=brown] plot[mark=pentagon*, mark options={fill=white} ] |
117
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
454 |
file {re-ruby.data}; |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
455 |
|
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
456 |
%legend |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
457 |
\begin{scope}[shift={(4,20)}] |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
458 |
\draw[color=blue] (0,0) -- |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
459 |
plot[mark=*, mark options={fill=white}] (0.25,0) -- (0.5,0) |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
460 |
node[right]{\small Python}; |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
461 |
\draw[yshift=-\baselineskip, color=brown] (0,0) -- |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
462 |
plot[mark=pentagon*, mark options={fill=white}] (0.25,0) -- (0.5,0) |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
463 |
node[right]{\small Ruby}; |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
464 |
\end{scope} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
465 |
\end{tikzpicture} |
11 | 466 |
|
467 |
\end{frame}} |
|
468 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
469 |
||
470 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
471 |
\mode<presentation>{ |
|
118
6a5b59690f7d
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
117
diff
changeset
|
472 |
\begin{frame}[c] |
6a5b59690f7d
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
117
diff
changeset
|
473 |
\frametitle{\begin{tabular}{c}Evil Regular Expressions\end{tabular}} |
6a5b59690f7d
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
117
diff
changeset
|
474 |
|
6a5b59690f7d
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
117
diff
changeset
|
475 |
\begin{itemize} |
6a5b59690f7d
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
117
diff
changeset
|
476 |
\item \alert{R}egular \alert{e}xpression \alert{D}enial \alert{o}f \alert{S}ervice (ReDoS)\bigskip |
6a5b59690f7d
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
117
diff
changeset
|
477 |
\item Evil regular expressions\medskip |
6a5b59690f7d
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
117
diff
changeset
|
478 |
\begin{itemize} |
6a5b59690f7d
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
117
diff
changeset
|
479 |
\item \bl{$(a?\{n\}) \cdot a\{n\}$} |
6a5b59690f7d
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
117
diff
changeset
|
480 |
\item \bl{$(a^+)^+$} |
6a5b59690f7d
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
117
diff
changeset
|
481 |
\item \bl{$([a$\,-\,$z]^+)^*$} |
6a5b59690f7d
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
117
diff
changeset
|
482 |
\item \bl{$(a + a \cdot a)^+$} |
6a5b59690f7d
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
117
diff
changeset
|
483 |
\item \bl{$(a + a?)^+$} |
6a5b59690f7d
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
117
diff
changeset
|
484 |
\end{itemize} |
6a5b59690f7d
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
117
diff
changeset
|
485 |
\end{itemize} |
6a5b59690f7d
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
117
diff
changeset
|
486 |
|
6a5b59690f7d
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
117
diff
changeset
|
487 |
\end{frame}} |
6a5b59690f7d
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
117
diff
changeset
|
488 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
6a5b59690f7d
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
117
diff
changeset
|
489 |
|
6a5b59690f7d
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
117
diff
changeset
|
490 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
6a5b59690f7d
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
117
diff
changeset
|
491 |
\mode<presentation>{ |
11 | 492 |
\begin{frame}[t] |
493 |
\frametitle{\begin{tabular}{c}A Matching Algorithm\end{tabular}} |
|
494 |
||
117
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
495 |
\small |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
496 |
\ldots{}whether a regular expression can match the empty string: |
11 | 497 |
\begin{center} |
117
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
498 |
\begin{tabular}{@ {}l@ {\hspace{2mm}}c@ {\hspace{2mm}}l@ {}} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
499 |
\bl{$nullable(\varnothing)$} & \bl{$\dn$} & \bl{$f\!\/alse$}\\ |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
500 |
\bl{$nullable(\epsilon)$} & \bl{$\dn$} & \bl{$true$}\\ |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
501 |
\bl{$nullable (c)$} & \bl{$\dn$} & \bl{$f\!alse$}\\ |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
502 |
\bl{$nullable (r_1 + r_2)$} & \bl{$\dn$} & \bl{$nullable(r_1) \vee nullable(r_2)$} \\ |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
503 |
\bl{$nullable (r_1 \cdot r_2)$} & \bl{$\dn$} & \bl{$nullable(r_1) \wedge nullable(r_2)$} \\ |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
504 |
\bl{$nullable (r^*)$} & \bl{$\dn$} & \bl{$true$} \\ |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
505 |
\end{tabular} |
16 | 506 |
\end{center} |
507 |
||
117
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
508 |
\only<2->{ |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
509 |
\begin{textblock}{9}(3.4,10) |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
510 |
\begin{tikzpicture} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
511 |
\draw (0,0) node[inner sep=2mm,fill=cream, ultra thick, draw=red, rounded corners=2mm] |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
512 |
{\normalsize\color{darkgray} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
513 |
\begin{minipage}{9cm} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
514 |
\hspace{5mm}\mbox{{\lstset{language=Scala}\fontsize{8}{10}\selectfont |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
515 |
\texttt{\lstinputlisting{../progs/app5.scala}}}} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
516 |
\end{minipage}}; |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
517 |
\end{tikzpicture} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
518 |
\end{textblock}} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
519 |
|
11 | 520 |
\end{frame}} |
521 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
522 |
||
523 |
||
524 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
525 |
\mode<presentation>{ |
|
526 |
\begin{frame}[c] |
|
15 | 527 |
\frametitle{\begin{tabular}{c}The Derivative of a Rexp\end{tabular}} |
7 | 528 |
|
529 |
\large |
|
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
530 |
If \bl{$r$} matches the string \bl{$c\!::\!s$}, what is a regular expression that matches \bl{$s$}?\bigskip\bigskip\bigskip\bigskip |
7 | 531 |
|
532 |
\small |
|
117
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
533 |
\bl{$der\,c\,r$} gives the answer |
7 | 534 |
\end{frame}} |
535 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
536 |
||
537 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
538 |
\mode<presentation>{ |
|
539 |
\begin{frame}[c] |
|
19 | 540 |
\frametitle{\begin{tabular}{c}The Derivative of a Rexp (2)\end{tabular}} |
7 | 541 |
|
542 |
\begin{center} |
|
543 |
\begin{tabular}{@ {}l@ {\hspace{2mm}}c@ {\hspace{2mm}}l@ {\hspace{-10mm}}l@ {}} |
|
117
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
544 |
\bl{$der\, c\, (\varnothing)$} & \bl{$\dn$} & \bl{$\varnothing$} & \\ |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
545 |
\bl{$der\, c\, (\epsilon)$} & \bl{$\dn$} & \bl{$\varnothing$} & \\ |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
546 |
\bl{$der\, c\, (d)$} & \bl{$\dn$} & \bl{if $c = d$ then $\epsilon$ else $\varnothing$} & \\ |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
547 |
\bl{$der\, c\, (r_1 + r_2)$} & \bl{$\dn$} & \bl{$der\, c\, r_1 + der\, c\, r_2$} & \\ |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
548 |
\bl{$der\, c\, (r_1 \cdot r_2)$} & \bl{$\dn$} & \bl{if $nullable (r_1)$}\\ |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
549 |
& & \bl{then $(der\,c\,r_1) \cdot r_2 + der\, c\, r_2$}\\ |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
550 |
& & \bl{else $(der\, c\, r_1) \cdot r_2$}\\ |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
551 |
\bl{$der\, c\, (r^*)$} & \bl{$\dn$} & \bl{$(der\,c\,r) \cdot (r^*)$} &\smallskip\\\pause |
7 | 552 |
|
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
553 |
\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
|
554 |
\bl{$der\!s\, (c\!::\!s)\, r$} & \bl{$\dn$} & \bl{$der\!s\,s\,(der\,c\,r)$} & \\ |
7 | 555 |
\end{tabular} |
556 |
\end{center} |
|
557 |
||
117
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
558 |
\only<3->{ |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
559 |
\begin{textblock}{10.5}(2,5) |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
560 |
\begin{tikzpicture} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
561 |
\draw (0,0) node[inner sep=2mm,fill=cream, ultra thick, draw=red, rounded corners=2mm] |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
562 |
{\normalsize\color{darkgray} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
563 |
\begin{minipage}{10.5cm} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
564 |
\hspace{5mm}\mbox{{\lstset{language=Scala}\fontsize{8}{10}\selectfont |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
565 |
\texttt{\lstinputlisting{../progs/app6.scala}}}} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
566 |
\end{minipage}}; |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
567 |
\end{tikzpicture} |
25999de692b2
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
568 |
\end{textblock}} |
7 | 569 |
|
570 |
\end{frame}} |
|
571 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
572 |
||
573 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
574 |
\mode<presentation>{ |
|
575 |
\begin{frame}[c] |
|
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
576 |
\frametitle{\begin{tabular}{c}Examples\end{tabular}} |
7 | 577 |
|
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
578 |
Given \bl{$r \dn ((a \cdot b) + b)^*$} what is |
7 | 579 |
|
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
580 |
\begin{center} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
581 |
\begin{tabular}{l} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
582 |
\bl{$der\,a\,r$}\\ |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
583 |
\bl{$der\,b\,r$} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
584 |
\end{tabular} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
585 |
\end{center} |
7 | 586 |
|
587 |
||
588 |
\end{frame}} |
|
589 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
590 |
||
17 | 591 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
592 |
\mode<presentation>{ |
|
593 |
\begin{frame}[t] |
|
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
594 |
\frametitle{\begin{tabular}{c}\bl{$(a?\{n\}) \cdot a\{n\}$}\end{tabular}} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
595 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
596 |
\mbox{}\\[-13mm] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
597 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
598 |
\begin{tikzpicture}[y=.2cm, x=.3cm] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
599 |
%axis |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
600 |
\draw (0,0) -- coordinate (x axis mid) (30,0); |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
601 |
\draw (0,0) -- coordinate (y axis mid) (0,30); |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
602 |
%ticks |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
603 |
\foreach \x in {0,5,...,30} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
604 |
\draw (\x,1pt) -- (\x,-3pt) |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
605 |
node[anchor=north] {\x}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
606 |
\foreach \y in {0,5,...,30} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
607 |
\draw (1pt,\y) -- (-3pt,\y) |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
608 |
node[anchor=east] {\y}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
609 |
%labels |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
610 |
\node[below=0.6cm] at (x axis mid) {\bl{a}s}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
611 |
\node[rotate=90, left=1.2cm] at (y axis mid) {secs}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
612 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
613 |
%plots |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
614 |
\draw[color=blue] plot[mark=*, mark options={fill=white}] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
615 |
file {re-python.data}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
616 |
\draw[color=red] plot[mark=triangle*, mark options={fill=white} ] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
617 |
file {re1.data}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
618 |
\draw[color=brown] plot[mark=pentagon*, mark options={fill=white} ] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
619 |
file {re-ruby.data}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
620 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
621 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
622 |
%legend |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
623 |
\begin{scope}[shift={(4,20)}] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
624 |
\draw[color=blue] (0,0) -- |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
625 |
plot[mark=*, mark options={fill=white}] (0.25,0) -- (0.5,0) |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
626 |
node[right]{\small Python}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
627 |
\draw[yshift=-\baselineskip, color=brown] (0,0) -- |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
628 |
plot[mark=pentagon*, mark options={fill=white}] (0.25,0) -- (0.5,0) |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
629 |
node[right]{\small Ruby}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
630 |
\draw[yshift=\baselineskip, color=red] (0,0) -- |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
631 |
plot[mark=triangle*, mark options={fill=white}] (0.25,0) -- (0.5,0) |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
632 |
node[right]{\small Scala V1}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
633 |
\end{scope} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
634 |
\end{tikzpicture} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
635 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
636 |
\end{frame}} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
637 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
638 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
639 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
640 |
\mode<presentation>{ |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
641 |
\begin{frame}[t] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
642 |
\frametitle{\begin{tabular}{c}Proofs about Rexps\end{tabular}} |
17 | 643 |
|
644 |
Remember their inductive definition:\\[5cm] |
|
645 |
||
646 |
\begin{textblock}{6}(5,5) |
|
647 |
\begin{tabular}{@ {}rrl} |
|
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
648 |
\bl{$r$} & \bl{$::=$} & \bl{$\varnothing$}\\ |
17 | 649 |
& \bl{$\mid$} & \bl{$\epsilon$} \\ |
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
650 |
& \bl{$\mid$} & \bl{$c$} \\ |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
651 |
& \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
|
652 |
& \bl{$\mid$} & \bl{$r_1 + r_2$} \\ |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
653 |
& \bl{$\mid$} & \bl{$r^*$} \\ |
17 | 654 |
\end{tabular} |
655 |
\end{textblock} |
|
656 |
||
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
657 |
If we want to prove something, say a property \bl{$P(r)$}, for all regular expressions \bl{$r$} then \ldots |
17 | 658 |
|
659 |
\end{frame}} |
|
660 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
661 |
||
662 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
663 |
\mode<presentation>{ |
|
664 |
\begin{frame}[c] |
|
665 |
\frametitle{\begin{tabular}{c}Proofs about Rexp (2)\end{tabular}} |
|
666 |
||
667 |
\begin{itemize} |
|
668 |
\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
|
669 |
\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
|
670 |
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
|
671 |
\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
|
672 |
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
|
673 |
\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
|
674 |
holds for \bl{$r$}. |
17 | 675 |
\end{itemize} |
676 |
||
677 |
\end{frame}} |
|
678 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
679 |
||
680 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
681 |
\mode<presentation>{ |
|
682 |
\begin{frame}[c] |
|
683 |
\frametitle{\begin{tabular}{c}Proofs about Rexp (3)\end{tabular}} |
|
684 |
||
685 |
Assume \bl{$P(r)$} is the property: |
|
686 |
||
687 |
\begin{center} |
|
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
688 |
\bl{$nullable(r)$} if and only if \bl{$"" \in L(r)$} |
17 | 689 |
\end{center} |
690 |
||
691 |
\end{frame}} |
|
692 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
693 |
||
694 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
695 |
\mode<presentation>{ |
|
696 |
\begin{frame}[c] |
|
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
697 |
\frametitle{\begin{tabular}{c}Proofs about Rexp (4)\end{tabular}} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
698 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
699 |
Let \bl{$Der\,c\,A$} be the set defined as |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
700 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
701 |
\begin{center} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
702 |
\bl{$Der\,c\,A \dn \{ s \;|\; c\!::\!s \in A\}$ } |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
703 |
\end{center} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
704 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
705 |
We can prove |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
706 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
707 |
\begin{center} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
708 |
\bl{$L(der\,c\,r) = Der\,c\,(L(r))$} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
709 |
\end{center} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
710 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
711 |
by induction on \bl{$r$}. |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
712 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
713 |
\end{frame}} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
714 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
715 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
716 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
717 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
718 |
\mode<presentation>{ |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
719 |
\begin{frame}[c] |
17 | 720 |
\frametitle{\begin{tabular}{c}Proofs about Strings\end{tabular}} |
721 |
||
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
722 |
If we want to prove something, say a property \bl{$P(s)$}, for all strings \bl{$s$} then \ldots\bigskip |
17 | 723 |
|
724 |
\begin{itemize} |
|
725 |
\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
|
726 |
\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
|
727 |
already holds for \bl{$s$} |
17 | 728 |
\end{itemize} |
729 |
\end{frame}} |
|
730 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
731 |
||
19 | 732 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
733 |
\mode<presentation>{ |
|
734 |
\begin{frame}[c] |
|
735 |
\frametitle{\begin{tabular}{c}Proofs about Strings (2)\end{tabular}} |
|
736 |
||
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
737 |
We can finally prove |
19 | 738 |
|
739 |
\begin{center} |
|
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
740 |
\bl{$matcher(r, s)$} if and only if \bl{$s \in L(r)$} |
19 | 741 |
\end{center} |
742 |
||
743 |
||
744 |
\end{frame}} |
|
745 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
17 | 746 |
|
747 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
748 |
\mode<presentation>{ |
|
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
749 |
\begin{frame}[t] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
750 |
\frametitle{\begin{tabular}{c}\bl{$(a?\{n\}) \cdot a\{n\}$}\end{tabular}} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
751 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
752 |
\mbox{}\\[-13mm] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
753 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
754 |
\begin{tikzpicture}[y=.2cm, x=.3cm] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
755 |
%axis |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
756 |
\draw (0,0) -- coordinate (x axis mid) (30,0); |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
757 |
\draw (0,0) -- coordinate (y axis mid) (0,30); |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
758 |
%ticks |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
759 |
\foreach \x in {0,5,...,30} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
760 |
\draw (\x,1pt) -- (\x,-3pt) |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
761 |
node[anchor=north] {\x}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
762 |
\foreach \y in {0,5,...,30} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
763 |
\draw (1pt,\y) -- (-3pt,\y) |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
764 |
node[anchor=east] {\y}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
765 |
%labels |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
766 |
\node[below=0.6cm] at (x axis mid) {\bl{a}s}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
767 |
\node[rotate=90, left=1.2cm] at (y axis mid) {secs}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
768 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
769 |
%plots |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
770 |
\draw[color=blue] plot[mark=*, mark options={fill=white}] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
771 |
file {re-python.data}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
772 |
\draw[color=red] plot[mark=triangle*, mark options={fill=white} ] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
773 |
file {re1.data}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
774 |
\draw[color=brown] plot[mark=pentagon*, mark options={fill=white} ] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
775 |
file {re-ruby.data}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
776 |
|
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 |
%legend |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
779 |
\begin{scope}[shift={(4,20)}] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
780 |
\draw[color=blue] (0,0) -- |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
781 |
plot[mark=*, mark options={fill=white}] (0.25,0) -- (0.5,0) |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
782 |
node[right]{\small Python}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
783 |
\draw[yshift=-\baselineskip, color=brown] (0,0) -- |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
784 |
plot[mark=pentagon*, mark options={fill=white}] (0.25,0) -- (0.5,0) |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
785 |
node[right]{\small Ruby}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
786 |
\draw[yshift=\baselineskip, color=red] (0,0) -- |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
787 |
plot[mark=triangle*, mark options={fill=white}] (0.25,0) -- (0.5,0) |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
788 |
node[right]{\small Scala V1}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
789 |
\end{scope} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
790 |
\end{tikzpicture} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
791 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
792 |
\end{frame}} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
793 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
794 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
795 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
796 |
\mode<presentation>{ |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
797 |
\begin{frame}[c] |
120
3e71efb25ce9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
119
diff
changeset
|
798 |
\frametitle{\begin{tabular}{c}A Problem\end{tabular}} |
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
799 |
|
120
3e71efb25ce9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
119
diff
changeset
|
800 |
We represented the ``n-times'' \bl{$a\{n\}$} as a sequence regular expression: |
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
801 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
802 |
\begin{center} |
120
3e71efb25ce9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
119
diff
changeset
|
803 |
\begin{tabular}{rl} |
3e71efb25ce9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
119
diff
changeset
|
804 |
1: & \bl{$a$}\\ |
3e71efb25ce9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
119
diff
changeset
|
805 |
2: & \bl{$a\cdot a$}\\ |
3e71efb25ce9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
119
diff
changeset
|
806 |
3: & \bl{$a\cdot a\cdot a$}\\ |
3e71efb25ce9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
119
diff
changeset
|
807 |
& \ldots\\ |
3e71efb25ce9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
119
diff
changeset
|
808 |
13: & \bl{$a\cdot a\cdot a\cdot a\cdot a\cdot a\cdot a\cdot a\cdot a\cdot a\cdot a\cdot a\cdot a$}\\ |
3e71efb25ce9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
119
diff
changeset
|
809 |
& \ldots\\ |
3e71efb25ce9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
119
diff
changeset
|
810 |
20: |
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
811 |
\end{tabular} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
812 |
\end{center} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
813 |
|
120
3e71efb25ce9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
119
diff
changeset
|
814 |
This problem is aggravated with \bl{$a?$} being represented as \bl{$\epsilon + a$}. |
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
815 |
\end{frame}} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
816 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
817 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
818 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
819 |
\mode<presentation>{ |
120
3e71efb25ce9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
119
diff
changeset
|
820 |
\begin{frame}[c] |
3e71efb25ce9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
119
diff
changeset
|
821 |
\frametitle{\begin{tabular}{c}Solving the Problem\end{tabular}} |
3e71efb25ce9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
119
diff
changeset
|
822 |
|
3e71efb25ce9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
119
diff
changeset
|
823 |
What happens if we extend our regular expressions |
3e71efb25ce9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
119
diff
changeset
|
824 |
|
3e71efb25ce9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
119
diff
changeset
|
825 |
\begin{center} |
3e71efb25ce9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
119
diff
changeset
|
826 |
\begin{tabular}{rcl} |
3e71efb25ce9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
119
diff
changeset
|
827 |
\bl{$r$} & \bl{$::=$} & \bl{\ldots}\\ |
3e71efb25ce9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
119
diff
changeset
|
828 |
& \bl{$\mid$} & \bl{$r\{n\}$}\\ |
3e71efb25ce9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
119
diff
changeset
|
829 |
& \bl{$\mid$} & \bl{$r?$} |
3e71efb25ce9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
119
diff
changeset
|
830 |
\end{tabular} |
3e71efb25ce9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
119
diff
changeset
|
831 |
\end{center} |
3e71efb25ce9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
119
diff
changeset
|
832 |
|
3e71efb25ce9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
119
diff
changeset
|
833 |
What is their meaning? What are the cases for \bl{$nullable$} and \bl{$der$}? |
3e71efb25ce9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
119
diff
changeset
|
834 |
\end{frame}} |
3e71efb25ce9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
119
diff
changeset
|
835 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
3e71efb25ce9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
119
diff
changeset
|
836 |
|
3e71efb25ce9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
119
diff
changeset
|
837 |
|
3e71efb25ce9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
119
diff
changeset
|
838 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
3e71efb25ce9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
119
diff
changeset
|
839 |
\mode<presentation>{ |
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
840 |
\begin{frame}[t] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
841 |
\frametitle{\begin{tabular}{c}\bl{$(a?\{n\}) \cdot a\{n\}$}\end{tabular}} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
842 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
843 |
\mbox{}\\[-13mm] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
844 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
845 |
\begin{tikzpicture}[y=.2cm, x=.12cm] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
846 |
%axis |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
847 |
\draw (0,0) -- coordinate (x axis mid) (70,0); |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
848 |
\draw (0,0) -- coordinate (y axis mid) (0,30); |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
849 |
%ticks |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
850 |
\foreach \x in {0,10,...,70} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
851 |
\draw (\x,1pt) -- (\x,-3pt) |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
852 |
node[anchor=north] {\x}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
853 |
\foreach \y in {0,5,...,30} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
854 |
\draw (1pt,\y) -- (-3pt,\y) |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
855 |
node[anchor=east] {\y}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
856 |
%labels |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
857 |
\node[below=0.6cm] at (x axis mid) {\bl{a}s}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
858 |
\node[rotate=90, left=1.2cm] at (y axis mid) {secs}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
859 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
860 |
%plots |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
861 |
\draw[color=blue] plot[mark=*, mark options={fill=white}] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
862 |
file {re-python.data}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
863 |
\draw[color=red] plot[mark=triangle*, mark options={fill=white} ] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
864 |
file {re1.data}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
865 |
\draw[color=green] plot[mark=square*, mark options={fill=white} ] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
866 |
file {re2a.data}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
867 |
\draw[color=brown] plot[mark=pentagon*, mark options={fill=white} ] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
868 |
file {re-ruby.data}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
869 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
870 |
%legend |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
871 |
\begin{scope}[shift={(4,20)}] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
872 |
\draw[color=blue] (0,0) -- |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
873 |
plot[mark=*, mark options={fill=white}] (0.25,0) -- (0.5,0) |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
874 |
node[right]{\small Python}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
875 |
\draw[yshift=-\baselineskip, color=brown] (0,0) -- |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
876 |
plot[mark=pentagon*, mark options={fill=white}] (0.25,0) -- (0.5,0) |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
877 |
node[right]{\small Ruby}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
878 |
\draw[yshift=\baselineskip, color=red] (0,0) -- |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
879 |
plot[mark=triangle*, mark options={fill=white}] (0.25,0) -- (0.5,0) |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
880 |
node[right]{\small Scala V1}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
881 |
\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
|
882 |
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
|
883 |
node[right]{\small Scala V2}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
884 |
\end{scope} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
885 |
\end{tikzpicture} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
886 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
887 |
\end{frame}} |
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>{ |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
892 |
\begin{frame}[t] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
893 |
\frametitle{\begin{tabular}{c}\bl{$(a?\{n\}) \cdot a\{n\}$}\end{tabular}} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
894 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
895 |
\mbox{}\\[-13mm] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
896 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
897 |
\begin{tabular}{@ {\hspace{-5mm}}l} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
898 |
\begin{tikzpicture}[y=.2cm, x=.01cm] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
899 |
%axis |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
900 |
\draw (0,0) -- coordinate (x axis mid) (1000,0); |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
901 |
\draw (0,0) -- coordinate (y axis mid) (0,30); |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
902 |
%ticks |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
903 |
\foreach \x in {0,100,...,1000} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
904 |
\draw (\x,1pt) -- (\x,-3pt) |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
905 |
node[anchor=north] {\x}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
906 |
\foreach \y in {0,5,...,30} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
907 |
\draw (1pt,\y) -- (-3pt,\y) |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
908 |
node[anchor=east] {\y}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
909 |
%labels |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
910 |
\node[below=0.6cm] at (x axis mid) {\bl{a}s}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
911 |
\node[rotate=90, left=1.2cm] at (y axis mid) {secs}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
912 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
913 |
%plots |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
914 |
\draw[color=blue] plot[mark=*, mark options={fill=white}] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
915 |
file {re-python.data}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
916 |
\draw[color=red] plot[mark=triangle*, mark options={fill=white} ] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
917 |
file {re1.data}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
918 |
\draw[color=green] plot[mark=square*, mark options={fill=white} ] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
919 |
file {re2b.data}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
920 |
\draw[color=brown] plot[mark=pentagon*, mark options={fill=white} ] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
921 |
file {re-ruby.data}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
922 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
923 |
%legend |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
924 |
\begin{scope}[shift={(100,20)}] |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
925 |
\draw[color=blue] (0,0) -- |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
926 |
plot[mark=*, mark options={fill=white}] (0.25,0) -- (50,0) |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
927 |
node[right]{\small Python}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
928 |
\draw[yshift=-13, color=brown] (0,0) -- |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
929 |
plot[mark=pentagon*, mark options={fill=white}] (0.25,0) -- (50,0) |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
930 |
node[right]{\small Ruby}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
931 |
\draw[yshift=13, color=red] (0,0) -- |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
932 |
plot[mark=triangle*, mark options={fill=white}] (0.25,0) -- (50,0) |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
933 |
node[right]{\small Scala V1}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
934 |
\draw[yshift=26, color=green] (0,0) -- |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
935 |
plot[mark=square*, mark options={fill=white}] (0.25,0) -- (50,0) |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
936 |
node[right]{\small Scala V2}; |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
937 |
\end{scope} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
938 |
\end{tikzpicture} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
939 |
\end{tabular} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
940 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
941 |
\end{frame}} |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
942 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
943 |
|
121
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
944 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
945 |
\mode<presentation>{ |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
946 |
\begin{frame}[c] |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
947 |
\frametitle{\begin{tabular}{c}Examples\end{tabular}} |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
948 |
|
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
949 |
Recall the example of \bl{$r \dn ((a \cdot b) + b)^*$} with |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
950 |
|
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
951 |
\begin{center} |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
952 |
\begin{tabular}{l} |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
953 |
\bl{$der\,a\,r = ((\epsilon \cdot b) + \varnothing) \cdot r$}\\ |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
954 |
\bl{$der\,b\,r = ((\varnothing \cdot b) + \epsilon)\cdot r$} |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
955 |
\end{tabular} |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
956 |
\end{center} |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
957 |
|
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
958 |
What are these regular expressions equal to? |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
959 |
|
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
960 |
\end{frame}} |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
961 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
962 |
|
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
963 |
|
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
964 |
|
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
965 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
966 |
\mode<presentation>{ |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
967 |
\begin{frame}[t] |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
968 |
\frametitle{\begin{tabular}{c}\bl{$(a?\{n\}) \cdot a\{n\}$}\end{tabular}} |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
969 |
|
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
970 |
\mbox{}\\[-9mm] |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
971 |
|
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
972 |
\begin{tabular}{@ {\hspace{-5mm}}l} |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
973 |
\begin{tikzpicture}[y=.2cm, x=.0008cm] |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
974 |
%axis |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
975 |
\draw (0,0) -- coordinate (x axis mid) (12000,0); |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
976 |
\draw (0,0) -- coordinate (y axis mid) (0,30); |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
977 |
%ticks |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
978 |
\foreach \x in {0,2000,...,12000} |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
979 |
\draw (\x,1pt) -- (\x,-3pt) |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
980 |
node[anchor=north] {\x}; |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
981 |
\foreach \y in {0,5,...,30} |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
982 |
\draw (1pt,\y) -- (-3pt,\y) |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
983 |
node[anchor=east] {\y}; |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
984 |
%labels |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
985 |
\node[below=0.6cm] at (x axis mid) {\bl{a}s}; |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
986 |
\node[rotate=90, left=1.2cm] at (y axis mid) {secs}; |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
987 |
|
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
988 |
%plots |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
989 |
\draw[color=red] plot[mark=triangle*, mark options={fill=white} ] |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
990 |
file {re1.data}; |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
991 |
\draw[color=green] plot[mark=square*, mark options={fill=white} ] |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
992 |
file {re2b.data}; |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
993 |
\draw[color=black] plot[mark=square*, mark options={fill=white} ] |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
994 |
file {re3.data}; |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
995 |
|
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
996 |
%legend |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
997 |
\begin{scope}[shift={(2000,20)}] |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
998 |
\draw[color=red] (0,0) -- |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
999 |
plot[mark=triangle*, mark options={fill=white}] (0.25,0) -- (50,0) |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
1000 |
node[right]{\small Scala V1}; |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
1001 |
\draw[yshift=13, color=green] (0,0) -- |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
1002 |
plot[mark=square*, mark options={fill=white}] (0.25,0) -- (50,0) |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
1003 |
node[right]{\small Scala V2}; |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
1004 |
\draw[yshift=26, color=black] (0,0) -- |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
1005 |
plot[mark=square*, mark options={fill=white}] (0.25,0) -- (50,0) |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
1006 |
node[right]{\small Scala V3}; |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
1007 |
\end{scope} |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
1008 |
\end{tikzpicture} |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
1009 |
\end{tabular} |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
1010 |
|
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
1011 |
\end{frame}} |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
1012 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
1013 |
|
122
4123344e6915
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
1014 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
4123344e6915
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
1015 |
\mode<presentation>{ |
4123344e6915
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
1016 |
\begin{frame}[c] |
4123344e6915
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
1017 |
\frametitle{\begin{tabular}{c}Regular Expressions\end{tabular}} |
4123344e6915
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
1018 |
|
4123344e6915
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
1019 |
\begin{itemize} |
4123344e6915
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
1020 |
\item symbols, digits |
4123344e6915
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
1021 |
\item identifiers |
4123344e6915
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
1022 |
\item numbers (non-leading zeros) |
4123344e6915
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
1023 |
\item keywords |
4123344e6915
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
1024 |
\item comments |
4123344e6915
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
1025 |
\end{itemize}\bigskip |
4123344e6915
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
1026 |
|
4123344e6915
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
1027 |
|
4123344e6915
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
1028 |
\mbox{}\hfill\bl{\url{http://www.regexper.com}} |
4123344e6915
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
1029 |
\end{frame}} |
4123344e6915
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
1030 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
4123344e6915
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
1031 |
|
4123344e6915
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
121
diff
changeset
|
1032 |
|
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
1033 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
1034 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
1035 |
\mode<presentation>{ |
17 | 1036 |
\begin{frame}[c] |
1037 |
\frametitle{\begin{tabular}{c}Regular Languages\end{tabular}} |
|
1038 |
||
121
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
1039 |
A language (a set of strings) is \alert{regular} iff there exists |
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
1040 |
a regular expression that recognises all its strings.\bigskip\bigskip\pause |
17 | 1041 |
|
121
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
1042 |
|
43c116860e47
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
120
diff
changeset
|
1043 |
Do you think there are languages that are {\bf not} regular? |
17 | 1044 |
\end{frame}} |
1045 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
1046 |
||
1047 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
1048 |
\mode<presentation>{ |
|
1049 |
\begin{frame}[c] |
|
1050 |
\frametitle{\begin{tabular}{c}Automata\end{tabular}} |
|
1051 |
||
1052 |
A deterministic finite automaton consists of: |
|
1053 |
||
1054 |
\begin{itemize} |
|
1055 |
\item a set of states |
|
1056 |
\item one of these states is the start state |
|
1057 |
\item some states are accepting states, and |
|
1058 |
\item there is transition function\medskip |
|
1059 |
||
1060 |
\small |
|
1061 |
which takes a state as argument and a character and produces a new state\smallskip\\ |
|
1062 |
this function might not always be defined |
|
1063 |
\end{itemize} |
|
1064 |
||
1065 |
\end{frame}} |
|
1066 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
1067 |
||
7 | 1068 |
|
119
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
1069 |
|
a6684e8961d0
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
118
diff
changeset
|
1070 |
|
7 | 1071 |
\end{document} |
1072 |
||
1073 |
%%% Local Variables: |
|
1074 |
%%% mode: latex |
|
1075 |
%%% TeX-master: t |
|
1076 |
%%% End: |
|
1077 |