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