468
+ − 1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ − 2
% Masters/Doctoral Thesis
+ − 3
% LaTeX Template
+ − 4
% Version 2.5 (27/8/17)
+ − 5
%
+ − 6
% This template was downloaded from:
+ − 7
% http://www.LaTeXTemplates.com
+ − 8
%
+ − 9
% Version 2.x major modifications by:
+ − 10
% Vel (vel@latextemplates.com)
+ − 11
%
+ − 12
% This template is based on a template by:
+ − 13
% Steve Gunn (http://users.ecs.soton.ac.uk/srg/softwaretools/document/templates/)
+ − 14
% Sunil Patel (http://www.sunilpatel.co.uk/thesis-template/)
+ − 15
%
+ − 16
% Template license:
+ − 17
% CC BY-NC-SA 3.0 (http://creativecommons.org/licenses/by-nc-sa/3.0/)
+ − 18
%
+ − 19
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ − 20
+ − 21
%----------------------------------------------------------------------------------------
+ − 22
% PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
+ − 23
%----------------------------------------------------------------------------------------
+ − 24
+ − 25
\documentclass[
+ − 26
11pt, % The default document font size, options: 10pt, 11pt, 12pt
+ − 27
%oneside, % Two side (alternating margins) for binding by default, uncomment to switch to one side
+ − 28
english, % ngerman for German
+ − 29
singlespacing, % Single line spacing, alternatives: onehalfspacing or doublespacing
+ − 30
%draft, % Uncomment to enable draft mode (no pictures, no links, overfull hboxes indicated)
+ − 31
%nolistspacing, % If the document is onehalfspacing or doublespacing, uncomment this to set spacing in lists to single
+ − 32
%liststotoc, % Uncomment to add the list of figures/tables/etc to the table of contents
+ − 33
%toctotoc, % Uncomment to add the main table of contents to the table of contents
+ − 34
%parskip, % Uncomment to add space between paragraphs
+ − 35
%nohyperref, % Uncomment to not load the hyperref package
+ − 36
headsepline, % Uncomment to get a line under the header
+ − 37
%chapterinoneline, % Uncomment to place the chapter title next to the number on one line
471
+ − 38
consistentlayout, % Uncomment to change the layout of the declaration, abstract and acknowledgements pages to match the default layout
468
+ − 39
]{MastersDoctoralThesis} % The class file specifying the document structure
+ − 40
+ − 41
\usepackage[utf8]{inputenc} % Required for inputting international characters
+ − 42
\usepackage[T1]{fontenc} % Output font encoding for international characters
+ − 43
+ − 44
\usepackage{mathpazo} % Use the Palatino font by default
+ − 45
\usepackage{hyperref}
+ − 46
\usepackage[backend=bibtex,style=authoryear,natbib=true]{biblatex} % Use the bibtex backend with the authoryear citation style (which resembles APA)
+ − 47
+ − 48
\addbibresource{example.bib} % The filename of the bibliography
+ − 49
+ − 50
\usepackage[autostyle=true]{csquotes} % Required to generate language-dependent quotes in the bibliography
+ − 51
+ − 52
%My Newly added Libraries in addition to template
+ − 53
\usepackage{graphic}
+ − 54
\usepackage{data}
+ − 55
+ − 56
%\usepackage{algorithm}
+ − 57
\usepackage{amsmath}
+ − 58
\usepackage[noend]{algpseudocode}
+ − 59
\usepackage{enumitem}
+ − 60
\usepackage{nccmath}
+ − 61
\usepackage{tikz-cd}
+ − 62
\usepackage{tikz}
472
+ − 63
\usetikzlibrary{automata, positioning, calc}
468
+ − 64
+ − 65
%----------------------------------------------------------------------------------------
+ − 66
% MARGIN SETTINGS
+ − 67
%----------------------------------------------------------------------------------------
+ − 68
+ − 69
\geometry{
+ − 70
paper=a4paper, % Change to letterpaper for US letter
+ − 71
inner=2.5cm, % Inner margin
+ − 72
outer=3.8cm, % Outer margin
+ − 73
bindingoffset=.5cm, % Binding offset
+ − 74
top=1.5cm, % Top margin
+ − 75
bottom=1.5cm, % Bottom margin
+ − 76
%showframe, % Uncomment to show how the type block is set on the page
+ − 77
}
+ − 78
+ − 79
%----------------------------------------------------------------------------------------
+ − 80
% THESIS INFORMATION
+ − 81
%----------------------------------------------------------------------------------------
+ − 82
+ − 83
\thesistitle{POSIX Regular Expression Matching and Lexing} % Your thesis title, this is used in the title and abstract, print it elsewhere with \ttitle
+ − 84
\supervisor{Dr. Christian \textsc{Urban}} % Your supervisor's name, this is used in the title page, print it elsewhere with \supname
+ − 85
\examiner{} % Your examiner's name, this is not currently used anywhere in the template, print it elsewhere with \examname
+ − 86
\degree{Doctor of Philosophy} % Your degree name, this is used in the title page and abstract, print it elsewhere with \degreename
+ − 87
\author{Chengsong \textsc{Tan}} % Your name, this is used in the title page and abstract, print it elsewhere with \authorname
+ − 88
\addresses{} % Your address, this is not currently used anywhere in the template, print it elsewhere with \addressname
+ − 89
+ − 90
\subject{Computer Science} % Your subject area, this is not currently used anywhere in the template, print it elsewhere with \subjectname
+ − 91
\keywords{} % Keywords for your thesis, this is not currently used anywhere in the template, print it elsewhere with \keywordnames
+ − 92
\university{\href{https://www.kcl.ac.uk}{King's College London}} % Your university's name and URL, this is used in the title page and abstract, print it elsewhere with \univname
+ − 93
\department{\href{https://www.kcl.ac.uk/informatics}{Department or Informatics}} % Your department's name and URL, this is used in the title page and abstract, print it elsewhere with \deptname
471
+ − 94
\group{\href{https://www.kcl.ac.uk/research/ssy}{Software Systems Group}} % Your research group's name and URL, this is used in the title page, print it elsewhere with \groupname
468
+ − 95
\faculty{\href{http://faculty.university.com}{Chengsong Tan}} % Your faculty's name and URL, this is used in the title page and abstract, print it elsewhere with \facname
+ − 96
+ − 97
\AtBeginDocument{
+ − 98
\hypersetup{pdftitle=\ttitle} % Set the PDF's title to your title
+ − 99
\hypersetup{pdfauthor=\authorname} % Set the PDF's author to your name
+ − 100
\hypersetup{pdfkeywords=\keywordnames} % Set the PDF's keywords to your keywords
+ − 101
}
+ − 102
+ − 103
\begin{document}
+ − 104
+ − 105
\frontmatter % Use roman page numbering style (i, ii, iii, iv...) for the pre-content pages
+ − 106
+ − 107
\pagestyle{plain} % Default to the plain heading style until the thesis style is called for the body content
+ − 108
+ − 109
%----------------------------------------------------------------------------------------
+ − 110
% TITLE PAGE
+ − 111
%----------------------------------------------------------------------------------------
+ − 112
+ − 113
\begin{titlepage}
+ − 114
\begin{center}
+ − 115
+ − 116
\vspace*{.06\textheight}
+ − 117
{\scshape\LARGE \univname\par}\vspace{1.5cm} % University name
+ − 118
\textsc{\Large Doctoral Thesis}\\[0.5cm] % Thesis type
+ − 119
+ − 120
\HRule \\[0.4cm] % Horizontal line
+ − 121
{\huge \bfseries \ttitle\par}\vspace{0.4cm} % Thesis title
+ − 122
\HRule \\[1.5cm] % Horizontal line
+ − 123
+ − 124
\begin{minipage}[t]{0.4\textwidth}
+ − 125
\begin{flushleft} \large
+ − 126
\emph{Author:}\\
+ − 127
\href{https://kclpure.kcl.ac.uk/portal/en/persons/chengsong-tan(a63b381b-04bc-4cd7-beea-beb3e96cb153).html}{\authorname} % Author name - remove the \href bracket to remove the link
+ − 128
\end{flushleft}
+ − 129
\end{minipage}
+ − 130
+ − 131
+ − 132
\begin{minipage}[t]{0.4\textwidth}
+ − 133
\begin{flushright} \large
+ − 134
\emph{Supervisor:} \\
+ − 135
\href{https://www.kcl.ac.uk/people/christian-urban}{\supname} % Supervisor name - remove the \href bracket to remove the link
+ − 136
\end{flushright}
+ − 137
\end{minipage}\\[3cm]
+ − 138
+ − 139
\vfill
+ − 140
+ − 141
\large \textit{A thesis submitted in fulfillment of the requirements\\ for the degree of \degreename}\\[0.3cm] % University requirement text
+ − 142
\textit{in the}\\[0.4cm]
+ − 143
\groupname\\\deptname\\[2cm] % Research group name and department name
+ − 144
+ − 145
\vfill
+ − 146
+ − 147
{\large \today}\\[4cm] % Date
+ − 148
%\includegraphics{Logo} % University/department logo - uncomment to place it
+ − 149
+ − 150
\vfill
+ − 151
\end{center}
+ − 152
\end{titlepage}
+ − 153
+ − 154
%----------------------------------------------------------------------------------------
+ − 155
% DECLARATION PAGE
+ − 156
%----------------------------------------------------------------------------------------
+ − 157
+ − 158
\begin{declaration}
+ − 159
\addchaptertocentry{\authorshipname} % Add the declaration to the table of contents
+ − 160
\noindent I, \authorname, declare that this thesis titled, \enquote{\ttitle} and the work presented in it are my own. I confirm that:
+ − 161
+ − 162
\begin{itemize}
+ − 163
\item This work was done wholly or mainly while in candidature for a research degree at this University.
+ − 164
\item Where any part of this thesis has previously been submitted for a degree or any other qualification at this University or any other institution, this has been clearly stated.
+ − 165
\item Where I have consulted the published work of others, this is always clearly attributed.
+ − 166
\item Where I have quoted from the work of others, the source is always given. With the exception of such quotations, this thesis is entirely my own work.
+ − 167
\item I have acknowledged all main sources of help.
+ − 168
\item Where the thesis is based on work done by myself jointly with others, I have made clear exactly what was done by others and what I have contributed myself.\\
+ − 169
\end{itemize}
+ − 170
+ − 171
\noindent Signed:\\
+ − 172
\rule[0.5em]{25em}{0.5pt} % This prints a line for the signature
+ − 173
+ − 174
\noindent Date:\\
+ − 175
\rule[0.5em]{25em}{0.5pt} % This prints a line to write the date
+ − 176
\end{declaration}
+ − 177
+ − 178
\cleardoublepage
+ − 179
+ − 180
%----------------------------------------------------------------------------------------
+ − 181
% QUOTATION PAGE
+ − 182
%----------------------------------------------------------------------------------------
+ − 183
+ − 184
\vspace*{0.2\textheight}
+ − 185
+ − 186
\noindent\enquote{\itshape Thanks to my solid academic training, today I can write hundreds of words on virtually any topic without possessing a shred of information, which is how I got a good job in journalism.}\bigbreak
+ − 187
+ − 188
\hfill Dave Barry
+ − 189
+ − 190
%----------------------------------------------------------------------------------------
+ − 191
% ABSTRACT PAGE
+ − 192
%----------------------------------------------------------------------------------------
+ − 193
+ − 194
\begin{abstract}
+ − 195
\addchaptertocentry{\abstractname} % Add the abstract to the table of contents
471
+ − 196
This work is about regular expressions and derivatives. It combines functional algorithms and their formal verification in the Isabelle/HOL theorem prover.
468
+ − 197
+ − 198
Theoretical results say that regular expression matching
+ − 199
should be linear with respect to the input.
+ − 200
Under a certain class of regular expressions and inputs though,
+ − 201
practical implementations suffer from non-linear or even
+ − 202
exponential running time,
+ − 203
allowing a ReDoS (regular expression denial-of-service ) attack.
+ − 204
+ − 205
+ − 206
The reason behind is that regex libraries in popular language engines
+ − 207
often want to support richer constructs
+ − 208
than the most basic regular expressions, and lexing rather than matching
+ − 209
is needed for sub-match extraction.
+ − 210
+ − 211
This work aims to address the above vulnerability by the combination
+ − 212
of Brzozowski's derivatives and interactive theorem proving. We give an
+ − 213
improved version of Sulzmann and Lu's bit-coded algorithm using
+ − 214
derivatives, which come with a formal guarantee in terms of correctness and
+ − 215
running time as an Isabelle/HOL proof.
+ − 216
Then we improve the algorithm with an even stronger version of
+ − 217
simplification, and prove a time bound linear to input and
+ − 218
cubic to regular expression size using a technique by
+ − 219
Antimirov.
+ − 220
The result is an algorithm with provable guarantees on
+ − 221
correctness and running time. We believe this is the first
+ − 222
work with these two guarantees together.
+ − 223
+ − 224
+ − 225
+ − 226
\end{abstract}
+ − 227
+ − 228
%----------------------------------------------------------------------------------------
+ − 229
% ACKNOWLEDGEMENTS
+ − 230
%----------------------------------------------------------------------------------------
+ − 231
+ − 232
\begin{acknowledgements}
+ − 233
\addchaptertocentry{\acknowledgementname} % Add the acknowledgements to the table of contents
+ − 234
The acknowledgments and the people to thank go here, don't forget to include your project advisor\ldots
+ − 235
\end{acknowledgements}
+ − 236
+ − 237
%----------------------------------------------------------------------------------------
+ − 238
% LIST OF CONTENTS/FIGURES/TABLES PAGES
+ − 239
%----------------------------------------------------------------------------------------
+ − 240
+ − 241
\tableofcontents % Prints the main table of contents
+ − 242
+ − 243
\listoffigures % Prints the list of figures
+ − 244
+ − 245
\listoftables % Prints the list of tables
+ − 246
+ − 247
%----------------------------------------------------------------------------------------
+ − 248
% ABBREVIATIONS
+ − 249
%----------------------------------------------------------------------------------------
+ − 250
+ − 251
\begin{abbreviations}{ll} % Include a list of abbreviations (a table of two columns)
+ − 252
+ − 253
\textbf{LAH} & \textbf{L}ist \textbf{A}bbreviations \textbf{H}ere\\
+ − 254
\textbf{WSF} & \textbf{W}hat (it) \textbf{S}tands \textbf{F}or\\
+ − 255
+ − 256
\newcommand{\dn}{\stackrel{\mbox{\scriptsize def}}{=}}%
+ − 257
\newcommand{\ZERO}{\mbox{\bf 0}}
+ − 258
\newcommand{\ONE}{\mbox{\bf 1}}
+ − 259
\def\lexer{\mathit{lexer}}
+ − 260
\def\mkeps{\mathit{mkeps}}
+ − 261
+ − 262
\def\DFA{\textit{DFA}}
+ − 263
\def\bmkeps{\textit{bmkeps}}
+ − 264
\def\retrieve{\textit{retrieve}}
+ − 265
\def\blexer{\textit{blexer}}
+ − 266
\def\flex{\textit{flex}}
+ − 267
\def\inj{\mathit{inj}}
+ − 268
\def\Empty{\mathit{Empty}}
+ − 269
\def\Left{\mathit{Left}}
+ − 270
\def\Right{\mathit{Right}}
+ − 271
\def\Stars{\mathit{Stars}}
+ − 272
\def\Char{\mathit{Char}}
+ − 273
\def\Seq{\mathit{Seq}}
+ − 274
\def\Der{\mathit{Der}}
+ − 275
\def\nullable{\mathit{nullable}}
+ − 276
\def\Z{\mathit{Z}}
+ − 277
\def\S{\mathit{S}}
+ − 278
\def\rup{r^\uparrow}
+ − 279
+ − 280
\end{abbreviations}
+ − 281
+ − 282
+ − 283
+ − 284
%----------------------------------------------------------------------------------------
+ − 285
% SYMBOLS
+ − 286
%----------------------------------------------------------------------------------------
+ − 287
+ − 288
\begin{symbols}{lll} % Include a list of Symbols (a three column table)
+ − 289
+ − 290
$a$ & distance & \si{\meter} \\
+ − 291
$P$ & power & \si{\watt} (\si{\joule\per\second}) \\
+ − 292
%Symbol & Name & Unit \\
+ − 293
+ − 294
\addlinespace % Gap to separate the Roman symbols from the Greek
+ − 295
+ − 296
$\omega$ & angular frequency & \si{\radian} \\
+ − 297
+ − 298
\end{symbols}
+ − 299
+ − 300
%----------------------------------------------------------------------------------------
+ − 301
% DEDICATION
+ − 302
%----------------------------------------------------------------------------------------
+ − 303
+ − 304
\dedicatory{For/Dedicated to/To my\ldots}
+ − 305
+ − 306
%----------------------------------------------------------------------------------------
+ − 307
% THESIS CONTENT - CHAPTERS
+ − 308
%----------------------------------------------------------------------------------------
+ − 309
+ − 310
\mainmatter % Begin numeric (1,2,3...) page numbering
+ − 311
+ − 312
\pagestyle{thesis} % Return the page headers back to the "thesis" style
+ − 313
+ − 314
% Include the chapters of the thesis as separate files from the Chapters folder
+ − 315
% Uncomment the lines as you write the chapters
+ − 316
+ − 317
\include{Chapters/Chapter1}
+ − 318
\include{Chapters/Chapter2}
+ − 319
\include{Chapters/Chapter3}
+ − 320
%\include{Chapters/Chapter4}
+ − 321
%\include{Chapters/Chapter5}
+ − 322
+ − 323
%----------------------------------------------------------------------------------------
+ − 324
% THESIS CONTENT - APPENDICES
+ − 325
%----------------------------------------------------------------------------------------
+ − 326
+ − 327
\appendix % Cue to tell LaTeX that the following "chapters" are Appendices
+ − 328
+ − 329
% Include the appendices of the thesis as separate files from the Appendices folder
+ − 330
% Uncomment the lines as you write the Appendices
+ − 331
+ − 332
\include{Appendices/AppendixA}
+ − 333
%\include{Appendices/AppendixB}
+ − 334
%\include{Appendices/AppendixC}
+ − 335
+ − 336
%----------------------------------------------------------------------------------------
+ − 337
% BIBLIOGRAPHY
+ − 338
%----------------------------------------------------------------------------------------
+ − 339
+ − 340
\printbibliography[heading=bibintoc]
+ − 341
+ − 342
%----------------------------------------------------------------------------------------
+ − 343
+ − 344
\end{document}