Results 1 -
8 of
8
XDuce: A Statically Typed XML Processing Language
, 2002
"... this paper we describe a statically typed XML processing language called XDuce (o#cially pronounced "transduce"). XDuce is a functional language whose primitive data structures represent XML documents and whose types---called regular expression types---correspond to document schemas. The motivating ..."
Abstract
-
Cited by 127 (5 self)
- Add to MetaCart
this paper we describe a statically typed XML processing language called XDuce (o#cially pronounced "transduce"). XDuce is a functional language whose primitive data structures represent XML documents and whose types---called regular expression types---correspond to document schemas. The motivating principle behind its design is that a simple, clean, and powerful type system for XML processing can be based directly on the theory of regular tree automata
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 pattern-matching facilities (as in ML) with regular expression operators such as repetition (*), alternation (|), etc., that can match arbitrarily long sequences of ..."
Abstract
-
Cited by 104 (10 self)
- Add to MetaCart
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
Context Patterns in Haskell
- In 8th Int. Workshop on Implementation of Functional Languages, LNCS 1268
, 1996
"... In modern functional languages, pattern matching is used to define functions or expressions by performing an analysis of the structure of values. We extend Haskell with a new nonlocal form of patterns called context patterns, which allow the matching of subterms without fixed distance from the root ..."
Abstract
-
Cited by 8 (2 self)
- Add to MetaCart
In modern functional languages, pattern matching is used to define functions or expressions by performing an analysis of the structure of values. We extend Haskell with a new nonlocal form of patterns called context patterns, which allow the matching of subterms without fixed distance from the root of the whole term. The semantics of context patterns is defined by transforming them to standard Haskell programs. Typical applications of context patterns are functions which search a data structure and possibly transform it. This concept can easily be adopted for other languages using pattern matching like ML or Clean.
Pattern Guards and Transformational Patterns
, 2000
"... We propose three extensions to patterns and pattern matching in Haskell. The first, pattern guards, allows the guards of a guarded equation to match patterns and bind variables, as well as to test boolean condition. For this we introduce a natural generalisation of guard expressions to guard quali ..."
Abstract
-
Cited by 6 (0 self)
- Add to MetaCart
We propose three extensions to patterns and pattern matching in Haskell. The first, pattern guards, allows the guards of a guarded equation to match patterns and bind variables, as well as to test boolean condition. For this we introduce a natural generalisation of guard expressions to guard qualifiers. A frequently-occurring special case is that a function should be applied to a matched value, and the result of this is to be matched against another pattern. For this we introduce a syntactic abbreviation, transformational patterns, that is particularly useful when dealing with views. These proposals can be implemented with very modest syntactic and implementation cost. They are upward compatible with Haskell; all existing programs will continue to work. We also offer a third, much more speculative proposal, which provides the transformational-pattern construct with additional power to explicitly catch pattern match failure. We demonstrate the usefulness of the proposed extension by several examples, in particular, we compare our proposal with views, and we also discuss the use of the new patterns in combination with equational reasoning.
Context Patterns, Part II
- In Implementation of Functional Languages
, 1997
"... Functional languages allow the definition of functions by pattern matching, which performs an analysis of the structure of values. However, the structures which can be described by such patterns are restricted to a fixed portion from the the root of the value. Context patterns are a new nonlocal for ..."
Abstract
-
Cited by 2 (0 self)
- Add to MetaCart
Functional languages allow the definition of functions by pattern matching, which performs an analysis of the structure of values. However, the structures which can be described by such patterns are restricted to a fixed portion from the the root of the value. Context patterns are a new nonlocal form of patterns, which allow the matching of subterms without fixed distance from the root of the value. Typical applications of context patterns are functions which search a data structure for patterns and transform it by replacing the pattern. In this paper we introduce a new construct called extended context, which allows the definition of transformational functions without superfluous repetition of the recursive search.
Partial Evaluation applied to Symbolic Pattern Matching with Intelligent Backtrack
- Workshop in Static Analysis, number 81–82 in Bigre
, 1992
"... Symbolic pattern matching as offered by Lisp dialects allows to scan Sexpressions, to verify their shape and to extract or compare subparts of them. A rich set of patterns exists and among them alternate patterns. Such patterns are handled through backtrack: a failure forces the pattern matcher to r ..."
Abstract
-
Cited by 1 (0 self)
- Add to MetaCart
Symbolic pattern matching as offered by Lisp dialects allows to scan Sexpressions, to verify their shape and to extract or compare subparts of them. A rich set of patterns exists and among them alternate patterns. Such patterns are handled through backtrack: a failure forces the pattern matcher to regress to its last point of choice and to try another branch. The usual naive backtrack algorithm forgets all the informations acquired on the datum from the last point of choice up to the failure point. Our algorithm provides intelligent backtrack i.e. these informations are given back to the pattern matcher which can then use them to choose the appropriate backtrack point therefore eliminating redundant tests or dead-end branches. It turns out that this very simple idea "Don't throw any information painfully acquired", forms the basis of many clever algorithms such as Knuth-Morris-Pratt (KMP) or Boyer-Moore (BM) for strings, Hoffmann-O'Donnell for trees etc. The other benefit comes from th...
Control Flow Analysis: A Compilation Paradigm for Functional Language
- In Proceedings of SAC 95
, 1995
"... Control flow analysis (cfa) is now well known but is not widely used in real compilers since optimizations that can be achieved via cfa are not so clear. This paper aims at showing that control flow analysis is very valuable in practice by presenting a fundamental optimization based on cfa: the clos ..."
Abstract
-
Cited by 1 (0 self)
- Add to MetaCart
Control flow analysis (cfa) is now well known but is not widely used in real compilers since optimizations that can be achieved via cfa are not so clear. This paper aims at showing that control flow analysis is very valuable in practice by presenting a fundamental optimization based on cfa: the closure representation algorithm, the essential optimizing phase of a -language compiler. Since naive and regular scheme to represent functions as heap allocated structures is far too inefficient, the main effort of modern functional languages compilers is devoted to minimize the amount of memory allocated for functions. In particular, compilers try to discover when a procedure can safely be handled without any allocation at all. Previously described methods to do so are ad hoc, depending on the language compiled, and not very precise. Using cfa, we present a general approach which produces better results. This refined closure analysis subsumes previously known ones and optimizes more than 80 % ...
PLT @ Northeastern University
"... Abstract. Pattern matching is a widely used technique in functional languages, especially those in the ML and Haskell traditions, where it is at the core of the semantics. In languages in the Lisp tradition, in contrast, pattern matching it typically provided by libraries built with macros. We prese ..."
Abstract
- Add to MetaCart
Abstract. Pattern matching is a widely used technique in functional languages, especially those in the ML and Haskell traditions, where it is at the core of the semantics. In languages in the Lisp tradition, in contrast, pattern matching it typically provided by libraries built with macros. We present match, a sophisticated pattern matcher for Racket, implemented as language extension. using macros. The system supports novel and widely-useful pattern-matching forms, and is itself extensible. The extensibility of match is implemented via a general technique for creating extensible language extensions. 1 Extending Pattern Matching The following Racket 1 [12] program finds the magnitude of a complex number, represented in either Cartesian or polar form as a 3-element list, using the first element as a type tag: (define (magnitude n) (cond [(eq? (first n) ’cart) (sqrt (+ (sqr (second n)) (sqr (third n))))]

