Title
DReX: A Declarative Language for Efficiently Evaluating Regular String Transformations
Abstract
We present DReX, a declarative language that can express all regular string-to string transformations, and can still be efficiently evaluated. The class of regular string transformations has a robust theoretical foundation including multiple characterizations, closure properties, and decidable analysis questions, and admits a number of string operations such as insertion, deletion, substring swap, and reversal. Recent research has led to a characterization of regular string transformations using a primitive set of function combinators analogous to the definition of regular languages using regular expressions. While these combinators form the basis for the language DReX proposed in this paper, our main technical focus is on the complexity of evaluating the output of a DReX program on a given input string. It turns out that the natural evaluation algorithm involves dynamic programming, leading to complexity that is cubic in the length of the input string. Our main contribution is identifying a consistency restriction on the use of combinators in DReX programs, and a single-pass evaluation algorithm for consistent programs with time complexity that is linear in the length of the input string and polynomial in the size of the program. We show that the consistency restriction does not limit the expressiveness, and whether a DReX program is consistent can be checked efficiently. We report on a prototype implementation, and evaluate it using a representative set of text processing tasks.
Year
DOI
Venue
2015
10.1145/2676726.2676981
POPL
Keywords
Field
DocType
automata,declarative languages,drex,string transformations,specialized application languages
String searching algorithm,Substring,Regular expression,Programming language,Computer science,Combinatory logic,Theoretical computer science,Regular language,Declarative programming,Time complexity,String operations
Conference
Volume
Issue
ISSN
50
1
0362-1340
Citations 
PageRank 
References 
8
0.47
23
Authors
3
Name
Order
Citations
PageRank
Rajeev Alur1172531413.65
Loris D'Antoni237725.00
Mukund Raghothaman31198.30