# source:docs/Working/re/re-main.tex.backup@3135

Last change on this file since 3135 was 3135, checked in by ksherdy, 6 years ago

Minor edit.

File size: 6.4 KB
Line
1\documentclass[a4paper,10pt]{article}
2\usepackage[utf8]{inputenc}
3
4%opening
5\title{Fast Regular Expression Matching using Parallel Bitstreams}
6\author{
7{Robert D. Cameron} \\
8\and
9{Kenneth S. Herdy} \\
10\and
11{Ben Hull} \\
12\and
13{Thomas C. Shermer} \\
14\\School of Computing Science
15\\Simon Fraser University
16}
17\begin{document}
18
19\date{}
20\maketitle
21
22\begin{abstract}
23
24A parallel regular expression matching method is introduced and studied in
25application to the problem of online pattern matching.
26
27The method is based on the concept of parallel
28bitstream technology, in which parallel streams of bits are formed such
29that each stream comprises bits in one-to-one correspondence with the
30character code units of a source data stream.
31
32On processors supporting W-bit addition operations, the method processes W source characters
33in parallel and performs up to W finite state transitions per clock cycle.
34
35Performance results show a dramatic speed-up over traditional and state-of-the-art alternatives.
36
37\end{abstract}
38
39\section{Introduction}
40\label{Introduction}
41%\input{introduction.tex}
42
43Regular expresssion matching is an extensively studied problem with application to
44numerous application domains. A multitude
45of algorithms and software tools have been developed to the address the particular
46demands of the various application domains.
47
48The pattern matching problem can be
49stated as follows. Given a text T$_{1..n}$ of n characters and a pattern P,
50find all the text positions of T that start an occurrence of P. Alternatively,
51one may want all the final positions of occurrences. Some applications require
52slightly different output such as the line that matches the pattern.
53
54A pattern P can be a simple string, but it can also be, a regular expression.
55A regular expression, is an expression that specifies a set of strings.
56A regular expression is composed of (i) simple strings and (ii) the
57union, concatenation and Kleene closure of other regular expressions.
58To avoid parentheses it is assumed that the Kleene star has the highest priority,
59next concatenation and then alternation, however, most formalisms provides grouping
60operators to allow the definition of scope and operator precedence.
61Readers unfamiliar with the concept of regular expression matching are referred
62classical texts such as \cite{aho2007}.
63
64Regular expression matching is commonly performed using a wide variety of
65publically available software tools for on-line pattern matching. For instance,
66UNIX grep, Gnu grep, agrep, cgrep, nrgrep, and Perl regular
67expressions \cite{abou-assaleh2004}. Amongst these tools Gnu grep (egrep),
68agrep, and nrgrep are widely known and considered as
69the fastest regular expression matching tools in practice \cite{navarro2000}.
70and are of particular interest to this study.
71
72% simple patterns, extended patterns, regular expressions
73
74% motivation / previous work
75Although tradi finite state machine methods used in the scanning and parsing of
76text streams is considered to be the hardest of the â13 dwarvesâ to parallelize
77[1], parallel bitstream technology shows considerable promise for these types of
78applications [3, 4]. In this approach, character streams are processed W positions
79at a time using the W-bit SIMD registers commonly found on commodity processors
80(e.g., 128-bit XMM registers on Intel/AMD chips). This is achieved by
81first slicing the byte streams into eight separate basis bitstreams, one for each bit
82position within the byte. These basis bitstreams are then combined with bitwise
83logic and shifting operations to compute further parallel bit streams of interest.
84
85We further increase the parallelism in our methods by introducing a new parallel
86scanning primitive which we have coined Match Star. Match Star returns all matches
87in a single operation and eliminates backtracking
88when a partially successful search path fails.
89
90The remainder of this paper is organized as follows.
91Section~\ref{Background} presents background material on classic
92regular expression pattern matching techniques and provides insight into the
93efficiency of traditional regular expression software tools. Next,
94Section~\ref{Data Parallel Bitstreams} describes our data parallel
95regular expression matching techniques.
96Section~\ref{Compiler Technology}
97Section~\ref{Methodology} describes the evaluation framework and Section~\ref{Experimental Results}
98presents a detailed performance analysis of our data parallel bitstream techniques against
99Gnu grep, agrep, and nr-grep.
100Section~\ref{Conclusion} concludes the paper.
101
102\section{Background}
103\label{Background}
104%\input{background.tex}
105
106% Background
107
108% History
109
110Historically, the origins of regular expression matching date back to automata theory
111and formal language theory developed by Kleene in the 1950s \cite{kleene1951}.
112
113In 1959, Dana and Scott demonstrated that
114NFAs can be simulated using Deterministic Finite Automata (DFA) in which each DFA
115state corresponds to a set of NFA states.
116
117Thompson, in 1968, is credited with the first construction to convert regular expressions
118to nondeterministic finite automata (NFA) for regular expression matching.
119
120Thompsonâs publication \cite{thompson1968} marked the beginning of a long line of
121regular expression implementations that construct automata for pattern matching.
122
123Following Thompson's approach, a regular expression of length m is first converted
124to an NFA with O(m) nodes. It is possible to search a text of length n using the
125NFA directly in O(mn) worst case time. Alternatively, a more effcient choice
126is to convert the NFA into a DFA. A DFA has only a single active state and
127allows to search the text at O(n) worst-case optimal. The problem with this
128approach is that the DFA may have O($2^m$) states.
129
130
131\section{Parallel Bitwise Data Streams}
132\label{Parallel Bitwise Data Streams}
133
134\section{Compiler Technology}
135\label{Compiler Technology}
136
137\section{Methodology}
138\label{Methodology}
139%\input{methodology.tex}
140
141We compare the performance of our parallel \bitstream{} techniques against
142Gnu grep, agrep, and nr-grep.
143
144Given a regular expression R and a test T the regular expression matching
145problem finds all ending position of substrings in Q that matches a string in
146the language denoted by R.
147
148The behaviour of Gnu grep, agrep, and nr-grep are differ in that
149
150Gnu grep
151
152agrep
153
154nr-grep
155
156
157
158\section{Experimental Results}
159\label{Experimental Results}
160%\input{results.tex}
161
162\section{Conclusion}
163\label{Conclusion}
164%\input{conclusion.tex}
165
166{
167  \bibliographystyle{acm}
168  \bibliography{reference}
169}
170
171\end{document}
Note: See TracBrowser for help on using the repository browser.