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