author | Christian Urban <christian dot urban at kcl dot ac dot uk> |
Sun, 21 Sep 2014 23:23:43 +0100 | |
changeset 254 | dcd4688690ce |
parent 253 | 75c469893514 |
child 255 | 96a99237fa42 |
permissions | -rw-r--r-- |
95
dbe49327b6c5
added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
1 |
\documentclass[dvipsnames,14pt,t,xelatex]{beamer} |
252
e8ef8f38ca84
added style files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
215
diff
changeset
|
2 |
\usepackage{../slides} |
e8ef8f38ca84
added style files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
215
diff
changeset
|
3 |
\usepackage{../graphics} |
215
828303e8e4af
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
98
diff
changeset
|
4 |
\usepackage{../langs} |
828303e8e4af
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
98
diff
changeset
|
5 |
\usepackage{../data} |
0 | 6 |
|
252
e8ef8f38ca84
added style files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
215
diff
changeset
|
7 |
\hfuzz=220pt |
e8ef8f38ca84
added style files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
215
diff
changeset
|
8 |
|
254
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
9 |
%\setmonofont[Scale=.88]{Consolas} |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
10 |
%\newfontfamily{\consolas}{Consolas} |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
11 |
|
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
12 |
\lstset{language=Scala, |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
13 |
style=mystyle, |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
14 |
numbersep=0pt, |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
15 |
numbers=none, |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
16 |
xleftmargin=0mm} |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
17 |
|
253
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
18 |
\newcommand{\bl}[1]{\textcolor{blue}{#1}} |
95
dbe49327b6c5
added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
19 |
|
0 | 20 |
% beamer stuff |
252
e8ef8f38ca84
added style files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
215
diff
changeset
|
21 |
\renewcommand{\slidecaption}{AFL 01, King's College London} |
0 | 22 |
|
23 |
||
24 |
\begin{document} |
|
25 |
||
26 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
253
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
27 |
\begin{frame}[t] |
0 | 28 |
\frametitle{% |
29 |
\begin{tabular}{@ {}c@ {}} |
|
1 | 30 |
\\[-3mm] |
31 |
\LARGE Automata and \\[-2mm] |
|
32 |
\LARGE Formal Languages (1)\\[-3mm] |
|
0 | 33 |
\end{tabular}} |
34 |
||
35 |
\begin{center} |
|
1 | 36 |
\includegraphics[scale=0.3]{pics/ante1.jpg}\hspace{5mm} |
37 |
\includegraphics[scale=0.31]{pics/ante2.jpg}\\ |
|
38 |
\footnotesize\textcolor{gray}{Antikythera automaton, 100 BC (Archimedes?)} |
|
0 | 39 |
\end{center} |
40 |
||
41 |
\normalsize |
|
42 |
\begin{center} |
|
43 |
\begin{tabular}{ll} |
|
44 |
Email: & christian.urban at kcl.ac.uk\\ |
|
95
dbe49327b6c5
added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
45 |
Office: & S1.27 (1st floor Strand Building)\\ |
0 | 46 |
Slides: & KEATS |
47 |
\end{tabular} |
|
48 |
\end{center} |
|
49 |
||
50 |
||
253
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
51 |
\end{frame} |
0 | 52 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
53 |
||
54 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
55 |
\begin{frame}[c] |
|
56 |
||
1 | 57 |
\begin{textblock}{1}(2,5) |
0 | 58 |
\begin{tabular}{c} |
1 | 59 |
\includegraphics[scale=0.15]{pics/servers.png}\\[-2mm] |
60 |
\small Server |
|
0 | 61 |
\end{tabular} |
62 |
\end{textblock} |
|
63 |
||
1 | 64 |
\begin{textblock}{1}(5.6,4) |
65 |
\begin{tikzpicture}[scale=1.1] |
|
66 |
\draw[white] (0,1) node (X) {}; |
|
67 |
\draw[white] (2,1) node (Y) {}; |
|
68 |
\draw[white] (0,0) node (X1) {}; |
|
69 |
\draw[white] (2,0) node (Y1) {}; |
|
70 |
\draw[white] (0,-1) node (X2) {}; |
|
71 |
\draw[white] (2,-1) node (Y2) {}; |
|
72 |
\draw[red, <-, line width = 2mm] (X) -- (Y); |
|
73 |
\node [inner sep=5pt,label=above:\textcolor{black}{GET request}] at ($ (X)!.5!(Y) $) {}; |
|
74 |
\draw[red, ->, line width = 2mm] (X1) -- (Y1); |
|
75 |
\node [inner sep=5pt,label=above:\textcolor{black}{webpage}] at ($ (X1)!.5!(Y1) $) {}; |
|
76 |
\draw[red, <-, line width = 2mm] (X2) -- (Y2); |
|
77 |
\node [inner sep=7pt,label=above:\textcolor{black}{POST data}] at ($ (X2)!.5!(Y2) $) {}; |
|
0 | 78 |
\end{tikzpicture} |
79 |
\end{textblock} |
|
80 |
||
81 |
||
1 | 82 |
\begin{textblock}{1}(9,5.5) |
0 | 83 |
\begin{tabular}{c} |
1 | 84 |
\includegraphics[scale=0.15]{pics/laptop.png}\\[-2mm] |
85 |
\small Browser |
|
0 | 86 |
\end{tabular} |
87 |
\end{textblock} |
|
88 |
||
1 | 89 |
\only<2>{ |
90 |
\begin{textblock}{10}(2,13.5) |
|
0 | 91 |
\begin{itemize} |
1 | 92 |
\item programming languages, compilers |
0 | 93 |
\end{itemize} |
1 | 94 |
\end{textblock}} |
0 | 95 |
|
253
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
96 |
\end{frame} |
0 | 97 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
98 |
||
99 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
100 |
\begin{frame}[c] |
|
1 | 101 |
|
102 |
transforming strings into structured data\\[10mm] |
|
0 | 103 |
|
1 | 104 |
{\LARGE\bf Lexing}\medskip\\ |
105 |
\hspace{5mm}(recognising ``words'')\\[6mm] |
|
0 | 106 |
|
1 | 107 |
{\LARGE\bf Parsing}\medskip\\ |
108 |
\hspace{5mm}(recognising ``sentences'') |
|
109 |
||
253
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
110 |
\end{frame} |
1 | 111 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
112 |
||
0 | 113 |
|
114 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
115 |
\begin{frame}[c] |
|
116 |
||
1 | 117 |
The subject is quite old: |
0 | 118 |
|
119 |
\begin{itemize} |
|
1 | 120 |
\item Turing Machines, 1936 |
121 |
\item first compiler for COBOL, 1957 (Grace Hopper) |
|
122 |
\item but surprisingly research papers are still published now |
|
0 | 123 |
\end{itemize} |
124 |
||
1 | 125 |
\begin{flushright} |
126 |
\includegraphics[scale=0.3]{pics/hopper.jpg}\\ |
|
127 |
\footnotesize\textcolor{gray}{Grace Hopper} |
|
128 |
\end{flushright} |
|
129 |
||
130 |
{\footnotesize\textcolor{gray}{(she made it to David Letterman's Tonight Show, \url{http://www.youtube.com/watch?v=aZOxtURhfEU})}} |
|
0 | 131 |
|
253
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
132 |
\end{frame} |
1 | 133 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
134 |
||
135 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
136 |
\mode<presentation>{ |
|
137 |
\begin{frame}[c] |
|
138 |
\frametitle{\begin{tabular}{c}This Course\end{tabular}} |
|
0 | 139 |
|
1 | 140 |
\begin{itemize} |
97
60a3ba90dd53
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
95
diff
changeset
|
141 |
\item the ultimate goal is to implement a small compiler (a really small one for the JVM)\bigskip |
1 | 142 |
\end{itemize} |
143 |
||
144 |
Let's start with: |
|
145 |
||
146 |
\begin{itemize} |
|
147 |
\item a web-crawler |
|
148 |
\item an email harvester |
|
149 |
\item a web-scraper |
|
150 |
\end{itemize} |
|
151 |
||
98
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
152 |
\begin{textblock}{6}(10,7) |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
153 |
\begin{tikzpicture}[scale=0.38] |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
154 |
\begin{axis}[axis x line=bottom, axis y line=left, ylabel=secs, |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
155 |
xlabel=n, |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
156 |
enlargelimits=0.05, |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
157 |
ybar interval=0.7, legend style=small] |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
158 |
\addplot file {interpreted2.data}; |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
159 |
\addplot file {compiled2.data}; |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
160 |
%\legend{interpreted, compiled} |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
161 |
\end{axis} |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
162 |
\end{tikzpicture} |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
163 |
\end{textblock} |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
164 |
|
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
165 |
|
1 | 166 |
\end{frame}} |
167 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
0 | 168 |
|
2 | 169 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
3 | 170 |
\begin{frame}[t] |
253
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
171 |
\frametitle{A Web-Crawler} |
2 | 172 |
|
3 | 173 |
\mbox{}\\[10mm] |
174 |
||
2 | 175 |
\begin{enumerate} |
176 |
\item given an URL, read the corresponding webpage |
|
177 |
\item extract all links from it |
|
178 |
\item call the web-crawler again for all these links |
|
179 |
\end{enumerate} |
|
180 |
||
253
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
181 |
\end{frame} |
2 | 182 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
183 |
||
184 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
185 |
\mode<presentation>{ |
|
3 | 186 |
\begin{frame}[t] |
253
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
187 |
\frametitle{A Web-Crawler} |
2 | 188 |
|
3 | 189 |
\mbox{}\\[10mm] |
190 |
||
191 |
||
2 | 192 |
\begin{enumerate} |
193 |
\item given an URL, read the corresponding webpage |
|
194 |
\item if not possible print, out a problem |
|
195 |
\item if possible, extract all links from it |
|
196 |
\item call the web-crawler again for all these links |
|
197 |
\end{enumerate}\bigskip\pause |
|
198 |
||
3 | 199 |
\small (we need a bound for the number of recursive calls) |
2 | 200 |
|
201 |
\small (the purpose is to check all links on my own webpage) |
|
202 |
\end{frame}} |
|
203 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
204 |
||
0 | 205 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
206 |
\begin{frame}[c] |
|
253
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
207 |
\frametitle{Scala} |
1 | 208 |
|
254
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
209 |
\small A simple Scala function for reading webpages: |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
210 |
\smallskip |
0 | 211 |
|
98
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
212 |
\footnotesize |
254
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
213 |
\lstinputlisting{../progs/app0.scala} |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
214 |
\medskip\pause |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
215 |
|
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
216 |
\lstinline{get_page("""http://www.inf.kcl.ac.uk/staff/urbanc/""")} |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
217 |
\bigskip\medskip\pause |
0 | 218 |
|
3 | 219 |
|
254
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
220 |
\small A slightly more complicated version for handling errors properly: |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
221 |
\smallskip |
2 | 222 |
|
98
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
223 |
\footnotesize |
253
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
224 |
\lstinputlisting{../progs/app1.scala} |
1 | 225 |
|
0 | 226 |
|
253
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
227 |
\end{frame} |
0 | 228 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
229 |
||
230 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
98
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
231 |
\begin{frame}[c] |
253
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
232 |
\frametitle{Why Scala?} |
98
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
233 |
|
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
234 |
\begin{textblock}{6}(1,3) |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
235 |
\begin{tabular}{l} |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
236 |
\mbox{}\hspace{-1mm}\includegraphics[scale=0.36]{pics/twitter.png}\\[-1mm] |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
237 |
\includegraphics[scale=0.30]{pics/linked.png}\\ |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
238 |
\includegraphics[scale=0.30]{pics/guardian.jpg}\\[-3mm] |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
239 |
\mbox{}\hspace{-2mm}\includegraphics[scale=0.38]{pics/morgan.png}\\[-3mm] |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
240 |
\includegraphics[scale=0.30]{pics/suisse.png}\\ |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
241 |
\includegraphics[scale=0.20]{pics/edf.png}\\[-1mm] |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
242 |
\includegraphics[scale=0.08]{pics/novell.png}\\[-1mm] |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
243 |
\includegraphics[scale=0.30]{pics/foursquare.png}\\ |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
244 |
\includegraphics[scale=0.30]{pics/hsbc.png}\\ |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
245 |
{\large\bf ...} |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
246 |
\end{tabular} |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
247 |
\end{textblock} |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
248 |
|
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
249 |
\only<2->{ |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
250 |
\begin{textblock}{6}(6,3) |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
251 |
\includegraphics[scale=0.35]{pics/jobgraph.png}\\ |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
252 |
\end{textblock}} |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
253 |
|
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
254 |
\only<3->{ |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
255 |
\begin{textblock}{6}(7.3,9.2) |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
256 |
\begin{tabular}{l} |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
257 |
\footnotesize 2013: 1$\%$\\[-2mm] |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
258 |
\footnotesize 2014: 3$\%$\\[-2mm] |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
259 |
\footnotesize 2015: 9$\%$\\[-2mm] |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
260 |
\footnotesize 2016: 27$\%$\\[-2mm] |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
261 |
\footnotesize 2017: 81$\%$\\[-2mm] |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
262 |
\footnotesize 2018: 243$\%$ \raisebox{-1mm}{\includegraphics[scale=0.02]{pics/smiley.jpg}} |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
263 |
\end{tabular} |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
264 |
\end{textblock}} |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
265 |
|
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
266 |
\only<3->{ |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
267 |
\begin{textblock}{6}(6,9.5) |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
268 |
\footnotesize 5 yrs $\begin{cases}\mbox{}\\[1.4cm]\end{cases}$ |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
269 |
\end{textblock}} |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
270 |
|
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
271 |
\only<4->{ |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
272 |
\begin{textblock}{11}(5,14.1) |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
273 |
\textcolor{gray}{ |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
274 |
\footnotesize {\bf in London today:} 1 Scala job for every 30 Java jobs;\\[-2mm] |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
275 |
Scala programmers seem to get up to 20\% better salary} |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
276 |
\end{textblock}} |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
277 |
|
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
278 |
|
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
279 |
\only<5->{ |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
280 |
\begin{textblock}{1}(3,6) |
253
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
281 |
\begin{bubble}[8.5cm] |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
282 |
\normalsize |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
283 |
Scala is a functional and object-oriented programming |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
284 |
language; compiles to the JVM; does not need null-pointer |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
285 |
exceptions; a course on Coursera\\ |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
286 |
\mbox{}\hfill\url{http://www.scala-lang.org} |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
287 |
\end{bubble} |
98
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
288 |
\end{textblock}} |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
289 |
|
253
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
290 |
\end{frame} |
98
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
291 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
292 |
|
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
293 |
|
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
294 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
3 | 295 |
\begin{frame}[t] |
253
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
296 |
\frametitle{A Regular Expression} |
3 | 297 |
|
298 |
\begin{itemize} |
|
299 |
\item \ldots{} is a pattern or template for specifying strings |
|
300 |
\end{itemize}\bigskip |
|
301 |
||
302 |
\begin{center} |
|
254
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
303 |
\only<1>{\scode{"https?://[^"]*"}}% |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
304 |
\only<2>{\scode{""""https?://[^"]*"""".r}} |
3 | 305 |
\end{center}\bigskip\bigskip |
306 |
||
254
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
307 |
matches for example\smallskip\\ |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
308 |
\hspace{2mm}\code{"http://www.foobar.com"}\\ |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
309 |
\hspace{2mm}\code{"https://www.tls.org"}\\ |
3 | 310 |
|
253
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
311 |
\end{frame} |
3 | 312 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
313 |
||
314 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
254
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
315 |
\begin{frame}[t] |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
316 |
\frametitle{Finding Operations} |
0 | 317 |
|
254
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
318 |
{\bf\code{rexp.findAllIn(string)}}\medskip |
3 | 319 |
|
253
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
320 |
returns a list of all (sub)strings that match the |
254
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
321 |
regular expression |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
322 |
\bigskip\bigskip |
0 | 323 |
|
254
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
324 |
|
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
325 |
{\bf\code{rexp.findFirstIn(string)}}\medskip |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
326 |
|
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
327 |
returns either |
0 | 328 |
|
254
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
329 |
\begin{itemize} |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
330 |
\item \code{None} if no (sub)string matches or |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
331 |
\item \code{Some(s)} with the first (sub)string |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
332 |
\end{itemize} |
0 | 333 |
|
253
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
334 |
\end{frame} |
0 | 335 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
336 |
||
337 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
3 | 338 |
\begin{frame}[c] |
0 | 339 |
|
3 | 340 |
\footnotesize |
254
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
341 |
\lstinputlisting{../progs/app2.scala} |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
342 |
|
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
343 |
\end{frame} |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
344 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
0 | 345 |
|
254
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
346 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
347 |
\begin{frame}[c] |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
348 |
|
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
349 |
\small |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
350 |
A version that only crawls links in ``my'' domain: |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
351 |
|
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
352 |
\footnotesize |
253
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
353 |
\lstinputlisting{../progs/app3.scala} |
0 | 354 |
|
253
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
355 |
\end{frame} |
0 | 356 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
357 |
||
358 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
359 |
\begin{frame}[c] |
|
254
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
360 |
\lstset{xleftmargin=-4mm} |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
361 |
\small |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
362 |
A little email harvester: |
3 | 363 |
|
253
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
364 |
\footnotesize |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
365 |
\lstinputlisting{../progs/app4.scala}\bigskip |
3 | 366 |
|
367 |
\tiny |
|
253
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
368 |
\url{http://net.tutsplus.com/tutorials/other/8-regular-expressions-you-should-know/} |
3 | 369 |
|
253
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
370 |
\end{frame} |
3 | 371 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
372 |
||
373 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
14 | 374 |
\begin{frame}[t] |
3 | 375 |
\frametitle{\begin{tabular}{c}Regular Expressions\end{tabular}} |
0 | 376 |
|
14 | 377 |
Their inductive definition:\medskip |
378 |
||
379 |
\begin{textblock}{6}(2,5) |
|
254
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
380 |
\begin{tabular}{rrl@ {\hspace{13mm}}l} |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
381 |
\bl{$r$} & \bl{$::=$} & \bl{$\varnothing$} & null\\ |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
382 |
& \bl{$\mid$} & \bl{$\epsilon$} & empty string / \pcode{""} / \pcode{[]}\\ |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
383 |
& \bl{$\mid$} & \bl{$c$} & character\\ |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
384 |
& \bl{$\mid$} & \bl{$r_1 \cdot r_2$} & sequence\\ |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
385 |
& \bl{$\mid$} & \bl{$r_1 + r_2$} & alternative / choice\\ |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
386 |
& \bl{$\mid$} & \bl{$r^*$} & star (zero or more)\\ |
3 | 387 |
\end{tabular} |
388 |
\end{textblock} |
|
389 |
||
254
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
390 |
\end{frame} |
3 | 391 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
392 |
||
393 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
394 |
\begin{frame}[t] |
|
253
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
395 |
\frametitle{Regular Expressions} |
3 | 396 |
|
14 | 397 |
\small |
254
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
398 |
In Scala:\bigskip |
14 | 399 |
|
253
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
400 |
\footnotesize |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
401 |
\lstinputlisting{../progs/app51.scala} |
0 | 402 |
|
403 |
||
253
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
404 |
\end{frame} |
0 | 405 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
406 |
||
407 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
408 |
\mode<presentation>{ |
|
409 |
\begin{frame}[c] |
|
253
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
410 |
\frametitle{\begin{tabular}{c}The Meaning of a\\[-2mm] |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
411 |
Regular Expression\end{tabular}} |
0 | 412 |
|
4 | 413 |
\begin{textblock}{15}(1,4) |
254
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
414 |
\begin{tabular}{rcl} |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
415 |
\bl{$L(\varnothing)$} & \bl{$\dn$} & \bl{$\varnothing$}\\ |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
416 |
\bl{$L(\epsilon)$} & \bl{$\dn$} & \bl{$\{[]\}$}\\ |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
417 |
\bl{$L(c)$} & \bl{$\dn$} & \bl{$\{[c]\}$}\\ |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
418 |
\bl{$L(r_1 + r_2)$} & \bl{$\dn$} & \bl{$L(r_1) \cup L(r_2)$}\\ |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
419 |
\bl{$L(r_1 \cdot r_2)$} & \bl{$\dn$} & \bl{$\{ s_1 \,@\, s_2 \;|\; s_1 \in L(r_1) \wedge s_2 \in L(r_2) \}$}\\ |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
420 |
\bl{$L(r^*)$} & \bl{$\dn$} & \onslide<4->{\bl{$\bigcup_{n \ge 0} L(r)^n$}}\\ |
4 | 421 |
\end{tabular}\bigskip |
3 | 422 |
|
4 | 423 |
\onslide<2->{ |
254
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
424 |
\hspace{5mm}\bl{$L(r)^0 \;\dn\; \{[]\}$}\\ |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
425 |
\bl{$L(r)^{n+1} \;\dn\; L(r) \,@\, L(r)^n$}\hspace{9mm}\onslide<3->{\small\textcolor{gray}{(append on sets)}\\ |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
426 |
\small\hspace{5cm}\textcolor{gray}{$\{ s_1 @ s_2 \;|\; s_1\in L(r) \wedge s_2 \in L(r)^n \}$}} |
4 | 427 |
} |
428 |
\end{textblock} |
|
429 |
||
0 | 430 |
\end{frame}} |
431 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
432 |
||
5 | 433 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
434 |
\begin{frame}[c] |
|
254
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
435 |
\frametitle{The Meaning of Matching} |
5 | 436 |
|
254
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
437 |
\begin{bubble}[10cm] |
5 | 438 |
\large |
254
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
439 |
A regular expression \bl{$r$} matches a string \bl{$s$} |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
440 |
provided |
5 | 441 |
|
442 |
\begin{center} |
|
254
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
443 |
\bl{$s \in L(r)$}\\ |
5 | 444 |
\end{center} |
254
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
445 |
\end{bubble} |
5 | 446 |
|
254
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
447 |
\end{frame} |
5 | 448 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
449 |
||
3 | 450 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
451 |
\mode<presentation>{ |
|
452 |
\begin{frame}[c] |
|
453 |
\frametitle{\begin{tabular}{c}This Course\end{tabular}} |
|
454 |
||
7 | 455 |
We will have a look at: |
3 | 456 |
|
457 |
\begin{itemize} |
|
7 | 458 |
\item regular expressions / regular expression matching |
97
60a3ba90dd53
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
95
diff
changeset
|
459 |
\item derivatives |
3 | 460 |
\item automata |
461 |
\item parsing |
|
462 |
\item grammars |
|
97
60a3ba90dd53
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
95
diff
changeset
|
463 |
\item a small interpreter / compiler |
3 | 464 |
\end{itemize} |
465 |
||
466 |
\end{frame}} |
|
467 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
468 |
||
0 | 469 |
|
470 |
||
471 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
472 |
\begin{frame}[c] |
|
253
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
473 |
\frametitle{Written Exam} |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
474 |
|
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
475 |
\begin{itemize} |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
476 |
\item Accounts for 75\%.\bigskip |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
477 |
|
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
478 |
\item You will understand the question ``Is this relevant for |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
479 |
the exam?'' is very demotivating for the lecturer!\bigskip\\ |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
480 |
|
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
481 |
\item Deal: Whatever is in the homework (and is not marked |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
482 |
``optional'') is relevant for the exam. |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
483 |
\end{itemize} |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
484 |
|
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
485 |
\end{frame} |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
486 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
487 |
|
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
488 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
489 |
\begin{frame}[t] |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
490 |
\frametitle{Coursework} |
0 | 491 |
|
492 |
\begin{itemize} |
|
253
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
493 |
\item Accounts for 25\%. Two strands. Choose \alert{\bf one}!\bigskip |
0 | 494 |
\end{itemize} |
495 |
||
253
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
496 |
\begin{columns}[t] \begin{column}{.5\textwidth} \underline{\bf Strand 1}\medskip |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
497 |
\begin{itemize} |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
498 |
\item four programming subtasks: |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
499 |
\begin{itemize} |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
500 |
\item matcher (5\%, 13.10.) |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
501 |
\item lexer (5\%, 03.11.) |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
502 |
\item parser (5\%, 27.11.) |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
503 |
\item compiler (10\%, 12.12.) |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
504 |
\end{itemize} |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
505 |
\end{itemize} |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
506 |
\end{column} |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
507 |
|
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
508 |
\hspace{-45pt}\vrule{}\hspace{10pt} |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
509 |
\begin{column}{.5\textwidth} |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
510 |
\underline{\bf Strand 2}\smallskip \begin{itemize} |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
511 |
\item one task: prove the correctness of a regular expression matcher in |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
512 |
the Isabelle theorem prover |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
513 |
\item 25\%, submission 12.12. |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
514 |
\end{itemize} |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
515 |
\end{column} |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
516 |
\end{columns}\medskip |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
517 |
|
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
518 |
\small |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
519 |
\begin{itemize} |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
520 |
\item Solving more than one strand will {\bf not} give you more |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
521 |
marks.\\[-2mm] |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
522 |
\item The exam will contain in much, much smaller form |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
523 |
elements from both (but will also be in lectures and HW). |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
524 |
\end{itemize} |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
525 |
|
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
526 |
\end{frame} |
0 | 527 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
528 |
||
529 |
\end{document} |
|
530 |
||
531 |
%%% Local Variables: |
|
532 |
%%% mode: latex |
|
533 |
%%% TeX-master: t |
|
534 |
%%% End: |
|
535 |