author | Chengsong |
Thu, 07 Apr 2022 21:38:01 +0100 | |
changeset 481 | feacb89b784c |
parent 209 | c592ea0661ae |
permissions | -rw-r--r-- |
207
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
1 |
\documentclass{beamer} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2 |
\usepackage{tikz} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3 |
\usepackage[english]{babel} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
4 |
\usepackage{proof} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
5 |
\usetheme{Luebeck} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
6 |
\usetikzlibrary{positioning} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
7 |
\usetikzlibrary{decorations.pathreplacing} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
8 |
\definecolor{darkblue}{rgb}{0,0,.803} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
9 |
\definecolor{cream}{rgb}{1,1,.8} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
10 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
11 |
\newcommand{\smath}[1]{\textcolor{darkblue}{\ensuremath{#1}}} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
12 |
\newcommand{\dn}{\stackrel{\mbox{\scriptsize def}}{=}} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
13 |
\newcommand{\Zero}{{\bf 0}} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
14 |
\newcommand{\One}{{\bf 1}} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
15 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
16 |
\newenvironment{bubble}[1][]{% |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
17 |
\addtolength{\leftmargini}{4mm}% |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
18 |
\begin{tikzpicture}[baseline=(current bounding box.north)]% |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
19 |
\draw (0,0) node[inner sep=2mm,fill=cream,ultra thick,draw=red,rounded corners=2mm]% |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
20 |
\bgroup\begin{minipage}{#1}\raggedright{}} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
21 |
{\end{minipage}\egroup;% |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
22 |
\end{tikzpicture}\bigskip} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
23 |
|
209
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
24 |
\newcommand\grid[1]{% |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
25 |
\begin{tikzpicture}[baseline=(char.base)] |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
26 |
\path[use as bounding box] |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
27 |
(0,0) rectangle (1em,1em); |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
28 |
\draw[red!50, fill=red!20] |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
29 |
(0,0) rectangle (1em,1em); |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
30 |
\node[inner sep=1pt,anchor=base west] |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
31 |
(char) at (0em,\gridraiseamount) {#1}; |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
32 |
\end{tikzpicture}} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
33 |
\newcommand\gridraiseamount{0.12em} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
34 |
|
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
35 |
\makeatletter |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
36 |
\newcommand\Grid[1]{% |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
37 |
\@tfor\z:=#1\do{\grid{\z}}} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
38 |
\makeatother |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
39 |
|
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
40 |
\newcommand\Vspace[1][.3em]{% |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
41 |
\mbox{\kern.06em\vrule height.3ex}% |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
42 |
\vbox{\hrule width#1}% |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
43 |
\hbox{\vrule height.3ex}} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
44 |
|
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
45 |
\def\VS{\Vspace[0.6em]} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
46 |
|
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
47 |
|
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
48 |
\title[POSIX Lexing with Derivatives of Regexes] |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
49 |
{\bf POSIX Lexing with\\ |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
50 |
\bf Derivatives of Regular Expressions\\ |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
51 |
\bf (Proof Pearl)} |
207
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
52 |
\author{Fahad Ausaf, Roy Dyckhoff and Christian Urban} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
53 |
\date{King's College London, University of St Andrews} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
54 |
|
209
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
55 |
|
207
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
56 |
\begin{document} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
57 |
\maketitle |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
58 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
59 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
60 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
61 |
\begin{frame} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
62 |
\frametitle{Brzozowski's Derivatives of Regular Expressions} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
63 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
64 |
Idea: If \smath{r} matches the string \smath{c\!::\!s}, |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
65 |
what is a regular expression that matches just \smath{s}? \\ |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
66 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
67 |
\begin{center} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
68 |
\begin{tabular}{l@{\hspace{5mm}}lcl} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
69 |
chars: |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
70 |
&\smath{\Zero \backslash c} & \smath{\dn} & \smath{\Zero}\\ |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
71 |
&\smath{\One \backslash c} & \smath{\dn} & \smath{\Zero}\\ |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
72 |
&\smath{d \backslash c} & \smath{\dn} & |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
73 |
\smath{\textit{if}\;d = c\;\textit{then}\;\One\;\textit{else}\;\Zero}\\ |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
74 |
&\smath{r_1 + r_2 \backslash c} & \smath{\dn} & |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
75 |
\smath{r_1 \backslash c \,+\, r_2 \backslash c}\\ |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
76 |
&\smath{r_1 \cdot r_2 \backslash c} & \smath{\dn} & |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
77 |
\smath{\textit{if}\;\textit{nullable}\;r_1}\\ |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
78 |
&& & \smath{\textit{then}\;r_1\backslash c \cdot r_2 \,+\, r_2\backslash c |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
79 |
\;\textit{else}\;r_1\backslash c \cdot r_2}\\ |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
80 |
&\smath{r^* \backslash c} & \smath{\dn} & |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
81 |
\smath{r\backslash c \,\cdot\, r^*}\bigskip\\ |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
82 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
83 |
strings: |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
84 |
&\smath{r\backslash []} & \smath{\dn} & \smath{r}\\ |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
85 |
&\smath{r\backslash c\!::\!s} & \smath{\dn} & |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
86 |
\smath{(r\backslash c)\backslash s}\\ |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
87 |
\end{tabular} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
88 |
\end{center} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
89 |
\end{frame} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
90 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
91 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
92 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
93 |
\begin{frame} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
94 |
\frametitle{Brzozowski's Matcher} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
95 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
96 |
Does \smath{r_1} match string \smath{abc}? |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
97 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
98 |
\begin{center} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
99 |
\begin{tikzpicture}[scale=2,node distance=1.3cm,every node/.style={minimum size=8mm}] |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
100 |
\node (r1) {\smath{r_1}}; |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
101 |
\node (r2) [right=of r1] {\smath{r_2}}; |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
102 |
\draw[->,line width=1mm] (r1) -- (r2) node[above,midway] {\smath{\_\backslash a}}; |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
103 |
\node (r3) [right=of r2] {\smath{r_3}}; |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
104 |
\draw[->,line width=1mm] (r2) -- (r3) node[above,midway] {\smath{\_\backslash b}}; |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
105 |
\node (r4) [right=of r3] {\smath{r_4}}; |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
106 |
\draw[->,line width=1mm] (r3) -- (r4) node[above,midway] {\smath{\_\backslash c}}; |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
107 |
\draw (r4) node[anchor=west] {\;\raisebox{3mm}{\smath{\;\;\textit{nullable}?}}}; |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
108 |
\end{tikzpicture} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
109 |
\end{center}\pause |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
110 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
111 |
It leads to an elegant functional program: |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
112 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
113 |
\begin{center} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
114 |
\smath{\textit{matches}\,(r, s) \dn \textit{nullable}\,(r\backslash s)} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
115 |
\end{center}\pause |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
116 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
117 |
It is an easy exercise to formally prove (e.g.~Coq, HOL, Isabelle): |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
118 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
119 |
\begin{center} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
120 |
\smath{\textit{matches}\,(r, s)} if and only if |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
121 |
\smath{s \in L(r)} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
122 |
\end{center}\pause |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
123 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
124 |
{\bf But Brzozowski's matcher gives only a yes/no-answer.} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
125 |
\end{frame} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
126 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
127 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
128 |
|
208
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
129 |
% \begin{frame} |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
130 |
% \frametitle{Sulzmann and Lu's Matcher} |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
131 |
% \begin{itemize} |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
132 |
% \item Sulzmann \& Lu came up with a beautiful idea for how |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
133 |
% to extend the simple regular expression matcher to POSIX |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
134 |
% matching/lexing (FLOPS 2014) |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
135 |
% \item The idea: define an inverse operation to the derivatives |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
136 |
% \end{itemize} |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
137 |
% \end{frame} |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
138 |
|
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
139 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
140 |
|
207
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
141 |
\begin{frame} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
142 |
\frametitle{Sulzmann and Lu's Matcher} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
143 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
144 |
Sulzmann and Lu added a second phase in order to answer |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
145 |
\alert{\textbf{how}} the regular expression matched the string. |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
146 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
147 |
\begin{center}\small |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
148 |
\begin{tikzpicture}[scale=1,node distance=0.8cm,every node/.style={minimum size=7mm}] |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
149 |
\node (r1) {\smath{r_1}}; |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
150 |
\node (r2) [right=of r1] {\smath{r_2}}; |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
151 |
\draw[->,line width=1mm] (r1) -- (r2) node[above,midway] {\smath{\_\backslash a}}; |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
152 |
\node (r3) [right=of r2] {\smath{r_3}}; |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
153 |
\draw[->,line width=1mm] (r2) -- (r3) node[above,midway] {\smath{\_\backslash b}}; |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
154 |
\node (r4) [right=of r3] {\smath{r_4}}; |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
155 |
\draw[->,line width=1mm] (r3) -- (r4) node[above,midway] {\smath{\_\backslash c}}; |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
156 |
\draw (r4) node[anchor=west] {\;\raisebox{3mm}{\smath{\;\;nullable?}}}; |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
157 |
\node (v4) [below=of r4] {\smath{v_4}}; |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
158 |
\draw[->,line width=1mm] (r4) -- (v4); |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
159 |
\node (v3) [left=of v4] {\smath{v_3}}; |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
160 |
\draw[->,line width=1mm] (v4) -- (v3) node[below,midway] {\smath{inj\,c}}; |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
161 |
\node (v2) [left=of v3] {\smath{v_2}}; |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
162 |
\draw[->,line width=1mm] (v3) -- (v2) node[below,midway] {\smath{inj\,b}}; |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
163 |
\node (v1) [left=of v2] {\smath{v_1}}; |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
164 |
\draw[->,line width=1mm] (v2) -- (v1) node[below,midway] {\smath{inj\,a}}; |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
165 |
\draw (r4) node[anchor=north west] {\;\raisebox{-8mm}{\smath{mkeps}}}; |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
166 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
167 |
\draw [decorate,decoration={brace,amplitude=10pt,raise=8mm}, |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
168 |
line width=1.5mm] |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
169 |
(r1) -- (r4) node [black,midway,above, yshift=12mm] |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
170 |
{\large\bf first phase}; |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
171 |
\draw [decorate,decoration={brace,amplitude=10pt,raise=8mm}, |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
172 |
line width=1.5mm] |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
173 |
(v4) -- (v1) node [black,midway,below, yshift=-12mm] |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
174 |
{\large\bf second phase}; |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
175 |
%% first phase |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
176 |
\draw[line width=14mm, rounded corners, opacity=0.1, |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
177 |
cap=round,join=round,color=yellow!30] |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
178 |
(r1.center) -- (r4.center); |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
179 |
%% second phase |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
180 |
\draw[line width=14.1mm, rounded corners, opacity=0.2, |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
181 |
cap=round,join=round,draw=black, fill=white] |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
182 |
(r4) -- (v4.center) -- (v1.center); |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
183 |
\draw[line width=14mm, rounded corners, opacity=0.2, |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
184 |
cap=round,join=round,color=yellow!30] |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
185 |
(r4) -- (v4.center) -- (v1.center); |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
186 |
\end{tikzpicture} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
187 |
\end{center} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
188 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
189 |
There are several possible answers for |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
190 |
\alert{\textbf{how}}: POSIX, GREEDY, \ldots |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
191 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
192 |
\end{frame} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
193 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
194 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
195 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
196 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
197 |
\begin{frame} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
198 |
\frametitle{POSIX Matching (needed for Lexing)} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
199 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
200 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
201 |
\begin{bubble}[10cm] |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
202 |
{\bf Longest Match Rule:} The longest |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
203 |
initial substring matched by any regular expression is taken |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
204 |
as the next token. |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
205 |
\end{bubble} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
206 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
207 |
\begin{bubble}[10cm] |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
208 |
{\bf Rule Priority:} For a particular longest initial substring, |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
209 |
the first regular expression that can match determines the |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
210 |
token. |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
211 |
\end{bubble} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
212 |
|
209
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
213 |
For example: \smath{r_{keywords} + r_{identifiers}} |
207
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
214 |
|
209
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
215 |
\begin{itemize} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
216 |
\item \smath{\texttt{\Grid{iffoo\VS bla}}} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
217 |
|
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
218 |
\item \smath{\texttt{\Grid{if\VS bla}}} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
219 |
\end{itemize} |
207
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
220 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
221 |
\end{frame} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
222 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
223 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
224 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
225 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
226 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
227 |
\begin{frame} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
228 |
\frametitle{Problems with POSIX} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
229 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
230 |
Grathwohl, Henglein and Rasmussen wrote: |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
231 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
232 |
\begin{bubble}[10cm] |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
233 |
\it ``The POSIX strategy is more complicated than the greedy because |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
234 |
of the dependence on information |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
235 |
about the length of matched strings in the various subexpressions.'' |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
236 |
\end{bubble}\bigskip |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
237 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
238 |
Also Kuklewicz maintains a unit-test repository for POSIX |
209
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
239 |
matching, which indicates that most POSIX matchcers are buggy. |
207
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
240 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
241 |
\begin{center} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
242 |
\url{http://www.haskell.org/haskellwiki/Regex_Posix} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
243 |
\end{center} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
244 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
245 |
\end{frame} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
246 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
247 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
248 |
|
208
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
249 |
% \begin{frame} |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
250 |
% \frametitle{Correctness} |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
251 |
% \begin{itemize} |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
252 |
% \item Sulzmann \& Lu came up with a beautiful idea for how |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
253 |
% to extend the simple regular expression matcher to POSIX |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
254 |
% matching/lexing (FLOPS 2014) |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
255 |
% \item The idea: define an inverse operation to the derivatives |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
256 |
% \end{itemize} |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
257 |
% \end{frame} |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
258 |
|
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
259 |
|
207
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
260 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
261 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
262 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
263 |
\begin{frame} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
264 |
\frametitle{Sulzmann and Lu Matcher} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
265 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
266 |
We want to match the string $abc$ using $r_1$\\ |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
267 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
268 |
\begin{center} |
209
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
269 |
\begin{tikzpicture}[scale=2,node distance=1.3cm,every node/.style={minimum size=8mm}] |
207
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
270 |
\node (r1) {$r_1$}; |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
271 |
\node (r2) [right=of r1] {$r_2$}; |
209
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
272 |
\draw[->,line width=1mm] (r1) -- (r2) node[above,midway] {$der\,a$}; |
207
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
273 |
\node (r3) [right=of r2] {$r_3$}; |
209
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
274 |
\draw[->,line width=1mm] (r2) -- (r3) node[above,midway] {$der\,b$}; |
207
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
275 |
\node (r4) [right=of r3] {$r_4$}; |
209
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
276 |
\draw[->,line width=1mm] (r3) -- (r4) node[above,midway] {$der\,c$}; |
207
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
277 |
\draw (r4) node[anchor=west] {\;\raisebox{3mm}{$\;\;nullable?$}};\pause |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
278 |
\node (v4) [below=of r4] {$v_4$}; |
208
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
279 |
\draw[->,line width=1mm] (r4) -- (v4); |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
280 |
\draw (r4) node[anchor=north west] {\;\raisebox{-8mm}{$mkeps$}};\pause |
207
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
281 |
\node (v3) [left=of v4] {$v_3$}; |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
282 |
\draw[->,line width=1mm] (v4) -- (v3) node[below,midway] {$inj\,c$};\pause |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
283 |
\node (v2) [left=of v3] {$v_2$}; |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
284 |
\draw[->,line width=1mm] (v3) -- (v2) node[below,midway] {$inj\,b$};\pause |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
285 |
\node (v1) [left=of v2] {$v_1$}; |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
286 |
\draw[->,line width=1mm] (v2) -- (v1) node[below,midway] {$inj\,a$};\pause |
209
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
287 |
%\draw[->,line width=0.5mm] (r3) -- (v3); |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
288 |
%\draw[->,line width=0.5mm] (r2) -- (v2); |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
289 |
%\draw[->,line width=0.5mm] (r1) -- (v1); |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
290 |
\onslide<1-> |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
291 |
\end{tikzpicture} |
207
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
292 |
\end{center} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
293 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
294 |
\end{frame} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
295 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
296 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
297 |
|
208
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
298 |
\begin{frame} |
209
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
299 |
\frametitle{Regular Expressions and Values} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
300 |
Regular expressions and their corresponding values (for how a |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
301 |
regular expression matched string): |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
302 |
\vspace{5 mm} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
303 |
\begin{columns}[c] % the "c" option specifies center vertical alignment |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
304 |
\column{.4\textwidth} % column designated by a command |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
305 |
\begin{tabular}{ l l l } |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
306 |
\smath{r} & ::= & \smath{\Zero} \\ |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
307 |
& $\mid$ & \smath{\One} \\ |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
308 |
& $\mid$ & \smath{c} \\ |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
309 |
& $\mid$ & \smath{r_1 \cdot r_2} \\ |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
310 |
& $\mid$ & \smath{r_1 + r_2} \\ \\ |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
311 |
& $\mid$ & \smath{r^*} \\ |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
312 |
\end{tabular} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
313 |
\column{.4\textwidth} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
314 |
\begin{tabular}{ l l l } |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
315 |
|
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
316 |
\smath{v} & ::= & \\ |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
317 |
& $\mid$ & \smath{Empty} \\ |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
318 |
& $\mid$ & \smath{Char(c)} \\ |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
319 |
& $\mid$ & \smath{Seq(v_1\cdot v_2)} \\ |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
320 |
& $\mid$ & \smath{Left(v)} \\ |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
321 |
& $\mid$ & \smath{Right(v)} \\ |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
322 |
& $\mid$ & \smath{[v_1,...,v_n]} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
323 |
\end{tabular} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
324 |
\end{columns} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
325 |
\vspace{5 mm} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
326 |
There is also a notion of a string behind a value $\mid v \mid$ |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
327 |
\end{frame} |
208
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
328 |
|
209
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
329 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
330 |
|
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
331 |
\begin{frame} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
332 |
\frametitle{Mkeps and Injection Functions} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
333 |
|
208
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
334 |
\textbf{Mkeps Function} |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
335 |
\begin{tabular}{ l l l } |
209
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
336 |
\textit{mkeps} (\textbf{1}) & $\dn$ & \textit{Empty} \\ |
208
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
337 |
\textit{mkeps} ($r_1 \cdot r_2$) & $\dn$ & \textit{Seq} (\textit{mkeps} $r_1$) (\textit{mkeps} $r_2$)\\ |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
338 |
\textit{mkeps} ($r_1 + r_2$) & $\dn$ & \textit{if nullable $r_1$ then Left} (\textit{mkeps $r_1$})\\ |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
339 |
& & \textit{else Right} (\textit{mkeps $r_2$})\\ |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
340 |
\textit{mkeps} ($r^*$) & $\dn$ & \textit{Stars} [] \\ |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
341 |
\end{tabular}\\ |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
342 |
|
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
343 |
\end{frame} |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
344 |
|
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
345 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
346 |
|
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
347 |
\begin{frame} |
209
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
348 |
\frametitle{Mkeps and Injection Functions} |
208
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
349 |
|
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
350 |
\textbf{Injection Function} |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
351 |
\begin{tabular}{ l l l } |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
352 |
\textit{inj d c} () & $\dn$ & \textit{Char d}\\ |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
353 |
\textit{inj} ($r_1 + r_2$) \textit{c} (\textit{Left $v_1$}) & $\dn$ & \textit{Left} (\textit{inj $r_1$ c $v_1$})\\ |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
354 |
\textit{inj} ($r_1 + r_2$) \textit{c} (\textit{Right $v_2$}) & $\dn$ & \textit{Right} (\textit{inj $r_2$ c $v_2$})\\ |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
355 |
\textit{inj} ($r_1 \cdot r_2$) \textit{c} (\textit{Seq $v_1$ $v_2$}) & $\dn$ & \textit{Seq} (\textit{inj $r_1$ c $v_1$}) $v_2$\\ |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
356 |
\textit{inj} ($r_1 \cdot r_2$) \textit{c} (\textit{Left} (\textit{Seq $v_1$ $v_2$})) & $\dn$ & \textit{Seq} (\textit{inj $r_1$ c $v_1$}) $v_2$\\ |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
357 |
\textit{inj} ($r_1 \cdot r_2$) \textit{c} (\textit{Right $v_2$}) & $\dn$ & \textit{Seq} (\textit{mkeps $r_1$}) (\textit{inj $r_2$ c $v_2$})\\ |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
358 |
\textit{inj} ($r^*$) \textit{c} (\textit{Seq v} (\textit{Stars vs})) & $\dn$ & \textit{Stars} (\textit{inj r c v}::\textit{vs}) |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
359 |
\end{tabular} |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
360 |
|
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
361 |
\end{frame} |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
362 |
|
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
363 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
364 |
|
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
365 |
\begin{frame} |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
366 |
\frametitle{POSIX Ordering Relation by Sulzmann \& Lu} |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
367 |
|
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
368 |
\begin{itemize} |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
369 |
\item Introduce an inductive defined ordering relation |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
370 |
$v \succ_r v'$ which captures the idea of POSIX matching. |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
371 |
|
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
372 |
\item The algorithm returns the maximum of all possible values |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
373 |
that are possible for a regular expression. |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
374 |
|
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
375 |
\item The idea is from a paper by Frisch \& Cardelli about |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
376 |
GREEDY matching (GREEDY = preferring instant gratification |
209
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
377 |
to delayed repletion) |
208
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
378 |
|
209
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
379 |
%\item e.g. given $(a + (b + ab))^{*}$ and string $ab$\\ |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
380 |
%\begin{center} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
381 |
%\begin{tabular}{ll} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
382 |
%GREEDY: & $[Left(a), Right(Left(b))]$\\ |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
383 |
%POSIX: & $[Right(Right(Seq(a, b)))]$ |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
384 |
%\end{tabular} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
385 |
%\end{center} |
208
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
386 |
|
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
387 |
\end{itemize} |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
388 |
\end{frame} |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
389 |
|
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
390 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
391 |
|
209
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
392 |
% \begin{frame} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
393 |
% \frametitle{POSIX Ordering Relation by Sulzmann \& Lu} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
394 |
% |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
395 |
% \begin{center} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
396 |
% $\infer{\vdash Empty : \epsilon}{}$\hspace{15mm} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
397 |
% $\infer{\vdash Char(c): c}{}$\bigskip |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
398 |
% |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
399 |
% $\infer{\vdash Seq(v_1, v_2) : r_1\cdot r_2}{\vdash v_1 : r_1 \quad \vdash v_2 : r_2}$ |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
400 |
% \bigskip |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
401 |
% |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
402 |
% $\infer{\vdash Left(v) : r_1 + r_2}{\vdash v : r_1}$\hspace{15mm} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
403 |
% $\infer{\vdash Right(v): r_1 + r_2}{\vdash v : r_2}$\bigskip |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
404 |
% |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
405 |
% $\infer{\vdash [] : r^*}{}$\hspace{15mm} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
406 |
% $\infer{\vdash [v_1,\ldots, v_n] : r^*} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
407 |
% {\vdash v_1 : r \quad\ldots\quad \vdash v_n : r}$ |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
408 |
% \end{center} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
409 |
% |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
410 |
% \end{frame} |
207
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
411 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
412 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
413 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
414 |
\begin{frame} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
415 |
\frametitle{Problems} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
416 |
\begin{itemize} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
417 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
418 |
\item Sulzmann: \ldots Let's assume $v$ is not a $POSIX$ value, |
208
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
419 |
then there must be another one \ldots contradiction. |
207
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
420 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
421 |
\item Exists ? |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
422 |
\begin{center} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
423 |
$L(r) \not= \varnothing \;\Rightarrow\; \exists v.\;POSIX(v, r)$ |
208
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
424 |
\end{center} |
207
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
425 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
426 |
\item In the sequence case |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
427 |
$Seq(v_1,v_2)\succ_{r_1\cdot r_2} Seq(v_1', v_2')$, |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
428 |
the induction hypotheses require |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
429 |
$|v_1| = |v_1'|$ and $|v_2| = |v_2'|$, but you only know |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
430 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
431 |
\begin{center} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
432 |
$|v_1| @ |v_2| = |v_1'| @ |v_2'|$ |
208
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
433 |
\end{center} |
207
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
434 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
435 |
\item Although one begins with the assumption that the two |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
436 |
values have the same flattening, this cannot be maintained |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
437 |
as one descends into the induction (alternative, sequence) |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
438 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
439 |
\end{itemize} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
440 |
\end{frame} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
441 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
442 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
443 |
|
209
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
444 |
% \begin{frame} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
445 |
% \frametitle{Problems} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
446 |
% |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
447 |
% \begin{itemize} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
448 |
% \item I have no doubt the algorithm is correct --- |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
449 |
% the problem is I do not believe their proof. |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
450 |
% |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
451 |
% \begin{center} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
452 |
% \small |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
453 |
% ``How could I miss this? Well, I was rather careless when |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
454 |
% stating this Lemma :)\smallskip |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
455 |
% |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
456 |
% Great example how formal machine checked proofs (and |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
457 |
% proof assistants) can help to spot flawed reasoning steps.'' |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
458 |
% |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
459 |
% \end{center} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
460 |
% |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
461 |
% \begin{center} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
462 |
% \small |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
463 |
% ``Well, I don't think there's any flaw. The issue is how to |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
464 |
% come up with a mechanical proof. In my world mathematical |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
465 |
% proof $=$ mechanical proof doesn't necessarily hold.'' |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
466 |
% |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
467 |
% \end{center} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
468 |
% |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
469 |
% \end{itemize} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
470 |
% |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
471 |
% \end{frame} |
208
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
472 |
|
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
473 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
474 |
|
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
475 |
\begin{frame} |
209
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
476 |
\frametitle{Our Solution} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
477 |
|
207
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
478 |
\begin{itemize} |
209
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
479 |
\item A direct definition of what a POSIX value is, using the |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
480 |
relation \smath{s \in r \to v} (our specification)\bigskip |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
481 |
|
207
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
482 |
\begin{center} |
209
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
483 |
\smath{\infer{[] \in \One \to Empty}{}}\hspace{15mm} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
484 |
\smath{\infer{[c] \in c \to Char(c)}{}}\bigskip\medskip |
208
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
485 |
|
209
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
486 |
\smath{\infer{s \in r_1 + r_2 \to Left(v)} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
487 |
{s \in r_1 \to v}}\hspace{10mm} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
488 |
\smath{\infer{s \in r_1 + r_2 \to Right(v)} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
489 |
{s \in r_2 \to v & s \not\in L(r_1)}}\bigskip\medskip |
208
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
490 |
|
209
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
491 |
\smath{\infer{s_1 @ s_2 \in r_1 \cdot r_2 \to Seq(v_1, v_2)} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
492 |
{\small\begin{array}{l} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
493 |
s_1 \in r_1 \to v_1 \\ |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
494 |
s_2 \in r_2 \to v_2 \\ |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
495 |
\neg(\exists s_3\,s_4.\; s_3 \not= [] |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
496 |
\wedge s_3 @ s_4 = s_2 \wedge |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
497 |
s_1 @ s_3 \in L(r_1) \wedge |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
498 |
s_4 \in L(r_2)) |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
499 |
\end{array}}} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
500 |
|
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
501 |
{\ldots} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
502 |
\end{center} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
503 |
|
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
504 |
\end{itemize} |
207
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
505 |
\end{frame} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
506 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
507 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
508 |
\begin{frame}[c] |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
509 |
\frametitle{Properties} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
510 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
511 |
It is almost trival to prove: |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
512 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
513 |
\begin{itemize} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
514 |
\item Uniqueness |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
515 |
\begin{center} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
516 |
If $s \in r \to v_1$ and $s \in r \to v_2$ then |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
517 |
$v_1 = v_2$ |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
518 |
\end{center}\bigskip |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
519 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
520 |
\item Correctness |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
521 |
\begin{center} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
522 |
$lexer(r, s) = v$ if and only if $s \in r \to v$ |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
523 |
\end{center} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
524 |
\end{itemize}\bigskip\bigskip\pause |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
525 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
526 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
527 |
You can now start to implement optimisations and derive |
209
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
528 |
correctness proofs for them.% But we still do not know whether |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
529 |
% |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
530 |
% \begin{center} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
531 |
% $s \in r \to v$ |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
532 |
% \end{center} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
533 |
% |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
534 |
% is a POSIX value according to Sulzmann \& Lu's definition |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
535 |
% (biggest value for $s$ and $r$) |
207
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
536 |
\end{frame} |
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
537 |
|
209
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
538 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
208
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
539 |
|
209
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
540 |
\begin{frame} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
541 |
\frametitle{Conclusions} |
208
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
542 |
|
209
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
543 |
\begin{itemize} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
544 |
|
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
545 |
\item Sulzmann and Lu's informal proof contained small gaps (acknowledged) but we believe it had |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
546 |
also fundamental flaws\medskip |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
547 |
|
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
548 |
\item We replaced the POSIX definition of Sulzmann \& Lu by a |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
549 |
new definition (ours is inspired by work of Vansummeren, |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
550 |
2006)\medskip |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
551 |
|
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
552 |
\item Now, its a nice exercise for theorem proving\medskip |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
553 |
|
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
554 |
\item Some optimisations need to be applied to the algorithm |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
555 |
in order to become fast enough\medskip |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
556 |
|
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
557 |
\item Can be used for lexing, is a small beautiful functional |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
558 |
program |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
559 |
|
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
560 |
\end{itemize} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
561 |
\end{frame} |
c592ea0661ae
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
208
diff
changeset
|
562 |
|
208
02568e85a394
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
563 |
|
207
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
564 |
|
599b2bfcebf6
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
565 |
\end{document} |