Abstract:
Abstract: We derive a compiler for ML-style 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.
Citations
|
1463
|
The Definition of Standard ML
– Milner, Tofte, et al.
- 1990
|
|
552
|
Partial evaluation and automatic program generation
– Jones, Gomard, et al.
- 1993
|
|
496
|
S.: The Implementation of Functional Programming Languages
– Jones
- 1987
|
|
447
|
Fast pattern matching in strings
– Knuth, Morris, et al.
- 1977
|
|
88
|
The ZINC experiment: An economical implementation of the ML language
– Leroy
- 1990
|
|
71
|
et al. Report on the programming language Haskell: a non-strict, purely functional language version 1.2
– Hudak
- 1992
|
|
61
|
Compiling Pattern Matching
– Augustsson
- 1985
|
|
51
|
Generalized partial computation
– Futamura, Nogi
|
|
41
|
Partial evaluation of pattern matching in strings
– Consel, Danvy
- 1989
|
|
33
|
Call by need computations in non-ambiguous linear term rewriting systems
– Huet, L'evy
- 1979
|
|
27
|
Generating optimizing specializers
– Glück, Jørgensen
- 1994
|
|
24
|
Compiling pattern matching by term decomposition
– Puel, Suárez
- 1989
|
|
18
|
Automata-driven indexing of Prolog clauses
– Ramesh, Ramakrishnan, et al.
- 1990
|
|
12
|
Implementation of Lazy Pattern Matching Algorithms
– Laville
- 1988
|
|
9
|
Generating a pattern matching compiler by partial evaluation
– Jrgensen
- 1990
|
|
7
|
Compiler generation by partial evaluation
– Jrgensen
- 1992
|
|
5
|
Tree pattern matching for ML (extended abstract). Unpublished manuscript
– Baudinet, MacQueen
- 1985
|
|
1
|
A term pattern-match compiler inspired by finite automata theory
– Petterson
- 1992
|