Journal of Functional Programming · 2003 · 76 citations · 25 references
ComputingComputer ScienceAlgorithmsNatural Language ProcessingProgramming LanguagesAbstract Syntax TreesData TypesFormal LanguagesSyntactic AnalysisType CheckingType SystemsClosure AnalysisConstraintsPattern MatchingRegular Expression MatchingRegular ExpressionsTree AutomataType ConstraintsType Inference
We propose regular expression pattern matching as a core feature of programming languages for manipulating XML. We extend conventional pattern-matching facilities (as in ML) with regular expression operators such as repetition (*) , alternation (|) , etc., that can match arbitrarily long sequences of subtrees, allowing a compact pattern to extract data from the middle of a complex sequence. We then show how to check standard notions of exhaustiveness and redundancy for these patterns. Regular expression patterns are intended to be used in languages with type systems based on regular expression types . To avoid excessive type annotations, we develop a type inference scheme that propagates type constraints to pattern variables from the type of input values. The type inference algorithm translates types and patterns into regular tree automata, and then works in terms of standard closure operations (union, intersection, and difference) on tree automata. The main technical challenge is dealing with the interaction of repetition and alternation patterns with the first-match policy, which gives rise to subtleties concerning both the termination and precision of the analysis. We address these issues by introducing a data structure representing these closure operations lazily.
25
Introduction to automata theory, languages, and computation
Computer Languages · 1980 · 6.9K citations
The Lorel query language for semistructured data
Serge Abiteboul, Dallan Quass, Jason McHugh et al. · International Journal on Digital Libraries · 1997 · 1.1K citations
XML-QL: A Query Language for XML
Alin Deutsch · Medical Entomology and Zoology · 1998 · 417 citations
R. M. Burstall, David MacQueen, Donald Sannella · 1980 · 351 citations
Luca Cardelli, Andrew D. Gordon · 2000 · 351 citations