Results 1  10
of
21
Regular expression pattern matching for XML
, 2003
"... We propose regular expression pattern matching as a core feature of programming languages for manipulating XML. We extend conventional patternmatching facilities (as in ML) with regular expression operators such as repetition (*), alternation (), etc., that can match arbitrarily long sequences of ..."
Abstract

Cited by 110 (10 self)
 Add to MetaCart
We propose regular expression pattern matching as a core feature of programming languages for manipulating XML. We extend conventional patternmatching 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 firstmatch 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
Disunification: a Survey
 Computational Logic: Essays in Honor of Alan
, 1991
"... Solving an equation in an algebra of terms is known as unification. Solving more complex formulas combining equations and involving in particular negation is called disunification. With such a broad definition, many works fall into the scope of disunification. The goal of this paper is to survey the ..."
Abstract

Cited by 56 (9 self)
 Add to MetaCart
Solving an equation in an algebra of terms is known as unification. Solving more complex formulas combining equations and involving in particular negation is called disunification. With such a broad definition, many works fall into the scope of disunification. The goal of this paper is to survey these works and bring them together in a same framework. R'esum'e On appelle habituellement (algorithme d') unification un algorithme de r'esolution d'une 'equation dans une alg`ebre de termes. La r'esolution de formules plus complexes, comportant en particulier des n'egations, est appel'ee ici disunification. Avec une d'efinition aussi 'etendue, de nombreux travaux peuvent etre consid'er'es comme portant sur la disunification. L'objet de cet article de synth`ese est de rassembler tous ces travaux dans un meme formalisme. Laboratoire de Recherche en Informatique, Bat. 490, Universit'e de ParisSud, 91405 ORSAY cedex, France. Email: comon@lri.lri.fr i Contents 1 Syntax 5 1.1 Basic Defini...
Programming in Equational Logic: Beyond Strong Sequentiality
, 1993
"... Orthogonal term rewriting systems (also known as regular systems) provide an elegant framework for programming in equational logic. O'Donnell showed that the paralleloutermost strategy, which replaces all outermost redexes in each step, is complete for such systems. Many of the reductions performed ..."
Abstract

Cited by 42 (0 self)
 Add to MetaCart
Orthogonal term rewriting systems (also known as regular systems) provide an elegant framework for programming in equational logic. O'Donnell showed that the paralleloutermost strategy, which replaces all outermost redexes in each step, is complete for such systems. Many of the reductions performed by this strategy could be wasteful in general. A lazy normalization algorithm that completely eliminated these wasteful reductions by reducing only "needed redexes" was later developed by Huet and Levy. However, this algorithm required the input programs to be restricted to the subclass of strongly sequential systems. This is because needed redexes do not exist for all orthogonal programs, and even when they do, they may not be computable. It is therefore quite natural to ask whether it is possible to devise a complete normalization algorithm for the entire class that minimizes (rather than eliminate) the wasteful reductions. In this paper we propose a solution to this problem using the concept of a necessary set of redexes. In such a set, at least one of the redexes must be reduced to normalize a term. We devise an algorithm to compute a necessary set for any term not in normal form and show that a strategy that repeatedly reduces all redexes in such a set is complete for orthogonal programs. We also show that our algorithm is "optimal" among all normalization algorithms that are based on lefthand sides alone. This means that our algorithm is lazy (like HuetLevy's) on strongly sequential parts of a program and "relaxes laziness minimally" to handle the other parts and thus does not sacrifice generality for the sake of efficiency.
Adaptive Pattern Matching
, 1992
"... Pattern matching is an important operation used in many applications such as functional programming, rewriting and rulebased expert systems. By preprocessing the patterns into a DFAlike automaton, we can rapidly select the matching pattern(s) in a single scan of the relevant portions of the inp ..."
Abstract

Cited by 22 (5 self)
 Add to MetaCart
Pattern matching is an important operation used in many applications such as functional programming, rewriting and rulebased expert systems. By preprocessing the patterns into a DFAlike automaton, we can rapidly select the matching pattern(s) in a single scan of the relevant portions of the input term. This automaton is typically based on lefttoright traversal of the patterns. By adapting the traversal order to suit the set of input patterns, it is possible to considerably reduce the space and matching time requirements of the automaton.
Dependently Typed Pattern Matching
 Journal of Universal Computer Science
, 2003
"... The mechanism for declaring datatypes to model data structures in functional programming languages such as Standard ML and Haskell can offer both convenience in programming and clarity in code. With the introduction of dependent datatypes in DML, the programmer can model data structures with mor ..."
Abstract

Cited by 15 (8 self)
 Add to MetaCart
The mechanism for declaring datatypes to model data structures in functional programming languages such as Standard ML and Haskell can offer both convenience in programming and clarity in code. With the introduction of dependent datatypes in DML, the programmer can model data structures with more accuracy, thus capturing more program invariants. In this paper, we study some practical aspects of dependent datatypes that affect both typechecking and compiling pattern matching. The results, which have already been tested, demonstrate that dependent datatype can not only offer various programming benefits but also lead to performance gains, yielding a concrete case where safer programs run faster.
The Functional Strategy and Transitive Term Rewriting Systems
, 1993
"... The functional strategy has been widely used implicitly (Haskell, Miranda, Lazy ML) and explicitly (Clean) as an efficient, intuitively easy to understand reduction strategy for term (or graph) rewriting systems. However, little is known of its formal properties since the strategy deals with priorit ..."
Abstract

