author | Christian Urban <urbanc@in.tum.de> |
Tue, 28 Feb 2017 23:40:37 +0000 | |
changeset 225 | 77d5181490ae |
parent 201 | 2585e2a7a7ab |
permissions | -rw-r--r-- |
197
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
1 |
\documentclass[dvipsnames,14pt,t]{beamer} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2 |
\usepackage{slides} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3 |
\usepackage{langs} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
4 |
\usepackage{graph} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
5 |
\usepackage{data} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
6 |
\usepackage{proof} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
7 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
8 |
% beamer stuff |
201
2585e2a7a7ab
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
198
diff
changeset
|
9 |
\renewcommand{\slidecaption}{ITP ????} |
197
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
10 |
\newcommand{\bl}[1]{\textcolor{blue}{#1}} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
11 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
12 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
13 |
\begin{document} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
14 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
15 |
\begin{frame}[t] |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
16 |
\frametitle{% |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
17 |
\begin{tabular}{@ {}c@ {}} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
18 |
\\ |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
19 |
\Large POSIX Lexing with Derivatives\\[-1.5mm] |
201
2585e2a7a7ab
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
198
diff
changeset
|
20 |
\Large of Regular Expressions\\ |
2585e2a7a7ab
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
198
diff
changeset
|
21 |
\Large (Proof Pearl)\\[-1mm] |
197
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
22 |
\end{tabular}}\bigskip\bigskip\bigskip |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
23 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
24 |
\normalsize |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
25 |
\begin{center} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
26 |
\begin{tabular}{c} |
201
2585e2a7a7ab
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
198
diff
changeset
|
27 |
\small Fahad Ausaf\\ |
2585e2a7a7ab
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
198
diff
changeset
|
28 |
\small King's College London\\ |
197
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
29 |
\\ |
201
2585e2a7a7ab
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
198
diff
changeset
|
30 |
\small joint work with Roy Dyckhoff and Christian Urban |
197
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
31 |
\end{tabular} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
32 |
\end{center} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
33 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
34 |
\end{frame} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
35 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
36 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
37 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
38 |
\begin{frame}[c] |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
39 |
\frametitle{Regular Expressions} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
40 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
41 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
42 |
\begin{textblock}{6}(2,5) |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
43 |
\begin{tabular}{rrl@ {\hspace{13mm}}l} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
44 |
\bl{$r$} & \bl{$::=$} & \bl{$\varnothing$} & null\\ |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
45 |
& \bl{$\mid$} & \bl{$\epsilon$} & empty string\\ |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
46 |
& \bl{$\mid$} & \bl{$c$} & character\\ |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
47 |
& \bl{$\mid$} & \bl{$r_1 \cdot r_2$} & sequence\\ |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
48 |
& \bl{$\mid$} & \bl{$r_1 + r_2$} & alternative / choice\\ |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
49 |
& \bl{$\mid$} & \bl{$r^*$} & star (zero or more)\\ |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
50 |
\end{tabular} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
51 |
\end{textblock} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
52 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
53 |
\end{frame} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
54 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
55 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
56 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
57 |
\begin{frame}[c] |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
58 |
\frametitle{The Derivative of a Rexp} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
59 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
60 |
\large |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
61 |
If \bl{$r$} matches the string \bl{$c\!::\!s$}, what is a regular |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
62 |
expression that matches just \bl{$s$}?\bigskip\bigskip\bigskip\bigskip |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
63 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
64 |
\small |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
65 |
\bl{$der\,c\,r$} gives the answer, Brzozowski (1964), Owens (2005) |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
66 |
``\ldots have been lost in the sands of time\ldots'' |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
67 |
\end{frame} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
68 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
69 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
70 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
71 |
\begin{frame}[c] |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
72 |
\frametitle{Correctness} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
73 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
74 |
It is a relative easy exercise in a theorem prover: |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
75 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
76 |
\begin{center} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
77 |
\bl{$matches(r, s)$} if and only if \bl{$s \in L(r)$} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
78 |
\end{center}\bigskip |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
79 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
80 |
\small |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
81 |
where \bl{$matches(r, s) \dn nullable(ders(r, s))$} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
82 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
83 |
\end{frame} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
84 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
85 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
86 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
87 |
\begin{frame}[c] |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
88 |
\frametitle{POSIX Regex Matching} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
89 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
90 |
Two rules: |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
91 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
92 |
\begin{itemize} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
93 |
\item Longest match rule (``maximal munch rule''): The |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
94 |
longest initial substring matched by any regular expression |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
95 |
is taken as the next token. |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
96 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
97 |
\begin{center} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
98 |
\bl{$\texttt{\Grid{iffoo\VS bla}}$} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
99 |
\end{center}\medskip |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
100 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
101 |
\item Rule priority: |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
102 |
For a particular longest initial substring, the first regular |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
103 |
expression that can match determines the token. |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
104 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
105 |
\begin{center} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
106 |
\bl{$\texttt{\Grid{if\VS bla}}$} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
107 |
\end{center} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
108 |
\end{itemize}\bigskip\pause |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
109 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
110 |
\small |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
111 |
\hfill Kuklewicz: most POSIX matchers are buggy\\ |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
112 |
\footnotesize |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
113 |
\hfill \url{http://www.haskell.org/haskellwiki/Regex_Posix} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
114 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
115 |
\end{frame} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
116 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
117 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
118 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
119 |
\begin{frame}[c] |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
120 |
\frametitle{POSIX Regex Matching} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
121 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
122 |
\begin{itemize} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
123 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
124 |
\item Sulzmann \& Lu came up with a beautiful |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
125 |
idea for how to extend the simple regular expression |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
126 |
matcher to POSIX matching/lexing (FLOPS 2014)\bigskip\bigskip |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
127 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
128 |
\begin{tabular}{@{\hspace{4cm}}c@{}} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
129 |
\includegraphics[scale=0.20]{pics/sulzmann.jpg}\\[-2mm] |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
130 |
\hspace{0cm}\footnotesize Martin Sulzmann |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
131 |
\end{tabular}\bigskip\bigskip |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
132 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
133 |
\item the idea: define an inverse operation to the derivatives |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
134 |
\end{itemize} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
135 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
136 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
137 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
138 |
\end{frame} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
139 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
140 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
141 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
142 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
143 |
\begin{frame}[c] |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
144 |
\frametitle{Regexes and Values} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
145 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
146 |
Regular expressions and their corresponding values |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
147 |
(for \emph{how} a regular expression matched a string): |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
148 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
149 |
\begin{center} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
150 |
\begin{columns} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
151 |
\begin{column}{3cm} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
152 |
\begin{tabular}{@{}rrl@{}} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
153 |
\bl{$r$} & \bl{$::=$} & \bl{$\varnothing$}\\ |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
154 |
& \bl{$\mid$} & \bl{$\epsilon$} \\ |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
155 |
& \bl{$\mid$} & \bl{$c$} \\ |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
156 |
& \bl{$\mid$} & \bl{$r_1 \cdot r_2$}\\ |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
157 |
& \bl{$\mid$} & \bl{$r_1 + r_2$} \\ |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
158 |
\\ |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
159 |
& \bl{$\mid$} & \bl{$r^*$} \\ |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
160 |
\\ |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
161 |
\end{tabular} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
162 |
\end{column} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
163 |
\begin{column}{3cm} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
164 |
\begin{tabular}{@{\hspace{-7mm}}rrl@{}} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
165 |
\bl{$v$} & \bl{$::=$} & \\ |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
166 |
& & \bl{$Empty$} \\ |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
167 |
& \bl{$\mid$} & \bl{$Char(c)$} \\ |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
168 |
& \bl{$\mid$} & \bl{$Seq(v_1,v_2)$}\\ |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
169 |
& \bl{$\mid$} & \bl{$Left(v)$} \\ |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
170 |
& \bl{$\mid$} & \bl{$Right(v)$} \\ |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
171 |
& \bl{$\mid$} & \bl{$[]$} \\ |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
172 |
& \bl{$\mid$} & \bl{$[v_1,\ldots\,v_n]$} \\ |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
173 |
\end{tabular} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
174 |
\end{column} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
175 |
\end{columns} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
176 |
\end{center}\pause |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
177 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
178 |
There is also a notion of a string behind a value: \bl{$|v|$} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
179 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
180 |
\end{frame} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
181 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
182 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
183 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
184 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
185 |
\begin{frame}[c] |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
186 |
\frametitle{Sulzmann \& Lu Matcher} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
187 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
188 |
We want to match the string \bl{$abc$} using \bl{$r_1$}: |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
189 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
190 |
\begin{center} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
191 |
\begin{tikzpicture}[scale=2,node distance=1.3cm,every node/.style={minimum size=8mm}] |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
192 |
\node (r1) {\bl{$r_1$}}; |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
193 |
\node (r2) [right=of r1] {\bl{$r_2$}}; |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
194 |
\draw[->,line width=1mm] (r1) -- (r2) node[above,midway] {\bl{$der\,a$}};\pause |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
195 |
\node (r3) [right=of r2] {\bl{$r_3$}}; |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
196 |
\draw[->,line width=1mm] (r2) -- (r3) node[above,midway] {\bl{$der\,b$}};\pause |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
197 |
\node (r4) [right=of r3] {\bl{$r_4$}}; |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
198 |
\draw[->,line width=1mm] (r3) -- (r4) node[above,midway] {\bl{$der\,c$}};\pause |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
199 |
\draw (r4) node[anchor=west] {\;\raisebox{3mm}{\bl{$\;\;nullable?$}}};\pause |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
200 |
\node (v4) [below=of r4] {\bl{$v_4$}}; |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
201 |
\draw[->,line width=1mm] (r4) -- (v4);\pause |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
202 |
\node (v3) [left=of v4] {\bl{$v_3$}}; |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
203 |
\draw[->,line width=1mm] (v4) -- (v3) node[below,midway] {\bl{$inj\,c$}};\pause |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
204 |
\node (v2) [left=of v3] {\bl{$v_2$}}; |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
205 |
\draw[->,line width=1mm] (v3) -- (v2) node[below,midway] {\bl{$inj\,b$}};\pause |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
206 |
\node (v1) [left=of v2] {\bl{$v_1$}}; |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
207 |
\draw[->,line width=1mm] (v2) -- (v1) node[below,midway] {\bl{$inj\,a$}};\pause |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
208 |
\draw[->,line width=0.5mm] (r3) -- (v3); |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
209 |
\draw[->,line width=0.5mm] (r2) -- (v2); |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
210 |
\draw[->,line width=0.5mm] (r1) -- (v1); |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
211 |
\draw (r4) node[anchor=north west] {\;\raisebox{-8mm}{\bl{$mkeps$}}}; |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
212 |
\end{tikzpicture} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
213 |
\end{center} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
214 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
215 |
\only<10>{ |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
216 |
The original ideas of Sulzmann and Lu are the \bl{\textit{mkeps}} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
217 |
and \bl{\textit{inj}} functions (ommitted here).} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
218 |
\end{frame} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
219 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
220 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
221 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
222 |
\begin{frame}[t,squeeze] |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
223 |
\frametitle{Sulzmann \& Lu Paper} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
224 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
225 |
\begin{itemize} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
226 |
\item I have no doubt the algorithm is correct --- |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
227 |
the problem is I do not believe their proof. |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
228 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
229 |
\begin{center} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
230 |
\begin{bubble}[10cm]\small |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
231 |
``How could I miss this? Well, I was rather careless when |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
232 |
stating this Lemma :)\smallskip |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
233 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
234 |
Great example how formal machine checked proofs (and |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
235 |
proof assistants) can help to spot flawed reasoning steps.'' |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
236 |
\end{bubble} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
237 |
\end{center}\pause |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
238 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
239 |
\begin{center} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
240 |
\begin{bubble}[10cm]\small |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
241 |
``Well, I don't think there's any flaw. The issue is how to |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
242 |
come up with a mechanical proof. In my world mathematical |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
243 |
proof $=$ mechanical proof doesn't necessarily hold.'' |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
244 |
\end{bubble} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
245 |
\end{center}\pause |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
246 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
247 |
\end{itemize} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
248 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
249 |
\only<3>{% |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
250 |
\begin{textblock}{11}(1,4.4) |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
251 |
\begin{center} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
252 |
\begin{bubble}[10.9cm]\small\centering |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
253 |
\includegraphics[scale=0.37]{pics/msbug.png} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
254 |
\end{bubble} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
255 |
\end{center} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
256 |
\end{textblock}} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
257 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
258 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
259 |
\end{frame} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
260 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
261 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
262 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
263 |
\begin{frame}[c] |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
264 |
\frametitle{\begin{tabular}{c}The Proof Idea\\[-1mm] by Sulzmann \& Lu |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
265 |
\end{tabular}} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
266 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
267 |
\begin{itemize} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
268 |
\item introduce an inductively defined ordering relation |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
269 |
\bl{$v \succ_r v'$} which captures the idea of POSIX matching |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
270 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
271 |
\item the algorithm returns the maximum of all possible |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
272 |
values that are possible for a regular expression.\pause |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
273 |
\bigskip\small |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
274 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
275 |
\item the idea is from a paper by Cardelli \& Frisch about |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
276 |
GREEDY matching (GREEDY $=$ preferring instant gratification to delayed |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
277 |
repletion): |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
278 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
279 |
\item e.g.~given \bl{$(a + (b + ab))^*$} and string \bl{$ab$} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
280 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
281 |
\begin{center} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
282 |
\begin{tabular}{ll} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
283 |
GREEDY: & \bl{$[Left(a), Right(Left(b)]$}\\ |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
284 |
POSIX: & \bl{$[Right(Right(Seq(a, b))))]$} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
285 |
\end{tabular} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
286 |
\end{center} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
287 |
\end{itemize} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
288 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
289 |
\end{frame} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
290 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
291 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
292 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
293 |
\begin{frame}[c] |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
294 |
\frametitle{} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
295 |
\centering |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
296 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
297 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
298 |
\bl{\infer{\vdash Empty : \epsilon}{}}\hspace{15mm} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
299 |
\bl{\infer{\vdash Char(c): c}{}}\bigskip |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
300 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
301 |
\bl{\infer{\vdash Seq(v_1, v_2) : r_1\cdot r_2}{\vdash v_1 : r_1 \quad \vdash v_2 : r_2}} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
302 |
\bigskip |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
303 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
304 |
\bl{\infer{\vdash Left(v) : r_1 + r_2}{\vdash v : r_1}}\hspace{15mm} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
305 |
\bl{\infer{\vdash Right(v): r_1 + r_2}{\vdash v : r_2}}\bigskip |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
306 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
307 |
\bl{\infer{\vdash [] : r^*}{}}\hspace{15mm} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
308 |
\bl{\infer{\vdash [v_1,\ldots, v_n] : r^*} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
309 |
{\vdash v_1 : r \quad\ldots\quad \vdash v_n : r}} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
310 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
311 |
\end{frame} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
312 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
313 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
314 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
315 |
\begin{frame}<1>[c] |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
316 |
\frametitle{} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
317 |
\small |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
318 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
319 |
%\begin{tabular}{@{}lll@{}} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
320 |
%\bl{$POSIX(v, r)$} & \bl{$\dn$} & \bl{$\vdash v : r$}\\ |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
321 |
% & & \bl{$\wedge \;\;(\forall v'.\;\; \vdash v' : r \,\wedge\, |v'| = |v| |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
322 |
% \Rightarrow v \succ_{\alert<2>{r}} v')$} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
323 |
%\end{tabular}\bigskip\bigskip\bigskip |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
324 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
325 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
326 |
\centering |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
327 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
328 |
%\bl{\infer{Seq(v_1, v_2) \succ_{\alert<2>{r_1\cdot r_2}} Seq(v'_1, v'_2)} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
329 |
% {v_1 = v'_1 \quad v_2 \succ_{\alert<2>{r_2}} v'_2}}\hspace{3mm} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
330 |
%\bl{\infer{Seq(v_1, v_2) \succ_{\alert<2>{r_1\cdot r_2}} Seq(v'_1, v'_2)} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
331 |
% {v_1 \not= v'_1 \quad v_1 \succ_{\alert<2>{r_1}} v'_1}} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
332 |
%\bigskip |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
333 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
334 |
%\bl{\infer{Left(v) \succ_{\alert<2>{r_1 + r_2}} Left(v')} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
335 |
% {v \succ_{\alert<2>{r_1}} v'}}\hspace{15mm} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
336 |
%\bl{\infer{Right(v) \succ_{\alert<2>{r_1 + r_2}} Right(v')} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
337 |
% {v \succ_{\alert<2>{r_2}} v'}}\bigskip\medskip |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
338 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
339 |
%\bl{\infer{Left(v) \succ_{\alert<2>{r_1 + r_2}} Right(v')} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
340 |
% {length |v| \ge length |v'|}}\hspace{15mm} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
341 |
%\bl{\infer{Right(v) \succ_{\alert<2>{r_1 + r_2}} Left(v')} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
342 |
% {length |v| > length |v'|}}\bigskip |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
343 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
344 |
%\bl{$\big\ldots$} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
345 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
346 |
\end{frame} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
347 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
348 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
349 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
350 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
351 |
\begin{frame}[c] |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
352 |
\frametitle{Problems} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
353 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
354 |
\begin{itemize} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
355 |
\item Sulzmann: \ldots Let's assume \bl{$v$} is not |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
356 |
a $POSIX$ value, then there must be another one |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
357 |
\ldots contradiction.\bigskip\pause |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
358 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
359 |
\item Exists? |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
360 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
361 |
\begin{center} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
362 |
\bl{$L(r) \not= \varnothing \;\Rightarrow\; \exists v.\;POSIX(v, r)$} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
363 |
\end{center}\bigskip\bigskip\pause |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
364 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
365 |
\item in the sequence case |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
366 |
\bl{$Seq(v_1, v_2)\succ_{r_1\cdot r_2} Seq(v_1', v_2')$}, |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
367 |
the induction hypotheses require |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
368 |
\bl{$|v_1| = |v'_1|$} and \bl{$|v_2| = |v'_2|$}, |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
369 |
but you only know |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
370 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
371 |
\begin{center} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
372 |
\bl{$|v_1| \;@\; |v_2| = |v'_1| \;@\; |v'_2|$} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
373 |
\end{center}\pause\small |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
374 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
375 |
\item although one begins with the assumption that the two |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
376 |
values have the same flattening, this cannot be maintained |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
377 |
as one descends into the induction (alternative, sequence) |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
378 |
\end{itemize} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
379 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
380 |
\end{frame} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
381 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
382 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
383 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
384 |
\begin{frame}[c] |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
385 |
\frametitle{Our Solution} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
386 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
387 |
\begin{itemize} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
388 |
\item a direct definition of what a POSIX value is, using |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
389 |
the relation \bl{$s \in r \to v$} (specification):\medskip |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
390 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
391 |
\begin{center} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
392 |
\bl{\infer{[] \in \epsilon \to Empty}{}}\hspace{15mm} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
393 |
\bl{\infer{c \in c \to Char(c)}{}}\bigskip\medskip |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
394 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
395 |
\bl{\infer{s \in r_1 + r_2 \to Left(v)} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
396 |
{s \in r_1 \to v}}\hspace{10mm} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
397 |
\bl{\infer{s \in r_1 + r_2 \to Right(v)} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
398 |
{s \in r_2 \to v & s \not\in L(r_1)}}\bigskip\medskip |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
399 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
400 |
\bl{\infer{s_1 @ s_2 \in r_1 \cdot r_2 \to Seq(v_1, v_2)} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
401 |
{\small\begin{array}{l} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
402 |
s_1 \in r_1 \to v_1 \\ |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
403 |
s_2 \in r_2 \to v_2 \\ |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
404 |
\neg(\exists s_3\,s_4.\; s_3 \not= [] |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
405 |
\wedge s_3 @ s_4 = s_2 \wedge |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
406 |
s_1 @ s_3 \in L(r_1) \wedge |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
407 |
s_4 \in L(r_2)) |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
408 |
\end{array}}} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
409 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
410 |
\bl{\ldots} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
411 |
\end{center} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
412 |
\end{itemize} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
413 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
414 |
\end{frame} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
415 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
416 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
417 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
418 |
\begin{frame}[c] |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
419 |
\frametitle{Properties} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
420 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
421 |
It is almost trival to prove: |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
422 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
423 |
\begin{itemize} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
424 |
\item Uniqueness |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
425 |
\begin{center} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
426 |
If \bl{$s \in r \to v_1$} and \bl{$s \in r \to v_2$} then |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
427 |
\bl{$v_1 = v_2$}. |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
428 |
\end{center}\bigskip |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
429 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
430 |
\item Correctness |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
431 |
\begin{center} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
432 |
\bl{$lexer(r, s) = v$} if and only if \bl{$s \in r \to v$} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
433 |
\end{center} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
434 |
\end{itemize}\bigskip\bigskip\pause |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
435 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
436 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
437 |
You can now start to implement optimisations and derive |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
438 |
correctness proofs for them. But we still do not know whether |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
439 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
440 |
\begin{center} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
441 |
\bl{$s \in r \to v$} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
442 |
\end{center} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
443 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
444 |
is a POSIX value according to Sulzmann \& Lu's definition |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
445 |
(biggest value for \bl{$s$} and \bl{$r$}) |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
446 |
\end{frame} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
447 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
448 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
449 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
450 |
\begin{frame}[c] |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
451 |
\frametitle{Conclusion} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
452 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
453 |
\begin{itemize} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
454 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
455 |
\item we replaced the POSIX definition of Sulzmann \& Lu by a |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
456 |
new definition (ours is inspired by work of Vansummeren, |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
457 |
2006)\medskip |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
458 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
459 |
\item their proof contained small gaps (acknowledged) but had |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
460 |
also fundamental flaws\medskip |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
461 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
462 |
\item now, its a nice exercise for theorem proving\medskip |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
463 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
464 |
\item some optimisations need to be applied to the algorithm |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
465 |
in order to become fast enough\medskip |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
466 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
467 |
\item can be used for lexing, is a small beautiful functional |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
468 |
program |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
469 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
470 |
\end{itemize} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
471 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
472 |
\end{frame} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
473 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
474 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
475 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
476 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
477 |
\begin{frame}[b] |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
478 |
\frametitle{ |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
479 |
\begin{tabular}{c} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
480 |
\mbox{}\\[13mm] |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
481 |
\alert{\LARGE Questions?} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
482 |
\end{tabular}} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
483 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
484 |
\end{frame} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
485 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
486 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
487 |
\end{document} |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
488 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
489 |
|
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
490 |
%%% Local Variables: |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
491 |
%%% mode: latex |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
492 |
%%% TeX-master: t |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
493 |
%%% End: |
a35041d5707c
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
494 |