thys/Journal/document/root.tex
author Christian Urban <urbanc@in.tum.de>
Sun, 26 Feb 2017 23:46:22 +0000
changeset 218 16af5b8bd285
child 265 d36be1e356c0
permissions -rwxr-xr-x
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
218
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     1
\documentclass[runningheads]{llncs}
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     2
\usepackage{times}
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     3
\usepackage{isabelle}
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     4
\usepackage{isabellesym}
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     5
\usepackage{amsmath}
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     6
\usepackage{amssymb}
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     7
\usepackage{mathpartir}
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     8
\usepackage{tikz}
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     9
\usepackage{pgf}
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    10
\usetikzlibrary{positioning}
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    11
\usepackage{pdfsetup}
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    12
%%\usepackage{stmaryrd}
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    13
\usepackage{url}
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    14
\usepackage{color}
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    15
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    16
\titlerunning{POSIX Lexing with Derivatives of Regular Expressions}
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    17
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    18
\urlstyle{rm}
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    19
\isabellestyle{it}
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    20
\renewcommand{\isastyleminor}{\it}% 
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    21
\renewcommand{\isastyle}{\normalsize\it}%
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    22
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    23
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    24
\def\dn{\,\stackrel{\mbox{\scriptsize def}}{=}\,}
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    25
\renewcommand{\isasymequiv}{$\dn$}
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    26
\renewcommand{\isasymemptyset}{$\varnothing$}
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    27
\renewcommand{\isacharunderscore}{\mbox{$\_\!\_$}}
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    28
\renewcommand{\isasymiota}{\makebox[0mm]{${}^{\prime}$}}
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    29
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    30
\def\Brz{Brzozowski}
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    31
\def\der{\backslash}
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    32
\newtheorem{falsehood}{Falsehood}
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    33
\newtheorem{conject}{Conjecture}
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    34
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    35
\begin{document}
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    36
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    37
\title{POSIX {L}exing with {D}erivatives of {R}egular {E}xpressions (Proof Pearl)}
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    38
\author{Fahad Ausaf\inst{1} \and Roy Dyckhoff\inst{2} \and Christian Urban\inst{3}}
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    39
\institute{King's College London\\
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    40
		\email{fahad.ausaf@icloud.com}
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    41
\and University of St Andrews\\
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    42
		\email{roy.dyckhoff@st-andrews.ac.uk}
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    43
\and King's College London\\
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    44
		\email{christian.urban@kcl.ac.uk}}
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    45
\maketitle
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    46
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    47
\begin{abstract}
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    48
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    49
Brzozowski introduced the notion of derivatives for regular
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    50
expressions. They can be used for a very simple regular expression
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    51
matching algorithm.  Sulzmann and Lu cleverly extended this algorithm
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    52
in order to deal with POSIX matching, which is the underlying
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    53
disambiguation strategy for regular expressions needed in lexers.
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    54
Sulzmann and Lu have made available on-line what they call a
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    55
``rigorous proof'' of the correctness of their algorithm w.r.t.\ their
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    56
specification; regrettably, it appears to us to have unfillable gaps.
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    57
In the first part of this paper we give our inductive definition of
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    58
what a POSIX value is and show $(i)$ that such a value is unique (for
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    59
given regular expression and string being matched) and $(ii)$ that
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    60
Sulzmann and Lu's algorithm always generates such a value (provided
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    61
that the regular expression matches the string).  We also prove the
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    62
correctness of an optimised version of the POSIX matching
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    63
algorithm. Our definitions and proof are much simpler than those by
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    64
Sulzmann and Lu and can be easily formalised in Isabelle/HOL. In the
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    65
second part we analyse the correctness argument by Sulzmann and Lu and
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    66
explain why the gaps in this argument cannot be filled easily.\smallskip
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    67
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    68
{\bf Keywords:} POSIX matching, Derivatives of Regular Expressions,
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    69
Isabelle/HOL
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    70
\end{abstract}
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    71
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    72
\input{session}
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    73
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    74
\end{document}
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    75
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    76
%%% Local Variables:
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    77
%%% mode: latex
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    78
%%% TeX-master: t
16af5b8bd285 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    79
%%% End: