author | Christian Urban <urbanc@in.tum.de> |
Thu, 26 Sep 2019 10:59:52 +0100 | |
changeset 632 | b7b91158eded |
parent 631 | f618dd4de24a |
child 635 | 7c2c0f10c424 |
permissions | -rw-r--r-- |
631 | 1 |
% !TEX program = xelatex |
95
dbe49327b6c5
added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
2 |
\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
|
3 |
\usepackage{../slides} |
e8ef8f38ca84
added style files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
215
diff
changeset
|
4 |
\usepackage{../graphics} |
215
828303e8e4af
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
98
diff
changeset
|
5 |
\usepackage{../langs} |
828303e8e4af
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
98
diff
changeset
|
6 |
\usepackage{../data} |
0 | 7 |
|
252
e8ef8f38ca84
added style files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
215
diff
changeset
|
8 |
\hfuzz=220pt |
e8ef8f38ca84
added style files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
215
diff
changeset
|
9 |
|
254
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
10 |
\lstset{language=Scala, |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
11 |
style=mystyle, |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
12 |
numbersep=0pt, |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
13 |
numbers=none, |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
14 |
xleftmargin=0mm} |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
15 |
|
253
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
16 |
\newcommand{\bl}[1]{\textcolor{blue}{#1}} |
559 | 17 |
|
0 | 18 |
% beamer stuff |
428
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
19 |
\renewcommand{\slidecaption}{CFL 01, King's College London} |
0 | 20 |
|
21 |
||
22 |
\begin{document} |
|
23 |
||
24 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
253
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
25 |
\begin{frame}[t] |
510 | 26 |
\frametitle{% |
0 | 27 |
\begin{tabular}{@ {}c@ {}} |
1 | 28 |
\\[-3mm] |
428
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
29 |
\LARGE Compilers and \\[-1mm] |
1 | 30 |
\LARGE Formal Languages (1)\\[-3mm] |
0 | 31 |
\end{tabular}} |
32 |
||
33 |
\begin{center} |
|
507 | 34 |
%\includegraphics[scale=0.3]{pics/ante1.jpg}\hspace{5mm} |
35 |
%\includegraphics[scale=0.31]{pics/ante2.jpg}\\ |
|
36 |
%\footnotesize\textcolor{gray}{Antikythera automaton, 100 BC (Archimedes?)} |
|
0 | 37 |
\end{center} |
38 |
||
510 | 39 |
\normalsize |
0 | 40 |
\begin{center} |
41 |
\begin{tabular}{ll} |
|
42 |
Email: & christian.urban at kcl.ac.uk\\ |
|
631 | 43 |
Office Hours: & Thursdays 12 -- 14\\ |
44 |
& N\liningnums{7.07} (North Wing, Bush House)\\ |
|
45 |
Slides \& Progs: & KEATS\\ |
|
0 | 46 |
\end{tabular} |
47 |
\end{center} |
|
48 |
||
253
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
49 |
\end{frame} |
559 | 50 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
0 | 51 |
|
52 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
559 | 53 |
\begin{frame}[t] |
54 |
\frametitle{Why Study Compilers?} |
|
0 | 55 |
|
560 | 56 |
John Regehr {\small(Univ.~Utah, LLVM compiler hacker)}\smallskip\\ |
255
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
57 |
|
559 | 58 |
\begin{bubble}[10.5cm] |
59 |
\bf ``\ldots{}It’s effectively a perpetual |
|
60 |
employment act for solid compiler hackers.'' |
|
61 |
\end{bubble} |
|
0 | 62 |
|
559 | 63 |
\onslide<1->{ |
64 |
\only<2>{ |
|
65 |
\begin{itemize} |
|
66 |
\item {\bf Hardware is getting weirder |
|
631 | 67 |
rather than getting clocked faster.} |
0 | 68 |
|
559 | 69 |
\begin{itemize} |
631 | 70 |
\item[] ``Almost all processors are multicores nowadays and it looks |
71 |
like there is increasing asymmetry in resources across cores. |
|
72 |
Processors come with vector units, crypto accelerators etc. We have |
|
73 |
DSPs, GPUs, ARM big.little, and Xeon Phi. This is only scratching the |
|
74 |
surface.'' |
|
559 | 75 |
\end{itemize} |
76 |
\end{itemize}} |
|
255
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
77 |
\only<3>{ |
559 | 78 |
\begin{itemize} |
79 |
\item {\bf We’re getting tired of low-level languages and |
|
631 | 80 |
their associated security disasters.} |
559 | 81 |
|
82 |
\begin{itemize} |
|
631 | 83 |
\item [] ``We want to write new code, to whatever extent possible, in |
84 |
safer, higher-level languages. Compilers are caught right in the |
|
85 |
middle of these opposing trends: one of their main jobs is to help |
|
86 |
bridge the large and growing gap between increasingly high-level |
|
87 |
languages and increasingly wacky platforms.'' |
|
559 | 88 |
\end{itemize} |
89 |
\end{itemize}}} |
|
1 | 90 |
|
253
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
91 |
\end{frame} |
0 | 92 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
1 | 93 |
|
255
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
94 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
631 | 95 |
\begin{frame}[t] |
96 |
\frametitle{What are Compilers?} |
|
97 |
||
98 |
\begin{center} |
|
99 |
\begin{tikzpicture}[] |
|
100 |
\node (0) at (-2.3,0) {\includegraphics[scale=0.3]{pics/csource.png}}; |
|
101 |
\node (1) [right=35mm] at (0) {\includegraphics[scale=0.3]{pics/cassmbl.png}}; |
|
102 |
\draw [->,line width=4mm, red] (0) -- (1); |
|
103 |
\end{tikzpicture} |
|
104 |
\end{center} |
|
105 |
||
106 |
\begin{textblock}{10}(1,13.5) |
|
107 |
Compiler explorers, e.g.: \url{https://gcc.godbolt.org} |
|
108 |
\end{textblock} |
|
109 |
||
110 |
\end{frame} |
|
111 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
112 |
||
113 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
114 |
\begin{frame}[c] |
|
115 |
\frametitle{\begin{tabular}{c}Why Bother?\\[-2mm] Compilers \& Boeings 777\end{tabular}} |
|
116 |
||
117 |
First flight in 1994. They want to achieve triple redundancy in hardware |
|
118 |
faults.\bigskip |
|
119 |
||
120 |
They compile 1 Ada program to\medskip |
|
121 |
||
122 |
\begin{itemize} |
|
123 |
\item Intel 80486 |
|
124 |
\item Motorola 68040 (old Macintosh's) |
|
125 |
\item AMD 29050 (RISC chips used often in laser printers) |
|
126 |
\end{itemize}\medskip\medskip |
|
127 |
||
128 |
using 3 independent compilers.\bigskip\pause |
|
129 |
||
130 |
\small Airbus uses C and static analysers. Recently started using CompCert. |
|
131 |
||
132 |
\end{frame} |
|
133 |
%%%%%%%%%%% |
|
134 |
||
135 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
255
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
136 |
\begin{frame}[c] |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
137 |
\frametitle{Why Bother?} |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
138 |
|
428
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
139 |
\begin{columns}[t] |
255
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
140 |
\begin{column}{.5\textwidth} |
559 | 141 |
Ruby, Python, Java 8\medskip\\ |
428
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
142 |
\begin{tikzpicture}\footnotesize |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
143 |
\begin{axis}[ |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
144 |
xlabel={$n$}, |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
145 |
x label style={at={(1.05,0.0)}}, |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
146 |
ylabel={time in secs}, |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
147 |
enlargelimits=false, |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
148 |
xtick={0,5,...,30}, |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
149 |
xmax=33, |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
150 |
ymax=35, |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
151 |
ytick={0,5,...,30}, |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
152 |
scaled ticks=false, |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
153 |
axis lines=left, |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
154 |
width=5.5cm, |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
155 |
height=4cm, |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
156 |
legend entries={Python,Ruby}, |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
157 |
legend pos=north west, |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
158 |
legend cell align=left] |
559 | 159 |
\addplot[blue,mark=*, mark options={fill=white}] table {re-python.data}; |
160 |
\addplot[brown,mark=triangle*, mark options={fill=white}] table {re-ruby.data}; |
|
428
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
161 |
\end{axis} |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
162 |
\end{tikzpicture} |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
163 |
\begin{tikzpicture}\footnotesize |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
164 |
\begin{axis}[ |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
165 |
xlabel={$n$}, |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
166 |
x label style={at={(1.05,0.0)}}, |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
167 |
ylabel={time in secs}, |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
168 |
enlargelimits=false, |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
169 |
xtick={0,5,...,30}, |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
170 |
xmax=33, |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
171 |
ymax=35, |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
172 |
ytick={0,5,...,30}, |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
173 |
scaled ticks=false, |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
174 |
axis lines=left, |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
175 |
width=5.5cm, |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
176 |
height=4cm, |
631 | 177 |
legend entries={Python, Java 8, JavaScript}, |
428
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
178 |
legend pos=north west, |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
179 |
legend cell align=left] |
559 | 180 |
\addplot[blue,mark=*, mark options={fill=white}] table {re-python2.data}; |
428
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
181 |
\addplot[cyan,mark=*, mark options={fill=white}] table {re-java.data}; |
631 | 182 |
\addplot[red,mark=*, mark options={fill=white}] table {re-js.data}; |
428
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
183 |
\end{axis} |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
184 |
\end{tikzpicture} |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
185 |
|
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
186 |
\end{column} |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
187 |
\begin{column}{.5\textwidth} |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
188 |
Us (after next lecture)\medskip\\ |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
189 |
\begin{tikzpicture}\footnotesize |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
190 |
\begin{axis}[ |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
191 |
xlabel={$n$}, |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
192 |
x label style={at={(1.07,0.0)}}, |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
193 |
ylabel={time in secs}, |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
194 |
enlargelimits=false, |
442
84d6714840c9
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
437
diff
changeset
|
195 |
xtick={0,5000,...,10000}, |
84d6714840c9
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
437
diff
changeset
|
196 |
xmax=11000, |
428
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
197 |
ymax=35, |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
198 |
ytick={0,5,...,30}, |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
199 |
scaled ticks=false, |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
200 |
axis lines=left, |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
201 |
width=5.5cm, |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
202 |
height=4cm] |
437
fe387fcbf2ee
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
428
diff
changeset
|
203 |
\addplot[green,mark=square*,mark options={fill=white}] table {re2.data}; |
428
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
204 |
\addplot[black,mark=square*,mark options={fill=white}] table {re3.data}; |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
205 |
\end{axis} |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
206 |
\end{tikzpicture} |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
207 |
\begin{tikzpicture}\footnotesize |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
208 |
\begin{axis}[ |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
209 |
xlabel={$n$}, |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
210 |
x label style={at={(1.07,0.0)}}, |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
211 |
ylabel={time in secs}, |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
212 |
enlargelimits=false, |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
213 |
ymax=35, |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
214 |
ytick={0,5,...,30}, |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
215 |
scaled ticks=false, |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
216 |
axis lines=left, |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
217 |
width=5.5cm, |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
218 |
height=4cm] |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
219 |
\addplot[black,mark=square*,mark options={fill=white}] table {re3a.data}; |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
220 |
\end{axis} |
255
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
221 |
\end{tikzpicture} |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
222 |
\end{column} |
428
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
223 |
\end{columns}\bigskip |
255
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
224 |
|
428
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
225 |
\small\centering |
559 | 226 |
matching \texttt{[a?]\{n\}[a]\{n\}} and \texttt{(a*)*b} |
428
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
227 |
against $\underbrace{\texttt{a}...\texttt{a}}_n$ |
510 | 228 |
\end{frame} |
255
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
229 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
631 | 230 |
|
231 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
232 |
\begin{frame}[c,fragile] |
|
233 |
\frametitle{Incidents} |
|
234 |
||
235 |
\begin{itemize} |
|
236 |
\item a global outage on 2 July 2019 at \textbf{Cloudflare} |
|
237 |
(first one for six years)\medskip |
|
238 |
||
239 |
\begin{center}\small\color{blue} |
|
240 |
\begin{verbatim} |
|
241 |
(?:(?:\"|'|\]|\}|\\|\d|(?:nan|infinity|true|false| |
|
242 |
null|undefined|symbol|math)|\`|\-|\+)+[)]*;?((?:\s |
|
243 |
|-|~|!|{}|\|\||\+)*.*(?:.*=.*))) |
|
244 |
\end{verbatim} |
|
245 |
\end{center}\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip |
|
246 |
||
247 |
\item on 20 July 2016 the \textbf{Stack Exchange} webpage went down |
|
248 |
because of an evil regular expression |
|
249 |
\end{itemize} |
|
250 |
||
251 |
\begin{textblock}{6}(9,7.6) |
|
252 |
\includegraphics[scale=0.14]{cloudflare.png}\\ |
|
253 |
\footnotesize |
|
254 |
It serves more web traffic than Twitter, Amazon, Apple, Instagram, Bing \& Wikipedia combined. |
|
255 |
\end{textblock} |
|
256 |
||
257 |
\end{frame} |
|
258 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
259 |
||
560 | 260 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
261 |
\begin{frame}[c] |
|
262 |
\frametitle{Evil Regular Expressions} |
|
263 |
||
264 |
\begin{itemize} |
|
265 |
\item \alert{R}egular \alert{e}xpression \alert{D}enial \alert{o}f \alert{S}ervice (ReDoS)\medskip |
|
266 |
\item Evil regular expressions\medskip |
|
267 |
\begin{itemize} |
|
268 |
\item \bl{$(a^{?\{n\}}) \cdot a^{\{n\}}$} |
|
269 |
\item \bl{$(a^*)^*\cdot b$} |
|
630 | 270 |
\item \bl{$([a-z]^+)^*$} |
560 | 271 |
\item \bl{$(a + a \cdot a)^*$} |
272 |
\item \bl{$(a + a^?)^*$} |
|
273 |
\end{itemize} |
|
274 |
||
275 |
\item sometimes also called \alert{catastrophic backtracking} |
|
276 |
\item this is a problem for \alert{N}etwork \alert{I}ntrusion |
|
631 | 277 |
\alert{D}etection systems, Cloudflare, StackExchange, Atom editor |
560 | 278 |
\item \url{https://vimeo.com/112065252} |
279 |
\end{itemize} |
|
280 |
||
281 |
\end{frame} |
|
282 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
428
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
283 |
|
255
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
284 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
285 |
\begin{frame}[c] |
559 | 286 |
\frametitle{The Goal of this Module} |
287 |
||
288 |
\begin{center} |
|
289 |
\begin{tikzpicture}[scale=1, |
|
290 |
node/.style={ |
|
291 |
rectangle,rounded corners=3mm, |
|
292 |
very thick,draw=black!50,minimum height=18mm, minimum width=20mm, |
|
293 |
top color=white,bottom color=black!20}] |
|
294 |
||
560 | 295 |
\node at (3.05, 1.8) {\Large\bf write a compiler}; |
559 | 296 |
|
560 | 297 |
\node (0) at (-2.3,0) {}; |
298 |
\node [above=5mm of 0] |
|
299 |
{\makebox[0mm]{\footnotesize |
|
300 |
\begin{tabular}{@{}l@{}}input\\[-1mm]program\end{tabular}}}; |
|
576 | 301 |
|
559 | 302 |
\node (A) at (0,0) [node] {}; |
303 |
\node [below right] at (A.north west) {lexer}; |
|
304 |
||
305 |
\node (B) at (3,0) [node] {}; |
|
306 |
\node [below right=1mm] at (B.north west) {\mbox{}\hspace{-1mm}parser}; |
|
307 |
||
308 |
\node (C) at (6,0) [node] {}; |
|
309 |
\node [below right] at (C.north west) {\mbox{}\hspace{-1mm}code gen}; |
|
310 |
||
560 | 311 |
\node (1) at (8.4,0) {}; |
312 |
\node [above=5mm of 1] |
|
313 |
{\makebox[0mm]{\footnotesize |
|
314 |
\begin{tabular}{@{}r@{}}binary\\[-1mm]code\end{tabular}}}; |
|
559 | 315 |
|
316 |
\draw [->,line width=4mm] (0) -- (A); |
|
317 |
\draw [->,line width=4mm] (A) -- (B); |
|
318 |
\draw [->,line width=4mm] (B) -- (C); |
|
319 |
\draw [->,line width=4mm] (C) -- (1); |
|
320 |
\end{tikzpicture} |
|
321 |
\end{center} |
|
322 |
||
323 |
\only<2,3,4>{ |
|
324 |
\begin{textblock}{1}(1,2.1) |
|
325 |
\begin{bubble}[9.8cm] |
|
326 |
\normalsize |
|
327 |
lexer input: a string\smallskip\\ |
|
328 |
\hspace{5mm}\code{"read(n);"}\medskip\\ |
|
329 |
lexer output: a sequence of tokens\smallskip\\ |
|
330 |
\hspace{5mm}\code{key(read) lpar id(n) rpar semi} |
|
331 |
\end{bubble} |
|
621 | 332 |
\end{textblock}} |
559 | 333 |
|
334 |
\only<3,4>{ |
|
335 |
\begin{textblock}{1}(6,7.8) |
|
336 |
\begin{tabular}{c} |
|
337 |
\includegraphics[scale=0.2]{../pics/rosetta.jpg}\\[-2mm] |
|
338 |
\footnotesize lexing $\Rightarrow$ recognising words (Stone of Rosetta) |
|
339 |
\end{tabular} |
|
340 |
\end{textblock}} |
|
341 |
||
342 |
\only<4>{ |
|
343 |
\begin{textblock}{1}(0.5,12)\small |
|
344 |
\begin{tabular}{l@{}c@{}l} |
|
345 |
\pcode{if} & $\;\Rightarrow\;$ & keyword\\ |
|
346 |
\pcode{iffoo} & $\;\Rightarrow\;$ & identifier\\ |
|
347 |
\end{tabular} |
|
348 |
\end{textblock}} |
|
349 |
||
350 |
\only<5>{ |
|
351 |
\begin{textblock}{1}(1,1.5) |
|
352 |
\begin{bubble}[8.5cm] |
|
353 |
\normalsize |
|
354 |
parser input: a sequence of tokens\smallskip\\ |
|
355 |
||
356 |
{\small\hspace{5mm}\code{key(read) lpar id(n) rpar semi}}\smallskip\\ |
|
357 |
||
358 |
parser output: an abstract syntax tree\smallskip\\ |
|
359 |
\footnotesize |
|
360 |
\hspace{2cm}\begin{tikzpicture} |
|
361 |
\node {\code{read}} |
|
362 |
child {node {\code{lpar}}} |
|
363 |
child {node {\code{n}}} |
|
364 |
child {node {\code{rpar}}}; |
|
365 |
\end{tikzpicture} |
|
366 |
\end{bubble} |
|
367 |
\end{textblock}} |
|
368 |
||
369 |
\only<6,7>{ |
|
370 |
\begin{textblock}{1}(1,1.5) |
|
371 |
\begin{bubble}[4cm] |
|
372 |
\normalsize |
|
373 |
code generator:\smallskip\\ |
|
374 |
\hspace{5mm}\code{istore 2}\\ |
|
375 |
\hspace{5mm}\code{iload 2}\\ |
|
376 |
\hspace{5mm}\code{ldc 10}\\ |
|
377 |
\hspace{5mm}\code{isub}\\ |
|
378 |
\hspace{5mm}\code{ifeq Label2}\\ |
|
379 |
\hspace{5mm}\code{iload 2}\\ |
|
380 |
\hspace{5mm}\code{...}\\ |
|
381 |
\end{bubble} |
|
382 |
\end{textblock}} |
|
383 |
||
384 |
\only<7>{ |
|
385 |
\begin{textblock}{6}(8.4,7) |
|
386 |
\begin{bubble}[5cm] |
|
387 |
\mbox{\begin{tikzpicture}[scale=0.58,rounded corners=0mm] |
|
388 |
\begin{axis}[axis x line=bottom, axis y line=left, ylabel=secs, |
|
389 |
xlabel=n, |
|
390 |
enlargelimits=0.05, |
|
391 |
ybar interval=0.7, legend style=small] |
|
392 |
\addplot file {interpreted2.data}; |
|
393 |
\addplot file {compiled2.data}; |
|
394 |
%\legend{interpreted, compiled} |
|
395 |
\end{axis} |
|
396 |
\end{tikzpicture}} |
|
397 |
\end{bubble} |
|
398 |
\end{textblock}} |
|
399 |
||
400 |
\end{frame} |
|
401 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
402 |
||
403 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
404 |
\begin{frame}[c] |
|
405 |
\frametitle{The Acad.~Subject is Mature} |
|
406 |
||
631 | 407 |
\bigskip |
559 | 408 |
\begin{itemize} |
631 | 409 |
\item Turing Machines, 1936 (a tape as memory) |
559 | 410 |
\item Regular Expressions, 1956\\ |
631 | 411 |
\item The first compiler for COBOL, 1957\\ (Grace Hopper)\medskip |
559 | 412 |
\item But surprisingly research papers are still published nowadays\\ |
413 |
\item ``Parsing: The Solved Problem That Isn't'' |
|
414 |
\end{itemize} |
|
415 |
||
416 |
\begin{flushright} |
|
417 |
\includegraphics[scale=0.3]{pics/hopper.jpg}\\ |
|
418 |
\footnotesize\textcolor{gray}{Grace Hopper} |
|
419 |
\end{flushright} |
|
420 |
||
421 |
||
422 |
\begin{flushright} |
|
423 |
\mbox{}\\[-6mm] |
|
424 |
{\footnotesize\textcolor{gray}{(she made it to David Letterman's Tonight Show,\\[-2mm] |
|
425 |
\url{http://www.youtube.com/watch?v=aZOxtURhfEU})}} |
|
426 |
\end{flushright} |
|
427 |
||
428 |
\end{frame} |
|
429 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
430 |
||
632 | 431 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
432 |
\begin{frame}[c] |
|
433 |
\frametitle{Remember BF***?} |
|
559 | 434 |
|
632 | 435 |
\begin{center} |
436 |
\begin{tabular}{lcl} |
|
437 |
\bl{\texttt{>}} & $\Rightarrow$ & move one cell right\\ |
|
438 |
\bl{\texttt{<}} & $\Rightarrow$ & move one cell left\\ |
|
439 |
\bl{\texttt{+}} & $\Rightarrow$ & increase cell by one\\ |
|
440 |
\bl{\texttt{-}} & $\Rightarrow$ & decrease cell by one\\ |
|
441 |
\bl{\texttt{.}} & $\Rightarrow$ & print current cell\\ |
|
442 |
\bl{\texttt{,}} & $\Rightarrow$ & input current cell\\ |
|
443 |
\bl{\texttt{[}} & $\Rightarrow$ & loop begin\\ |
|
444 |
\bl{\texttt{]}} & $\Rightarrow$ & loop end\medskip\\ |
|
445 |
& $\Rightarrow$ & everything else is a comment\\ |
|
446 |
\end{tabular} |
|
447 |
\end{center} |
|
448 |
||
449 |
\end{frame} |
|
450 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
451 |
||
452 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
453 |
\begin{frame}[c] |
|
454 |
\frametitle{A Compiler for BF***} |
|
455 |
||
456 |
\begin{center} |
|
457 |
\begin{tabular}{lcl} |
|
458 |
\bl{\texttt{>}} & $\Rightarrow$ & \texttt{ptr++}\\ |
|
459 |
\bl{\texttt{<}} & $\Rightarrow$ & \texttt{ptr--}\\ |
|
460 |
\bl{\texttt{+}} & $\Rightarrow$ & \texttt{(*ptr)++}\\ |
|
461 |
\bl{\texttt{-}} & $\Rightarrow$ & \texttt{(*ptr)--}\\ |
|
462 |
\bl{\texttt{.}} & $\Rightarrow$ & \texttt{putchar(*ptr)}\\ |
|
463 |
\bl{\texttt{,}} & $\Rightarrow$ & \texttt{*ptr = getchar()}\\ |
|
464 |
\bl{\texttt{[}} & $\Rightarrow$ & \texttt{while(*ptr)\{}\\ |
|
465 |
\bl{\texttt{]}} & $\Rightarrow$ & \texttt{\}}\medskip\\ |
|
466 |
& $\Rightarrow$ & ignore everything else\\ |
|
467 |
\end{tabular} |
|
468 |
\end{center}\bigskip |
|
469 |
||
470 |
\texttt{char field[30000]\\ char *ptr = &field[15000]} |
|
471 |
||
472 |
\end{frame} |
|
473 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
474 |
||
559 | 475 |
|
476 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
477 |
\begin{frame}[c] |
|
327
9470cd124667
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
255
diff
changeset
|
478 |
\frametitle{Lectures 1 - 5} |
255
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
479 |
|
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
480 |
transforming strings into structured data\\[10mm] |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
481 |
|
506 | 482 |
{\LARGE\bf Lexing} {\hfill{}based on regular expressions}\medskip\\ |
255
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
483 |
\hspace{5mm}(recognising ``words'')\\[6mm] |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
484 |
|
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
485 |
{\LARGE\bf Parsing}\medskip\\ |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
486 |
\hspace{5mm}(recognising ``sentences'') |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
487 |
|
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
488 |
\begin{textblock}{1}(10,9.1) |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
489 |
\begin{tabular}{c} |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
490 |
\includegraphics[scale=0.1]{../pics/rosetta.jpg}\\[-2mm] |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
491 |
\footnotesize Stone of Rosetta |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
492 |
\end{tabular} |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
493 |
\end{textblock} |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
494 |
|
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
495 |
\end{frame} |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
496 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
497 |
|
1 | 498 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
255
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
499 |
\begin{frame}[t] |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
500 |
\frametitle{Familiar Regular Expr.} |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
501 |
\small |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
502 |
\begin{center} |
560 | 503 |
\texttt{[a-z0-9\_$\backslash{}$.-]+ @ [a-z0-9$\backslash{}$.-]+ . [a-z$\backslash{}$.]\{2,6\}} |
255
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
504 |
\end{center}\smallskip |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
505 |
|
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
506 |
\begin{center} |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
507 |
\begin{tabular}{@{}lp{8.5cm}@{}} |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
508 |
\pcode{re*} & matches 0 or more times\\ |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
509 |
\pcode{re+} & matches 1 or more times\\ |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
510 |
\pcode{re?} & matches 0 or 1 times\\ |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
511 |
\pcode{re\{n\}} & matches exactly \pcode{n} number of times\\ |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
512 |
\pcode{re\{n,m\}} & matches at least \pcode{n} and at most {\tt m} times\\ |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
513 |
\pcode{[...]} & matches any single character inside the brackets\\ |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
514 |
\pcode{[^...]} & matches any single character not inside the |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
515 |
brackets\\ |
560 | 516 |
\pcode{a-z A-Z} & character ranges\\ |
255
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
517 |
\pcode{\\d} & matches digits; equivalent to \pcode{[0-9]}\\ |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
518 |
\pcode{.} & matches every character except newline\\ |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
519 |
\pcode{(re)} & groups regular expressions and remembers |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
520 |
the matched text |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
521 |
\end{tabular} |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
522 |
\end{center} |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
523 |
|
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
524 |
|
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
525 |
\end{frame} |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
526 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
527 |
|
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
528 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
631 | 529 |
%\begin{frame}[c] |
530 |
%\frametitle{Today} |
|
531 |
% |
|
532 |
%\begin{itemize} |
|
533 |
%\item While the ultimate goal is to implement a small compiler for the JVM |
|
534 |
% \ldots\bigskip |
|
535 |
%\end{itemize} |
|
536 |
% |
|
537 |
%Let's start with: |
|
538 |
% |
|
539 |
%\begin{itemize} |
|
540 |
%\item a web-crawler |
|
541 |
%\item an email harvester |
|
559 | 542 |
%\item \textcolor{gray}{(a web-scraper)} |
631 | 543 |
%\end{itemize} |
544 |
% |
|
545 |
%\end{frame} |
|
255
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
546 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
0 | 547 |
|
2 | 548 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
631 | 549 |
%\begin{frame}[t] |
550 |
%\frametitle{A Web-Crawler} |
|
551 |
% |
|
552 |
%\mbox{}\\[10mm] |
|
553 |
% |
|
554 |
%\begin{enumerate} |
|
555 |
%\item given an URL, read the corresponding webpage |
|
556 |
%\item extract all links from it |
|
557 |
%\item call the web-crawler again for all these links |
|
558 |
%\end{enumerate} |
|
559 |
% |
|
560 |
%\end{frame} |
|
2 | 561 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
562 |
||
563 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
631 | 564 |
%\begin{frame}[t] |
565 |
%\frametitle{A Web-Crawler} |
|
566 |
% |
|
567 |
%\mbox{}\\[10mm] |
|
568 |
% |
|
569 |
% |
|
570 |
%\begin{enumerate} |
|
571 |
%\item given an URL, read the corresponding webpage |
|
572 |
%\item if not possible print, out a problem |
|
573 |
%\item if possible, extract all links from it |
|
574 |
%\item call the web-crawler again for all these links |
|
575 |
%\end{enumerate}\bigskip\pause |
|
576 |
% |
|
577 |
%\small (we need a bound for the number of recursive calls) |
|
578 |
% |
|
579 |
%\small (the purpose is to check all links on my own webpage) |
|
580 |
%\end{frame} |
|
2 | 581 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
582 |
||
255
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
583 |
|
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
584 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
631 | 585 |
%\begin{frame}[c] |
586 |
% |
|
587 |
%\begin{textblock}{1}(2,5) |
|
588 |
%\begin{tabular}{c} |
|
589 |
%\includegraphics[scale=0.15]{pics/servers.png}\\[-2mm] |
|
590 |
%\small Server |
|
591 |
%\end{tabular} |
|
592 |
%\end{textblock} |
|
593 |
% |
|
594 |
%\begin{textblock}{1}(5.6,4) |
|
595 |
% \begin{tikzpicture}[scale=1.1] |
|
596 |
% \draw[white] (0,1) node (X) {}; |
|
597 |
% \draw[white] (2,1) node (Y) {}; |
|
598 |
% \draw[white] (0,0) node (X1) {}; |
|
599 |
% \draw[white] (2,0) node (Y1) {}; |
|
600 |
% \draw[white] (0,-1) node (X2) {}; |
|
601 |
% \draw[white] (2,-1) node (Y2) {}; |
|
602 |
% \draw[red, <-, line width = 2mm] (X) -- (Y); |
|
603 |
% \node [inner sep=5pt,label=above:\textcolor{black}{GET request}] at ($ (X)!.5!(Y) $) {}; |
|
604 |
% \draw[red, ->, line width = 2mm] (X1) -- (Y1); |
|
605 |
% \node [inner sep=5pt,label=above:\textcolor{black}{webpage}] at ($ (X1)!.5!(Y1) $) {}; |
|
606 |
% \draw[red, <-, line width = 2mm] (X2) -- (Y2); |
|
607 |
% \node [inner sep=7pt,label=above:\textcolor{black}{POST data}] at ($ (X2)!.5!(Y2) $) {}; |
|
608 |
% \end{tikzpicture} |
|
609 |
%\end{textblock} |
|
610 |
% |
|
611 |
% |
|
612 |
%\begin{textblock}{1}(9,5.5) |
|
613 |
%\begin{tabular}{c} |
|
614 |
%\includegraphics[scale=0.15]{pics/laptop.png}\\[-2mm] |
|
615 |
%\small Browser |
|
616 |
%\end{tabular} |
|
617 |
%\end{textblock} |
|
618 |
%\end{frame} |
|
619 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
255
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
620 |
|
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
621 |
|
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
622 |
|
0 | 623 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
631 | 624 |
%\begin{frame}[c] |
625 |
%\frametitle{Scala} |
|
626 |
% |
|
627 |
%\small A simple Scala function for reading webpages: |
|
628 |
%\bigskip |
|
629 |
% |
|
630 |
%\footnotesize |
|
631 |
%\lstinputlisting{../progs/app0.scala} |
|
632 |
%\medskip\pause |
|
633 |
% |
|
634 |
%\lstinline{get_page("""https://nms.kcl.ac.uk/christian.urban/""")} |
|
635 |
%\bigskip\medskip\pause |
|
636 |
% |
|
637 |
% |
|
638 |
%\small A slightly more complicated version for handling errors: |
|
639 |
%\smallskip |
|
640 |
% |
|
641 |
%\footnotesize |
|
642 |
%\lstinputlisting[xleftmargin=-4mm]{../progs/app1.scala} |
|
643 |
% |
|
644 |
% |
|
645 |
%\end{frame} |
|
0 | 646 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
647 |
||
98
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
648 |
|
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
649 |
|
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
650 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
3 | 651 |
\begin{frame}[t] |
253
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
652 |
\frametitle{A Regular Expression} |
3 | 653 |
|
654 |
\begin{itemize} |
|
655 |
\item \ldots{} is a pattern or template for specifying strings |
|
656 |
\end{itemize}\bigskip |
|
657 |
||
658 |
\begin{center} |
|
254
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
659 |
\only<1>{\scode{"https?://[^"]*"}}% |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
660 |
\only<2>{\scode{""""https?://[^"]*"""".r}} |
3 | 661 |
\end{center}\bigskip\bigskip |
662 |
||
254
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
663 |
matches for example\smallskip\\ |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
664 |
\hspace{2mm}\code{"http://www.foobar.com"}\\ |
559 | 665 |
\hspace{2mm}\code{"https://www.tls.org"}\smallskip\\ |
666 |
||
667 |
but not\smallskip\\ |
|
668 |
\hspace{2mm}\code{"http://www."foo"bar.com"}\\ |
|
3 | 669 |
|
253
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
670 |
\end{frame} |
3 | 671 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
672 |
||
673 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
632 | 674 |
%\begin{frame}[c] |
675 |
%\frametitle{Finding Operations in Scala} |
|
676 |
% |
|
677 |
%{\bf\code{rexp.findAllIn(string)}}\medskip |
|
678 |
% |
|
679 |
%returns a list of all (sub)strings that match the |
|
680 |
%regular expression |
|
681 |
%\bigskip\bigskip |
|
682 |
% |
|
683 |
% |
|
684 |
%{\bf\code{rexp.findFirstIn(string)}}\medskip |
|
685 |
% |
|
686 |
%returns either |
|
687 |
% |
|
688 |
%\begin{itemize} |
|
689 |
%\item \code{None} if no (sub)string matches or |
|
690 |
%\item \code{Some(s)} with the first (sub)string |
|
691 |
%\end{itemize} |
|
692 |
% |
|
693 |
%\end{frame} |
|
0 | 694 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
695 |
||
696 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
631 | 697 |
%\begin{frame}[c] |
698 |
% |
|
699 |
%\footnotesize |
|
700 |
%\lstinputlisting{../progs/app2.scala} |
|
701 |
% |
|
702 |
%\end{frame} |
|
254
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
703 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
0 | 704 |
|
254
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
705 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
631 | 706 |
%\begin{frame}[c] |
707 |
% |
|
708 |
%\small |
|
709 |
%A version that only crawls links in ``my'' domain:\bigskip |
|
710 |
% |
|
711 |
%\footnotesize |
|
712 |
%\lstinputlisting{../progs/app3.scala} |
|
713 |
% |
|
714 |
%\end{frame} |
|
0 | 715 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
716 |
||
717 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
631 | 718 |
%\begin{frame}[c] |
719 |
%\lstset{xleftmargin=-4mm} |
|
720 |
%\small |
|
721 |
%A little email harvester: |
|
722 |
% |
|
723 |
%\footnotesize |
|
724 |
%\lstinputlisting{../progs/app4.scala}\bigskip |
|
725 |
% |
|
726 |
%\tiny |
|
727 |
%\url{http://net.tutsplus.com/tutorials/other/8-regular-expressions-you-should-know/} |
|
728 |
% |
|
729 |
%\end{frame} |
|
3 | 730 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
731 |
||
732 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
14 | 733 |
\begin{frame}[t] |
506 | 734 |
\frametitle{Regular Expressions} |
0 | 735 |
|
330
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
736 |
Their inductive definition: |
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
737 |
|
14 | 738 |
|
330
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
739 |
\begin{textblock}{6}(2,7.5) |
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
740 |
\begin{tabular}{@ {}rrl@ {\hspace{13mm}}l} |
512 | 741 |
\bl{$r$} & \bl{$::=$} & \bl{$\ZERO$} & nothing\\ |
428
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
742 |
& \bl{$\mid$} & \bl{$\ONE$} & empty string / \pcode{""} / $[]$\\ |
330
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
743 |
& \bl{$\mid$} & \bl{$c$} & character\\ |
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
744 |
& \bl{$\mid$} & \bl{$r_1 + r_2$} & alternative / choice\\ |
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
745 |
& \bl{$\mid$} & \bl{$r_1 \cdot r_2$} & sequence\\ |
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
746 |
& \bl{$\mid$} & \bl{$r^*$} & star (zero or more)\\ |
3 | 747 |
\end{tabular} |
748 |
\end{textblock} |
|
749 |
||
330
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
750 |
|
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
751 |
\only<2->{\footnotesize |
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
752 |
\begin{textblock}{9}(2,0.5) |
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
753 |
\begin{bubble}[9.8cm] |
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
754 |
\lstinputlisting{../progs/app01.scala} |
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
755 |
\end{bubble} |
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
756 |
\end{textblock}} |
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
757 |
|
254
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
758 |
\end{frame} |
3 | 759 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
760 |
||
761 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
506 | 762 |
%\begin{frame}[t] |
763 |
%\frametitle{Regular Expressions} |
|
764 |
% |
|
765 |
%\small |
|
766 |
%In Scala:\bigskip |
|
767 |
% |
|
768 |
%\footnotesize |
|
769 |
%\lstinputlisting{../progs/app51.scala} |
|
770 |
% |
|
771 |
% |
|
772 |
%\end{frame} |
|
0 | 773 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
774 |
||
775 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
255
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
776 |
\begin{frame}[t] |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
777 |
\frametitle{Strings} |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
778 |
|
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
779 |
\ldots are lists of characters. For example \code{"hello"} |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
780 |
|
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
781 |
\begin{center} |
330
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
782 |
\bl{$[h, e, l, l, o]$} or just \bl{$hello$} |
255
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
783 |
\end{center} |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
784 |
|
330
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
785 |
the empty string: \bl{$[]$} or \bl{\pcode{""}}\bigskip\\ |
255
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
786 |
|
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
787 |
the concatenation of two strings: |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
788 |
|
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
789 |
\begin{center} |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
790 |
\bl{$s_1 \,@\, s_2$} |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
791 |
\end{center} |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
792 |
|
631 | 793 |
\bl{\textit{foo $@$ bar = foobar}}\\ |
794 |
\bl{\textit{baz $@\, []$ = baz}} |
|
255
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
795 |
|
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
796 |
\end{frame} |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
797 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
798 |
|
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
799 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
330
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
800 |
\begin{frame}[c] |
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
801 |
\frametitle{Languages, Strings} |
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
802 |
|
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
803 |
\begin{itemize} |
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
804 |
\item \alert{\bf Strings} are lists of characters, for example |
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
805 |
\begin{center} |
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
806 |
\bl{$[]$},\;\bl{$abc$} \hspace{2cm}(Pattern match: \bl{$c\!::\!s$}) |
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
807 |
\end{center}\bigskip |
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
808 |
|
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
809 |
|
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
810 |
\item A \alert{\bf language} is a set of strings, for example\medskip |
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
811 |
\begin{center} |
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
812 |
\bl{$\{[], hello, \textit{foobar}, a, abc\}$} |
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
813 |
\end{center}\bigskip |
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
814 |
|
332
4755ad4b457b
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
331
diff
changeset
|
815 |
\item \alert{\bf Concatenation} of strings and languages |
330
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
816 |
|
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
817 |
\begin{center} |
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
818 |
\begin{tabular}{rcl} |
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
819 |
\bl{$\textit{foo}\;@\;bar$} & \bl{$=$} & \bl{$\textit{foobar}$}\medskip\\ |
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
820 |
\bl{$A\;@\;B$} & \bl{$\dn$} & \bl{$\{ s_1\,@\,s_2 \;\mid\; s_1 \in A \wedge s_2 \in B\}$} |
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
821 |
\end{tabular} |
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
822 |
\end{center} |
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
823 |
|
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
824 |
%\item The \alert{\bf meaning} of a regular expression is a set of |
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
825 |
% strings, or language. |
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
826 |
\end{itemize} |
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
827 |
|
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
828 |
\end{frame} |
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
829 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
830 |
|
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
831 |
|
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
832 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
0 | 833 |
\mode<presentation>{ |
834 |
\begin{frame}[c] |
|
253
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
835 |
\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
|
836 |
Regular Expression\end{tabular}} |
0 | 837 |
|
4 | 838 |
\begin{textblock}{15}(1,4) |
254
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
839 |
\begin{tabular}{rcl} |
428
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
840 |
\bl{$L(\ZERO)$} & \bl{$\dn$} & \bl{$\{\}$}\\ |
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
841 |
\bl{$L(\ONE)$} & \bl{$\dn$} & \bl{$\{[]\}$}\\ |
254
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
842 |
\bl{$L(c)$} & \bl{$\dn$} & \bl{$\{[c]\}$}\\ |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
843 |
\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
|
844 |
\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) \}$}\\ |
428
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
845 |
\bl{$L(r^*)$} & \bl{$\dn$} & \onslide<4->{\bl{$\bigcup_{0 \le n} L(r)^n$}}\\ |
4 | 846 |
\end{tabular}\bigskip |
3 | 847 |
|
4 | 848 |
\onslide<2->{ |
254
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
849 |
\hspace{5mm}\bl{$L(r)^0 \;\dn\; \{[]\}$}\\ |
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
850 |
\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
|
851 |
\small\hspace{5cm}\textcolor{gray}{$\{ s_1 @ s_2 \;|\; s_1\in L(r) \wedge s_2 \in L(r)^n \}$}} |
4 | 852 |
} |
853 |
\end{textblock} |
|
854 |
||
0 | 855 |
\end{frame}} |
856 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
857 |
||
5 | 858 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
859 |
\begin{frame}[c] |
|
254
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
860 |
\frametitle{The Meaning of Matching} |
5 | 861 |
|
254
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
862 |
\begin{bubble}[10cm] |
559 | 863 |
\large\bf |
507 | 864 |
A regular expression \bl{$r$} matches a string~\bl{$s$} |
254
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
865 |
provided |
5 | 866 |
|
867 |
\begin{center} |
|
254
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
868 |
\bl{$s \in L(r)$}\\ |
5 | 869 |
\end{center} |
330
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
870 |
\end{bubble}\bigskip\bigskip |
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
871 |
|
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
872 |
\ldots and the point of the next lecture is |
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
873 |
to decide this problem as fast as possible (unlike Python, |
428
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
874 |
Ruby, Java) |
5 | 875 |
|
254
dcd4688690ce
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
253
diff
changeset
|
876 |
\end{frame} |
5 | 877 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
878 |
||
631 | 879 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
880 |
\begin{frame}[c] |
|
881 |
\frametitle{The Power Operation} |
|
882 |
||
883 |
\begin{itemize} |
|
884 |
\item The \alert{\textbf{\boldmath$n$th Power}} of a language: |
|
885 |
||
886 |
\begin{center} |
|
887 |
\begin{tabular}{lcl} |
|
888 |
\bl{$A^0$} & \bl{$\dn$} & \bl{$\{[]\}$}\\ |
|
889 |
\bl{$A^{n+1}$} & \bl{$\dn$} & \bl{$A \,@\, A^n$} |
|
890 |
\end{tabular} |
|
891 |
\end{center}\bigskip |
|
892 |
||
893 |
\item[] For example |
|
894 |
||
895 |
\begin{center} |
|
896 |
\begin{tabular}{lcl@{\hspace{10mm}}l} |
|
897 |
\bl{$A^4$} & \bl{$=$} & \bl{$A \,@\, A \,@\, A \,@\, A$} & \bl{$(@\,\{[]\})$}\\ |
|
898 |
\bl{$A^1$} & \bl{$=$} & \bl{$A$} & \bl{$(@\,\{[]\})$}\\ |
|
899 |
\bl{$A^0$} & \bl{$=$} & \bl{$\{[]\}$}\\ |
|
900 |
\end{tabular} |
|
901 |
\end{center} |
|
902 |
||
903 |
\end{itemize} |
|
904 |
||
905 |
\end{frame} |
|
906 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
907 |
||
908 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
909 |
\begin{frame}[c] |
|
910 |
\frametitle{Questions} |
|
911 |
||
912 |
\begin{itemize} |
|
913 |
\item Say \bl{$A = \{[a],[b],[c],[d]\}$}.\bigskip |
|
914 |
||
915 |
\item[] |
|
916 |
How many strings are in \bl{$A^4$}\,? |
|
917 |
\bigskip\medskip\pause |
|
918 |
||
919 |
||
920 |
\item[] |
|
921 |
What if \bl{$A = \{[a],[b],[c],[]\}$};\\ |
|
922 |
how many strings are then in \bl{$A^4$}\,? |
|
923 |
\end{itemize} |
|
924 |
||
925 |
\end{frame} |
|
926 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
927 |
||
928 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
929 |
\begin{frame}[c] |
|
930 |
\frametitle{The Star Operation} |
|
931 |
||
932 |
\begin{itemize} |
|
933 |
\item The \alert{\bf Kleene Star} of a \underline{language}: |
|
934 |
\bigskip |
|
935 |
||
936 |
\begin{center} |
|
937 |
\begin{tabular}{c} |
|
938 |
\bl{$A\star \dn \bigcup_{0\le n} A^n$} |
|
939 |
\end{tabular} |
|
940 |
\end{center}\bigskip |
|
941 |
||
942 |
\item[] This expands to |
|
943 |
||
944 |
\[ |
|
945 |
\bl{A^0 \cup A^1 \cup A^2 \cup A^3 \cup A^4 \cup \ldots} |
|
946 |
\] |
|
947 |
||
948 |
or |
|
949 |
||
950 |
\small |
|
951 |
\[ |
|
952 |
\bl{\{[]\} \;\cup\; A \;\cup\; A\,@\,A \;\cup\; |
|
953 |
A\,@\,A\,@\,A \;\cup\; A\,@\,A\,@\,A\,@\,A \cup \ldots} |
|
954 |
\] |
|
955 |
||
956 |
\end{itemize} |
|
957 |
||
958 |
\end{frame} |
|
959 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
960 |
||
961 |
||
0 | 962 |
|
963 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
964 |
\begin{frame}[c] |
|
253
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
965 |
\frametitle{Written Exam} |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
966 |
|
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
967 |
\begin{itemize} |
428
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
968 |
\item Accounts for 80\%.\bigskip |
253
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
969 |
|
559 | 970 |
\item The question ``\textit{Is this relevant for |
330
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
971 |
the exam?}'' is very demotivating for the lecturer!\bigskip\\ |
253
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
972 |
|
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
973 |
\item Deal: Whatever is in the homework (and is not marked |
330
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
974 |
``\textit{optional}'') is relevant for the exam.\bigskip |
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
975 |
|
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
976 |
\item Each lecture has also a handout. There are also handouts about |
0806e45d873c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
328
diff
changeset
|
977 |
notation and Scala. |
253
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
978 |
\end{itemize} |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
979 |
|
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
980 |
\end{frame} |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
981 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
982 |
|
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
983 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
984 |
\begin{frame}[t] |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
985 |
\frametitle{Coursework} |
0 | 986 |
|
987 |
\begin{itemize} |
|
428
a47c4227a0c6
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
334
diff
changeset
|
988 |
\item Accounts for 20\%. Two strands. Choose \alert{\bf one}!\bigskip |
0 | 989 |
\end{itemize} |
990 |
||
255
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
991 |
\begin{columns}[t] |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
992 |
\begin{column}{.5\textwidth} |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
993 |
\underline{\bf Strand 1}\medskip |
253
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
994 |
\begin{itemize} |
631 | 995 |
\item 4 programming tasks: |
253
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
996 |
\begin{itemize} |
631 | 997 |
\item matcher (4\%, 11.10.) |
998 |
\item lexer (5\%, 04.11.) |
|
999 |
\item parser (5\%, 22.11.) |
|
1000 |
\item compiler (6\%, 13.12.) |
|
253
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
1001 |
\end{itemize} |
631 | 1002 |
\item in any lang.~you like,\\ but I want to see the\\ code |
253
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
1003 |
\end{itemize} |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
1004 |
\end{column} |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
1005 |
|
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
1006 |
\hspace{-45pt}\vrule{}\hspace{10pt} |
255
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
1007 |
\begin{column}{.5\textwidth} |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
1008 |
\underline{\bf Strand 2}\smallskip\begin{itemize} |
253
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
1009 |
\item one task: prove the correctness of a regular expression matcher in |
559 | 1010 |
the \underline{Isabelle} theorem prover |
631 | 1011 |
\item 20\%, submission on~13.12.\hspace{-5mm}\mbox{} |
253
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
1012 |
\end{itemize} |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
1013 |
\end{column} |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
1014 |
\end{columns}\medskip |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
1015 |
|
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
1016 |
\small |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
1017 |
\begin{itemize} |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
1018 |
\item Solving more than one strand will {\bf not} give you more |
506 | 1019 |
marks. |
1020 |
||
253
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
1021 |
\end{itemize} |
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
1022 |
|
75c469893514
added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
252
diff
changeset
|
1023 |
\end{frame} |
0 | 1024 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
1025 |
||
255
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
1026 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
1027 |
\begin{frame}[c] |
506 | 1028 |
\frametitle{Lecture Capture} |
1029 |
||
1030 |
\begin{itemize} |
|
559 | 1031 |
\item Hope it works\ldots\pause actually no, it does not!\medskip\pause |
1032 |
\item It is important to use lecture capture wisely\\ (it is only the ``baseline''): |
|
506 | 1033 |
\begin{itemize} |
1034 |
\item Lecture recordings are a study and revision aid. |
|
1035 |
\item Statistically, there is a clear and direct link between attendance and |
|
1036 |
attainment: Students who do not attend lectures, do less well in exams. |
|
1037 |
\end{itemize} |
|
1038 |
||
1039 |
\item Attending a lecture is more than watching it online -- if you do not |
|
1040 |
attend, you miss out! |
|
1041 |
||
1042 |
\end{itemize} |
|
1043 |
||
1044 |
\end{frame} |
|
1045 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
1046 |
||
1047 |
||
1048 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
1049 |
\begin{frame}[c] |
|
255
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
1050 |
\frametitle{\begin{tabular}{c}\\[3cm]\alert{Questions?}\end{tabular}} |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
1051 |
|
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
1052 |
\mbox{} |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
1053 |
\end{frame} |
96a99237fa42
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
254
diff
changeset
|
1054 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
0 | 1055 |
\end{document} |
1056 |
||
1057 |
%%% Local Variables: |
|
1058 |
%%% mode: latex |
|
1059 |
%%% TeX-master: t |
|
1060 |
%%% End: |
|
1061 |