| author | Christian Urban <urbanc@in.tum.de> |
| Fri, 25 Aug 2017 15:05:20 +0200 | |
| changeset 269 | 12772d537b71 |
| parent 268 | 6746f5e1f1f8 |
| child 270 | 462d893ecb3d |
| permissions | -rwxr-xr-x |
| 218 | 1 |
\documentclass[runningheads]{llncs}
|
2 |
\usepackage{times}
|
|
3 |
\usepackage{isabelle}
|
|
4 |
\usepackage{isabellesym}
|
|
5 |
\usepackage{amsmath}
|
|
6 |
\usepackage{amssymb}
|
|
7 |
\usepackage{mathpartir}
|
|
8 |
\usepackage{tikz}
|
|
9 |
\usepackage{pgf}
|
|
10 |
\usetikzlibrary{positioning}
|
|
11 |
\usepackage{pdfsetup}
|
|
12 |
%%\usepackage{stmaryrd}
|
|
13 |
\usepackage{url}
|
|
14 |
\usepackage{color}
|
|
| 267 | 15 |
\usepackage[safe]{tipa}
|
16 |
||
17 |
||
| 218 | 18 |
|
19 |
\titlerunning{POSIX Lexing with Derivatives of Regular Expressions}
|
|
20 |
||
21 |
\urlstyle{rm}
|
|
22 |
\isabellestyle{it}
|
|
23 |
\renewcommand{\isastyleminor}{\it}%
|
|
24 |
\renewcommand{\isastyle}{\normalsize\it}%
|
|
25 |
||
26 |
||
27 |
\def\dn{\,\stackrel{\mbox{\scriptsize def}}{=}\,}
|
|
28 |
\renewcommand{\isasymequiv}{$\dn$}
|
|
29 |
\renewcommand{\isasymemptyset}{$\varnothing$}
|
|
30 |
\renewcommand{\isacharunderscore}{\mbox{$\_\!\_$}}
|
|
31 |
\renewcommand{\isasymiota}{\makebox[0mm]{${}^{\prime}$}}
|
|
| 267 | 32 |
\renewcommand{\isasymin}{\ensuremath{\,\in\,}}
|
33 |
||
| 218 | 34 |
|
35 |
\def\Brz{Brzozowski}
|
|
36 |
\def\der{\backslash}
|
|
37 |
\newtheorem{falsehood}{Falsehood}
|
|
38 |
\newtheorem{conject}{Conjecture}
|
|
39 |
||
40 |
\begin{document}
|
|
|
265
d36be1e356c0
changed definitions of PRF
Christian Urban <urbanc@in.tum.de>
parents:
218
diff
changeset
|
41 |
\renewcommand{\thefootnote}{$\star$} \footnotetext[1]{This paper is a
|
|
d36be1e356c0
changed definitions of PRF
Christian Urban <urbanc@in.tum.de>
parents:
218
diff
changeset
|
42 |
revised and expanded version of \cite{AusafDyckhoffUrban2016}.
|
|
d36be1e356c0
changed definitions of PRF
Christian Urban <urbanc@in.tum.de>
parents:
218
diff
changeset
|
43 |
Compared with that paper we give a second definition for POSIX |
| 268 | 44 |
values introduced by Okui Suzuki \cite{OkuiSuzuki2010,OkuiSuzukiTech}
|
45 |
and prove that it is |
|
| 267 | 46 |
equivalent to our original one. This |
47 |
second definition is based on an ordering of values and very similar to, |
|
48 |
but not equivalent with, the |
|
| 268 | 49 |
definition given by Sulzmann and Lu~\cite{Sulzmann2014}.
|
50 |
The advantage of the definition based on the |
|
51 |
ordering is that it implements more directly the informal rules from the |
|
52 |
POSIX standard. |
|
53 |
We also |
|
|
265
d36be1e356c0
changed definitions of PRF
Christian Urban <urbanc@in.tum.de>
parents:
218
diff
changeset
|
54 |
extend our results to additional constructors of regular |
|
d36be1e356c0
changed definitions of PRF
Christian Urban <urbanc@in.tum.de>
parents:
218
diff
changeset
|
55 |
expressions.} \renewcommand{\thefootnote}{\arabic{footnote}}
|
| 218 | 56 |
|
|
265
d36be1e356c0
changed definitions of PRF
Christian Urban <urbanc@in.tum.de>
parents:
218
diff
changeset
|
57 |
|
|
d36be1e356c0
changed definitions of PRF
Christian Urban <urbanc@in.tum.de>
parents:
218
diff
changeset
|
58 |
\title{POSIX {L}exing with {D}erivatives of {R}egular {E}xpressions}
|
| 218 | 59 |
\author{Fahad Ausaf\inst{1} \and Roy Dyckhoff\inst{2} \and Christian Urban\inst{3}}
|
60 |
\institute{King's College London\\
|
|
61 |
\email{fahad.ausaf@icloud.com}
|
|
62 |
\and University of St Andrews\\ |
|
63 |
\email{roy.dyckhoff@st-andrews.ac.uk}
|
|
64 |
\and King's College London\\ |
|
65 |
\email{christian.urban@kcl.ac.uk}}
|
|
66 |
\maketitle |
|
67 |
||
68 |
\begin{abstract}
|
|
69 |
Brzozowski introduced the notion of derivatives for regular |
|
70 |
expressions. They can be used for a very simple regular expression |
|
71 |
matching algorithm. Sulzmann and Lu cleverly extended this algorithm |
|
72 |
in order to deal with POSIX matching, which is the underlying |
|
| 269 | 73 |
disambiguation strategy for regular expressions needed in lexers. |
74 |
Their algorithm generates POSIX values which encode the information of |
|
75 |
\emph{how} a regular expression matched a string---that is which part
|
|
76 |
of the string is matched by which part of the regular expression. In |
|
|
265
d36be1e356c0
changed definitions of PRF
Christian Urban <urbanc@in.tum.de>
parents:
218
diff
changeset
|
77 |
the first part of this paper we give our inductive definition of what |
|
d36be1e356c0
changed definitions of PRF
Christian Urban <urbanc@in.tum.de>
parents:
218
diff
changeset
|
78 |
a POSIX value is and show $(i)$ that such a value is unique (for given |
|
d36be1e356c0
changed definitions of PRF
Christian Urban <urbanc@in.tum.de>
parents:
218
diff
changeset
|
79 |
regular expression and string being matched) and $(ii)$ that Sulzmann |
|
d36be1e356c0
changed definitions of PRF
Christian Urban <urbanc@in.tum.de>
parents:
218
diff
changeset
|
80 |
and Lu's algorithm always generates such a value (provided that the |
|
d36be1e356c0
changed definitions of PRF
Christian Urban <urbanc@in.tum.de>
parents:
218
diff
changeset
|
81 |
regular expression matches the string). We also prove the correctness |
|
d36be1e356c0
changed definitions of PRF
Christian Urban <urbanc@in.tum.de>
parents:
218
diff
changeset
|
82 |
of an optimised version of the POSIX matching algorithm. In the |
|
d36be1e356c0
changed definitions of PRF
Christian Urban <urbanc@in.tum.de>
parents:
218
diff
changeset
|
83 |
second part we show that $(iii)$ our inductive definition of a POSIX |
|
d36be1e356c0
changed definitions of PRF
Christian Urban <urbanc@in.tum.de>
parents:
218
diff
changeset
|
84 |
value is equivalent to an alternative definition by Okui and Suzuki |
| 267 | 85 |
which identifies POSIX values as least elements according to an |
| 268 | 86 |
ordering of values. \smallskip |
| 218 | 87 |
|
88 |
{\bf Keywords:} POSIX matching, Derivatives of Regular Expressions,
|
|
89 |
Isabelle/HOL |
|
90 |
\end{abstract}
|
|
91 |
||
92 |
\input{session}
|
|
93 |
||
94 |
\end{document}
|
|
95 |
||
96 |
%%% Local Variables: |
|
97 |
%%% mode: latex |
|
98 |
%%% TeX-master: t |
|
99 |
%%% End: |