388
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
1 |
\documentclass[dvipsnames,14pt,t]{beamer}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2 |
\usepackage{../slides}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3 |
\usepackage{../langs}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
4 |
\usepackage{../data}
|
871
|
5 |
\usepackage{../graphicss}
|
388
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
6 |
\usepackage{soul}
|
471
|
7 |
\usepackage{proof}
|
388
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
8 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
9 |
% beamer stuff
|
458
|
10 |
\renewcommand{\slidecaption}{CFL, King's College London}
|
388
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
11 |
\newcommand{\bl}[1]{\textcolor{blue}{#1}}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
12 |
|
871
|
13 |
%\newcommand\grid[1]{%
|
|
14 |
% \begin{tikzpicture}[baseline=(char.base)]
|
|
15 |
% \path[use as bounding box]
|
|
16 |
% (0,0) rectangle (1em,1em);
|
|
17 |
% \draw[red!50, fill=red!20]
|
|
18 |
% (0,0) rectangle (1em,1em);
|
|
19 |
% \node[inner sep=1pt,anchor=base west]
|
|
20 |
% (char) at (0em,\gridraiseamount) {#1};
|
|
21 |
% \end{tikzpicture}}
|
|
22 |
%\newcommand\gridraiseamount{0.12em}
|
471
|
23 |
|
871
|
24 |
%\makeatletter
|
|
25 |
%\newcommand\Grid[1]{%
|
|
26 |
% \@tfor\z:=#1\do{\grid{\z}}}
|
|
27 |
%\makeatother
|
471
|
28 |
|
871
|
29 |
%\newcommand\Vspace[1][.3em]{%
|
|
30 |
% \mbox{\kern.06em\vrule height.3ex}%
|
|
31 |
% \vbox{\hrule width#1}%
|
|
32 |
% \hbox{\vrule height.3ex}}
|
471
|
33 |
|
871
|
34 |
%\def\VS{\Vspace[0.6em]}
|
471
|
35 |
|
388
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
36 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
37 |
\begin{document}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
38 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
39 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
40 |
\begin{frame}[t]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
41 |
\frametitle{%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
42 |
\begin{tabular}{@ {}c@ {}}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
43 |
\\[-3mm]
|
458
|
44 |
\LARGE Compilers and \\[-2mm]
|
388
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
45 |
\LARGE Formal Languages\\[3mm]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
46 |
\end{tabular}}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
47 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
48 |
\normalsize
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
49 |
\begin{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
50 |
\begin{tabular}{ll}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
51 |
Email: & christian.urban at kcl.ac.uk\\
|
500
|
52 |
Office: & N7.07 (North Wing, Bush House)\\
|
388
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
53 |
Slides: & KEATS (also home work is there)\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
54 |
\end{tabular}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
55 |
\end{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
56 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
57 |
\end{frame}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
58 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
59 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
60 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
471
|
61 |
\begin{frame}[c]
|
|
62 |
\frametitle{Compilers \& Boeings 777}
|
|
63 |
|
|
64 |
First flight in 1994. They want to achieve triple redundancy in hardware
|
|
65 |
faults.\bigskip
|
|
66 |
|
|
67 |
They compile 1 Ada program to\medskip
|
|
68 |
|
|
69 |
\begin{itemize}
|
|
70 |
\item Intel 80486
|
|
71 |
\item Motorola 68040 (old Macintosh's)
|
|
72 |
\item AMD 29050 (RISC chips used often in laser printers)
|
|
73 |
\end{itemize}\medskip
|
|
74 |
|
|
75 |
using 3 independent compilers.\bigskip\pause
|
|
76 |
|
|
77 |
\small Airbus uses C and static analysers. Recently started using CompCert.
|
|
78 |
|
|
79 |
\end{frame}
|
|
80 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
81 |
|
|
82 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
83 |
\begin{frame}[c]
|
|
84 |
\frametitle{seL4 / Isabelle}
|
|
85 |
|
|
86 |
\begin{itemize}
|
|
87 |
\item verified a microkernel operating system ($\approx$8000 lines of C code)\bigskip
|
|
88 |
\item US DoD has competitions to hack into drones; they found that the
|
|
89 |
isolation guarantees of seL4 hold up\bigskip
|
|
90 |
\item CompCert and seL4 sell their code
|
|
91 |
\end{itemize}
|
|
92 |
|
|
93 |
\end{frame}
|
|
94 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
95 |
|
|
96 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
97 |
\begin{frame}[c]
|
|
98 |
\frametitle{POSIX Matchers}
|
|
99 |
|
|
100 |
\begin{itemize}
|
|
101 |
\item Longest match rule (``maximal munch rule''): The
|
|
102 |
longest initial substring matched by any regular expression
|
|
103 |
is taken as the next token.
|
|
104 |
|
|
105 |
\begin{center}
|
|
106 |
\bl{$\texttt{\Grid{iffoo\VS bla}}$}
|
|
107 |
\end{center}\medskip
|
|
108 |
|
|
109 |
\item Rule priority:
|
|
110 |
For a particular longest initial substring, the first regular
|
|
111 |
expression that can match determines the token.
|
|
112 |
|
|
113 |
\begin{center}
|
|
114 |
\bl{$\texttt{\Grid{if\VS bla}}$}
|
|
115 |
\end{center}
|
|
116 |
\end{itemize}\bigskip\pause
|
|
117 |
|
|
118 |
\small
|
|
119 |
\hfill Kuklewicz: most POSIX matchers are buggy\\
|
|
120 |
\footnotesize
|
|
121 |
\hfill \url{http://www.haskell.org/haskellwiki/Regex_Posix}
|
|
122 |
|
|
123 |
\end{frame}
|
|
124 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
125 |
|
|
126 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
127 |
\begin{frame}[c]
|
|
128 |
\mbox{}\\[-14mm]\mbox{}
|
|
129 |
\small
|
|
130 |
\bl{
|
|
131 |
\begin{center}
|
|
132 |
\begin{tabular}{lcl}
|
|
133 |
$\textit{der}\;c\;(\ZERO)$ & $\dn$ & $\ZERO$\\
|
|
134 |
$\textit{der}\;c\;(\ONE)$ & $\dn$ & $\ZERO$\\
|
|
135 |
$\textit{der}\;c\;(d)$ & $\dn$ & $\textit{if}\; c = d\;\textit{then} \;\ONE \; \textit{else} \;\ZERO$\\
|
|
136 |
$\textit{der}\;c\;(r_1 + r_2)$ & $\dn$ & $(\textit{der}\;c\;r_1) + (\textit{der}\;c\;r_2)$\\
|
|
137 |
$\textit{der}\;c\;(r_1 \cdot r_2)$ & $\dn$ & $\textit{if}\;\textit{nullable}(r_1)$\\
|
|
138 |
& & $\textit{then}\;((\textit{der}\;c\;r_1)\cdot r_2) + (\textit{der}\;c\;r_2)$\\
|
|
139 |
& & $\textit{else}\;(\textit{der}\;c\;r_1)\cdot r_2$\\
|
|
140 |
$\textit{der}\;c\;(r^*)$ & $\dn$ & $(\textit{der}\;c\;r)\cdot (r^*)$\\
|
|
141 |
$\textit{der}\;c\;(r^{\{n\}})$ & $\dn$ & \textit{if} $n=0$ \textit{then} $\ZERO$\\
|
|
142 |
& & \textit{else if} $\textit{nullable}(r)$ \textit{then} $(\textit{der}\;c\;r)\cdot (r^{\{\uparrow n-1\}})$\\
|
|
143 |
& & \textit{else} $(\textit{der}\;c\;r)\cdot (r^{\{n-1\}})$\\
|
|
144 |
$\textit{der}\;c\;(r^{\{\uparrow n\}})$ & $\dn$ & \textit{if} $n=0$ \textit{then} $\ZERO$\\
|
|
145 |
& & \textit{else}
|
|
146 |
$(\textit{der}\;c\;r)\cdot (r^{\{\uparrow n-1\}})$\\
|
|
147 |
\end{tabular}
|
|
148 |
\end{center}}
|
|
149 |
|
|
150 |
\end{frame}
|
|
151 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
152 |
|
|
153 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
154 |
\begin{frame}[t]
|
|
155 |
\frametitle{Proofs about Rexps}
|
|
156 |
|
|
157 |
Remember their inductive definition:
|
|
158 |
|
|
159 |
\begin{center}
|
|
160 |
\begin{tabular}{@ {}rrl}
|
|
161 |
\bl{$r$} & \bl{$::=$} & \bl{$\ZERO$}\\
|
|
162 |
& \bl{$\mid$} & \bl{$\ONE$} \\
|
|
163 |
& \bl{$\mid$} & \bl{$c$} \\
|
|
164 |
& \bl{$\mid$} & \bl{$r_1 \cdot r_2$}\\
|
|
165 |
& \bl{$\mid$} & \bl{$r_1 + r_2$} \\
|
|
166 |
& \bl{$\mid$} & \bl{$r^*$} \\
|
|
167 |
& \bl{$\mid$} & \bl{$r^{\{n\}}$} \\
|
|
168 |
& \bl{$\mid$} & \bl{$r^{\{\uparrow n\}}$} \\
|
|
169 |
\end{tabular}
|
|
170 |
\end{center}
|
|
171 |
|
|
172 |
If we want to prove something, say a property \bl{$P(r)$}, for all regular expressions \bl{$r$} then \ldots
|
|
173 |
|
|
174 |
\end{frame}
|
|
175 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
176 |
|
|
177 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
178 |
\begin{frame}[c]
|
|
179 |
\frametitle{Proofs about Rexp (2)}
|
|
180 |
|
|
181 |
\begin{itemize}
|
|
182 |
\item \bl{$P$} holds for \bl{$\ZERO$}, \bl{$\ONE$} and \bl{c}\bigskip
|
|
183 |
\item \bl{$P$} holds for \bl{$r_1 + r_2$} under the assumption that \bl{$P$} already
|
|
184 |
holds for \bl{$r_1$} and \bl{$r_2$}.\bigskip
|
|
185 |
\item \bl{$P$} holds for \bl{$r_1 \cdot r_2$} under the assumption that \bl{$P$} already
|
|
186 |
holds for \bl{$r_1$} and \bl{$r_2$}.\bigskip
|
|
187 |
\item \bl{$P$} holds for \bl{$r^*$} under the assumption that \bl{$P$} already
|
|
188 |
holds for \bl{$r$}.
|
|
189 |
\item \ldots
|
|
190 |
\end{itemize}
|
|
191 |
|
|
192 |
\end{frame}
|
|
193 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
194 |
|
|
195 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
196 |
\begin{frame}[c]
|
|
197 |
\frametitle{Proofs about Strings}
|
|
198 |
|
|
199 |
If we want to prove something, say a property \bl{$P(s)$}, for all
|
|
200 |
strings \bl{$s$} then \ldots\bigskip
|
|
201 |
|
|
202 |
\begin{itemize}
|
|
203 |
\item \bl{$P$} holds for the empty string, and\medskip
|
|
204 |
\item \bl{$P$} holds for the string \bl{$c\!::\!s$} under the assumption that \bl{$P$}
|
|
205 |
already holds for \bl{$s$}
|
|
206 |
\end{itemize}
|
|
207 |
\end{frame}
|
|
208 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
209 |
|
|
210 |
|
|
211 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
212 |
%\begin{frame}[c]
|
|
213 |
%
|
|
214 |
%\bl{\begin{center}
|
|
215 |
%\begin{tabular}{@ {}l@ {\hspace{2mm}}c@ {\hspace{2mm}}l@ {}}
|
|
216 |
%$zeroable(\varnothing)$ & $\dn$ & \textit{true}\\
|
|
217 |
%$zeroable(\epsilon)$ & $\dn$ & \textit{false}\\
|
|
218 |
%$zeroable (c)$ & $\dn$ & \textit{false}\\
|
|
219 |
%$zeroable (r_1 + r_2)$ & $\dn$ & $zeroable(r_1) \wedge zeroable(r_2)$ \\
|
|
220 |
%$zeroable (r_1 \cdot r_2)$ & $\dn$ & $zeroable(r_1) \vee zeroable(r_2)$ \\
|
|
221 |
%$zeroable (r^*)$ & $\dn$ & \textit{false}\\
|
|
222 |
%\end{tabular}
|
|
223 |
%\end{center}}
|
|
224 |
|
|
225 |
%\begin{center}
|
|
226 |
%\bl{$zeroable(r)$} if and only if \bl{$L(r) = \{\}$}
|
|
227 |
%\end{center}
|
|
228 |
|
|
229 |
%\end{frame}
|
|
230 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
231 |
|
|
232 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
233 |
\begin{frame}[c]
|
|
234 |
\frametitle{Correctness of the Matcher}
|
|
235 |
|
|
236 |
\begin{itemize}
|
|
237 |
\item We want to prove\medskip
|
|
238 |
\begin{center}
|
|
239 |
\bl{$matches\;r\;s$} if and only if \bl{$s\in L(r)$}
|
|
240 |
\end{center}\bigskip
|
|
241 |
|
|
242 |
where \bl{$matches\;r\;s \dn nullable(ders\;s\;r)$}
|
|
243 |
\bigskip\pause
|
|
244 |
|
|
245 |
\item We can do this, if we know\medskip
|
|
246 |
\begin{center}
|
|
247 |
\bl{$L(der\;c\;r) = Der\;c\;(L(r))$}
|
|
248 |
\end{center}
|
|
249 |
\end{itemize}
|
|
250 |
\end{frame}
|
|
251 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
252 |
|
|
253 |
|
|
254 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
255 |
\begin{frame}[c]
|
|
256 |
\frametitle{Some Lemmas}
|
|
257 |
|
|
258 |
\begin{itemize}
|
|
259 |
\item \bl{$Der\;c\;(A\cup B) =
|
|
260 |
(Der\;c\;A)\cup(Der\;c\;B)$}\bigskip
|
|
261 |
\item If \bl{$[] \in A$} then
|
|
262 |
\begin{center}
|
|
263 |
\bl{$Der\;c\;(A\,@\,B) = (Der\;c\;A)\,@\,B \;\cup\; (Der\;c\;B)$}
|
|
264 |
\end{center}\bigskip
|
|
265 |
\item If \bl{$[] \not\in A$} then
|
|
266 |
\begin{center}
|
|
267 |
\bl{$Der\;c\;(A\,@\,B) = (Der\;c\;A)\,@\,B$}
|
|
268 |
\end{center}\bigskip
|
|
269 |
\item \bl{$Der\;c\;(A^*) = (Der\;c\;A)\,@\,A^*$}\\
|
|
270 |
\small\mbox{}\hfill (interesting case)\\
|
|
271 |
\end{itemize}
|
|
272 |
|
|
273 |
\end{frame}
|
|
274 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
275 |
|
|
276 |
|
|
277 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
278 |
\begin{frame}[c]
|
|
279 |
\frametitle{Why?}
|
|
280 |
|
|
281 |
Why does \bl{$Der\;c\;(A^*) = (Der\;c\;A)\,@\,A^*$} hold?
|
|
282 |
\bigskip
|
|
283 |
|
|
284 |
|
|
285 |
\begin{center}
|
|
286 |
\begin{tabular}{lcl}
|
|
287 |
\bl{$Der\;c\;(A^*)$} & \bl{$=$} & \bl{$Der\;c\;(A^* - \{[]\})$}\medskip\\
|
|
288 |
& \bl{$=$} & \bl{$Der\;c\;((A - \{[]\})\,@\,A^*)$}\medskip\\
|
|
289 |
& \bl{$=$} & \bl{$(Der\;c\;(A - \{[]\}))\,@\,A^*$}\medskip\\
|
|
290 |
& \bl{$=$} & \bl{$(Der\;c\;A)\,@\,A^*$}\medskip\\
|
|
291 |
\end{tabular}
|
|
292 |
\end{center}\bigskip\bigskip
|
|
293 |
|
|
294 |
\small
|
|
295 |
using the facts \bl{$Der\;c\;A = Der\;c\;(A - \{[]\})$} and\\
|
|
296 |
\mbox{}\hfill\bl{$(A - \{[]\}) \,@\, A^* = A^* - \{[]\}$}
|
|
297 |
\end{frame}
|
|
298 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
299 |
|
|
300 |
|
|
301 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
302 |
\begin{frame}[c]
|
|
303 |
\frametitle{POSIX Spec}
|
|
304 |
|
|
305 |
\begin{center}
|
|
306 |
\bl{\infer{[] \in \ONE \to Empty}{}}\hspace{15mm}
|
|
307 |
\bl{\infer{c \in c \to Char(c)}{}}\bigskip\medskip
|
|
308 |
|
|
309 |
\bl{\infer{s \in r_1 + r_2 \to Left(v)}
|
|
310 |
{s \in r_1 \to v}}\hspace{10mm}
|
|
311 |
\bl{\infer{s \in r_1 + r_2 \to Right(v)}
|
|
312 |
{s \in r_2 \to v & s \not\in L(r_1)}}\bigskip\medskip
|
|
313 |
|
|
314 |
\bl{\infer{s_1 @ s_2 \in r_1 \cdot r_2 \to Seq(v_1, v_2)}
|
|
315 |
{\small\begin{array}{l}
|
|
316 |
s_1 \in r_1 \to v_1 \\
|
|
317 |
s_2 \in r_2 \to v_2 \\
|
|
318 |
\neg(\exists s_3\,s_4.\; s_3 \not= []
|
|
319 |
\wedge s_3 @ s_4 = s_2 \wedge
|
|
320 |
s_1 @ s_3 \in L(r_1) \wedge
|
|
321 |
s_4 \in L(r_2))
|
|
322 |
\end{array}}}
|
|
323 |
|
|
324 |
\bl{\ldots}
|
|
325 |
\end{center}
|
|
326 |
|
|
327 |
|
|
328 |
\end{frame}
|
|
329 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
330 |
|
|
331 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
332 |
\begin{frame}[t,squeeze]
|
|
333 |
\frametitle{Sulzmann \& Lu Paper}
|
|
334 |
|
|
335 |
\begin{itemize}
|
|
336 |
\item I have no doubt the algorithm is correct ---
|
|
337 |
the problem is I do not believe their proof.
|
|
338 |
|
|
339 |
\begin{center}
|
|
340 |
\begin{bubble}[10cm]\small
|
|
341 |
``How could I miss this? Well, I was rather careless when
|
|
342 |
stating this Lemma :)\smallskip
|
|
343 |
|
|
344 |
Great example how formal machine checked proofs (and
|
|
345 |
proof assistants) can help to spot flawed reasoning steps.''
|
|
346 |
\end{bubble}
|
|
347 |
\end{center}\pause
|
|
348 |
|
|
349 |
%\begin{center}
|
|
350 |
%\begin{bubble}[10cm]\small
|
|
351 |
%``Well, I don't think there's any flaw. The issue is how to
|
|
352 |
%come up with a mechanical proof. In my world mathematical
|
|
353 |
%proof $=$ mechanical proof doesn't necessarily hold.''
|
|
354 |
%\end{bubble}
|
|
355 |
%\end{center}\pause
|
|
356 |
|
|
357 |
\end{itemize}
|
|
358 |
|
|
359 |
\only<3>{%
|
|
360 |
\begin{textblock}{11}(1,4.4)
|
|
361 |
\begin{center}
|
|
362 |
\begin{bubble}[10.9cm]\small\centering
|
630
|
363 |
\includegraphics[scale=0.37]{../pics/msbug.png}
|
471
|
364 |
\end{bubble}
|
|
365 |
\end{center}
|
|
366 |
\end{textblock}}
|
|
367 |
|
|
368 |
|
|
369 |
\end{frame}
|
|
370 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
371 |
|
|
372 |
\end{document}
|
|
373 |
|
|
374 |
%%% Local Variables:
|
|
375 |
%%% mode: latex
|
|
376 |
%%% TeX-master: t
|
|
377 |
%%% End:
|
|
378 |
|
|
379 |
|
|
380 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
388
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
381 |
\begin{frame}[t]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
382 |
\frametitle{2nd CW}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
383 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
384 |
Remember we showed that\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
385 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
386 |
\begin{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
387 |
\bl{$der\;c\;(r^+) = (der\;c\;r)\cdot r^*$}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
388 |
\end{center}\bigskip\pause
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
389 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
390 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
391 |
Does the same hold for \bl{$r^{\{n\}}$} with \bl{$n > 0$}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
392 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
393 |
\begin{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
394 |
\bl{$der\;c\;(r^{\{n\}}) = (der\;c\;r)\cdot r^{\{n-1\}}$} ?
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
395 |
\end{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
396 |
\end{frame}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
397 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
398 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
399 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
400 |
\begin{frame}[t]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
401 |
\frametitle{2nd CW}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
402 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
403 |
\begin{itemize}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
404 |
\item \bl{$der$}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
405 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
406 |
\begin{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
407 |
\bl{$der\;c\;(r^{\{n\}}) \dn
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
408 |
\begin{cases}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
409 |
\varnothing & \text{\textcolor{black}{if}}\; n = 0\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
410 |
der\;c\;(r\cdot r^{\{n-1\}}) & \text{\textcolor{black}{o'wise}}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
411 |
\end{cases}$}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
412 |
\end{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
413 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
414 |
\item \bl{$mkeps$}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
415 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
416 |
\begin{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
417 |
\bl{$mkeps(r^{\{n\}}) \dn
|
389
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
418 |
[\underbrace{mkeps(r),\ldots,mkeps(r)}_{n\;times}]$}
|
388
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
419 |
\end{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
420 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
421 |
\item \bl{$inj$}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
422 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
423 |
\begin{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
424 |
\begin{tabular}{l@{\hspace{1mm}}c@{\hspace{1mm}}l}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
425 |
\bl{$inj\;r^{\{n\}}\;c\;(v_1, [vs])$} & \bl{$\dn$} &
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
426 |
\bl{$[inj\;r\;c\;v_1::vs]$}\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
427 |
\bl{$inj\;r^{\{n\}}\;c\;Left(v_1, [vs])$} & \bl{$\dn$} &
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
428 |
\bl{$[inj\;r\;c\;v_1::vs]$}\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
429 |
\bl{$inj\;r^{\{n\}}\;c\;Right([v::vs])$} & \bl{$\dn$} &
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
430 |
\bl{$[mkeps(r)::inj\;r\;c\;v::vs]$}\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
431 |
\end{tabular}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
432 |
\end{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
433 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
434 |
\end{itemize}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
435 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
436 |
\end{frame}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
437 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
438 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
439 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
440 |
\begin{frame}[c]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
441 |
\frametitle{Induction over Strings}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
442 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
443 |
\begin{itemize}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
444 |
\item case \bl{$[]$}:\bigskip
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
445 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
446 |
We need to prove
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
447 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
448 |
\begin{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
449 |
\bl{$\forall r.\;\;nullable(ders\;[]\;r) \;\Leftrightarrow\; [] \in L(r)$}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
450 |
\end{center}\bigskip
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
451 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
452 |
\begin{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
453 |
\bl{$nullable(ders\;[]\;r) \;\dn\; nullable\;r \;\Leftrightarrow\ldots$}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
454 |
\end{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
455 |
\end{itemize}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
456 |
\end{frame}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
457 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
458 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
459 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
460 |
\begin{frame}[c]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
461 |
\frametitle{Induction over Strings}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
462 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
463 |
\begin{itemize}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
464 |
\item case \bl{$c::s$}\bigskip
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
465 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
466 |
We need to prove
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
467 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
468 |
\begin{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
469 |
\bl{$\forall r.\;\;nullable(ders\;(c::s)\;r) \;\Leftrightarrow\; (c::s) \in L(r)$}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
470 |
\end{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
471 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
472 |
We have by IH
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
473 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
474 |
\begin{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
475 |
\bl{$\forall r.\;\;nullable(ders\;s\;r) \;\Leftrightarrow\; s \in L(r)$}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
476 |
\end{center}\bigskip
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
477 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
478 |
\begin{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
479 |
\bl{$ders\;(c::s)\;r \dn ders\;s\;(der\;c\;r)$}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
480 |
\end{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
481 |
\end{itemize}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
482 |
\end{frame}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
483 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
484 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
485 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
486 |
\begin{frame}[c]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
487 |
\frametitle{Induction over Regexps}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
488 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
489 |
\begin{itemize}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
490 |
\item The proof hinges on the fact that we can prove\bigskip
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
491 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
492 |
\begin{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
493 |
\Large\bl{$L(der\;c\;r) = Der\;c\;(L(r))$}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
494 |
\end{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
495 |
\end{itemize}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
496 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
497 |
\end{frame}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
498 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|