Cited by 15 (1 self)
 Add to MetaCart
The functional strategy has been widely used implicitly (Haskell, Miranda, Lazy ML) and explicitly (Clean) as an efficient, intuitively easy to understand reduction strategy for term (or graph) rewriting systems. However, little is known of its formal properties since the strategy deals with priority rewriting which significantly complicates the semantics. Nevertheless, this paper shows that some formal results about the functional strategy can be produced by studying the functional strategy entirely within the standard framework of orthogonal term rewriting systems. A concept is introduced that is one of the key aspects of the efficiency of the functional strategy: transitive indexes . The corresponding class of transitive term rewriting systems is characterized. An efficient normalizing strategy is given for these rewriting systems. It is shown that the functional strategy is normalizing for the class of leftincompatible term rewriting systems. 1. Introduction An interesting commo...
ML pattern match compilation and partial evaluation
, 1996
"... : We derive a compiler for MLstyle pattern matches. It is conceptually simple and produces reasonably good compiled matches. The derivation is inspired by the instrumentation and partial evaluation of naive string matchers. Following that paradigm, we first present a general and naive ML pattern ma ..."
Abstract

Cited by 11 (1 self)
 Add to MetaCart
: We derive a compiler for MLstyle pattern matches. It is conceptually simple and produces reasonably good compiled matches. The derivation is inspired by the instrumentation and partial evaluation of naive string matchers. Following that paradigm, we first present a general and naive ML pattern matcher, instrument it to collect and exploit extra information, and show that partial evaluation of the instrumented general matcher with respect to a given match produces an efficient specialized matcher. We then discard the partial evaluator and show that a match compiler can be obtained just by slightly modifying the instrumented general matcher. The resulting match compiler is interesting in its own right, and naturally detects inexhaustive matches and redundant match rules. 1 Introduction Consel and Danvy [3] studied a general string matcher, taking two inputs: a pattern string to look for, and an object string to look in. The matcher finds the first occurrence (if any) of the pattern ...
Compiling Lazy Pattern Matching
 In Proc. of the 1992 conference on Lisp and Functional Programming
, 1992
"... this paper we take a more direct approach: we compile pattern matching on overlapping patterns. We first recall the semantics of lazy pattern matching, as given by A. Laville [5]. Then, we explain our compilation technique as a source to source transformation. Given a set of patterns, several compil ..."
Abstract

Cited by 11 (4 self)
 Add to MetaCart
this paper we take a more direct approach: we compile pattern matching on overlapping patterns. We first recall the semantics of lazy pattern matching, as given by A. Laville [5]. Then, we explain our compilation technique as a source to source transformation. Given a set of patterns, several compilations are possible, we prove that they all satisfy a partial correctness
Fast Parallel Implementation of Lazy Languages  The EQUALS Experience
 Journal of Functional Programming
, 1992
"... This paper describes equals, a fast parallel implementation of a lazy functional language on a commercially available sharedmemory parallel machine, the Sequent Symmetry. In contrast to previous implementations, we detect parallelism automatically using strictness analysis. Another important differ ..."
Abstract

Cited by 11 (4 self)
 Add to MetaCart
This paper describes equals, a fast parallel implementation of a lazy functional language on a commercially available sharedmemory parallel machine, the Sequent Symmetry. In contrast to previous implementations, we detect parallelism automatically using strictness analysis. Another important difference between equals and previous implementations is the use of reference counting for memory management, instead of garbage collection. Our implementation shows that reference counting leads to very good scalability, low memory requirements and improved locality. We compare our results with other sequential (SML/NJ) and parallel (h; Gimachine and GAML) implementations of functional languages.
Two Techniques for Compiling Lazy Pattern Matching
, 1994
"... In ML style pattern matching, pattern size is not constrained and ambiguous patterns are allowed. This generality leads to a clear and concise programming style but is challenging in the context of lazy evaluation. A first challenge concerns language designers: in lazy ML, the evaluation order of ex ..."
Abstract

Cited by 10 (1 self)
 Add to MetaCart
In ML style pattern matching, pattern size is not constrained and ambiguous patterns are allowed. This generality leads to a clear and concise programming style but is challenging in the context of lazy evaluation. A first challenge concerns language designers: in lazy ML, the evaluation order of expressions follows actual data dependencies. That is, only the computations that are needed to produce the final result are performed. Once given a proper (that is, nonambiguous) semantics, pattern matching should be compiled in a similar spirit: any value matching a given pattern should be recognized by performing only the minimal number of elementary tests needed to do so. This challenge was first met by A. Laville. A second challenge concerns compiler designers. As it stands, Laville's compilation algorithm cannot be incorporated in an actual lazy ML compiler for efficiency and completeness reasons. As a matter of fact, Laville's original algorithm did not fully treat the case of intege...