MK Pattern Match Compilation and Partial Evaluation

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.

[1]  Xavier Leroy,et al.  The ZINC experiment : an economical implementation of the ML language , 1990 .

[2]  Mariann e Baudine Tree Pattern Matching for ML ( extended abstract ) , 1985 .

[3]  Jesper Jørgensen,et al.  Generating a Pattern Matching Compiler by Partial Evaluation , 1990, Functional Programming.

[4]  Peter Sestoft,et al.  Partial evaluation and automatic program generation , 1993, Prentice Hall international series in computer science.

[5]  Lars Birkedal,et al.  Partial Evaluation of Standard ML Master's Thesis , 1993 .

[6]  I. V. Ramakrishnan,et al.  Automata-driven indexing of Prolog clauses , 1989, POPL '90.

[7]  Laurence Puel,et al.  Compiling pattern matching by term decomposition , 1990, LISP and Functional Programming.

[8]  Olivier Danvy,et al.  Partial Evaluation of Pattern Matching in Strings , 1989, Inf. Process. Lett..

[9]  Lennart Augustsson,et al.  Compiling Pattern Matching , 1985, FPCA.

[10]  Robert Glück,et al.  Generating optimizing specializers , 1994, Proceedings of 1994 IEEE International Conference on Computer Languages (ICCL'94).

[11]  Alain Laville Implementation of Lazy Pattern Matching Algorithms , 1988, ESOP.

[12]  Mikael Pettersson,et al.  A Term Pattern-Match Compiler Inspired by Finite Automata Theory , 1992, CC.

[13]  Robin Milner,et al.  Definition of standard ML , 1990 .

[14]  Jesper Jørgensen,et al.  Compiler Generation by Partial Evaluation , 1992 .

[15]  Nevin Heintze,et al.  ML Partial Evaluation Using Set-Based Analysis , 1994 .

[16]  Donald E. Knuth,et al.  Fast Pattern Matching in Strings , 1977, SIAM J. Comput..

[17]  Simon L. Peyton Jones,et al.  Report on the programming language Haskell: a non-strict, purely functional language version 1.2 , 1992, SIGP.

[18]  Simon L. Peyton Jones,et al.  The Implementation of Functional Programming Languages , 1987 .