Abstract
Pattern matching is a key concept for rule-based expert systems. Simple pattern interpreters appear in nearly every book on Lisp. Pattern matching is also a useful tool for case analyses as provided by functional languages such as ML or Miranda™. These two uses are somewhat different since functional languages emphasize a discrimination based on types while Lisp, or Plasma, make use of S-expressions or segments of S-expressions within patterns. The paper presents an intermediate language for patterns and its denotational semantics. This reduced language is powerful enough to express boolean composition of patterns as well as segment handling and unbounded pattern repetition. A compiler is then defined which translates patterns into functional code. We discuss some compilation variant as well as the integration of the pattern sub-language into Lisp. These capabilities make pattern matching an useful and efficient tool for a wide class of applicative languages and allow to incorporate into patterns more knowledge about the form or gestalt of the data to be matched.
Preview
Unable to display preview. Download preview PDF.
Bibliography
Harold Abelson, Gerald Sussman, with Julie Sussman, Structure and Interpretation of Computer Programs, MIT Press, Cambridge MA, 1985.
Jean-Paul Arcangeli, Christian Pomian, Principles of Plasma pattern and alternative structure compilation, Theoretical Computer Science, Vol 71, 1970, pp 177–191.
Lennart Augustsson, Compiling Pattern Matching, Conference on Functional Programming and Machine Architecture, Nancy 1985, Lecture Note in Computer Science 201, Springer Verlag 1985.
R. M. Burstall, Proving Properties of Programs by structural Induction, The Computer Journal, Vol 12, No 1.
R. Kent Dybvig, Daniel P. Friedman, Christopher T. Haynes, Expansion-Passing-Style: A General Macro Mechanism, Lisp and Symbolic Computation, Vol 1, n 1, June 1988, pp 53–76.
Reinhold Heckmann, A Functional Language for the Specification of Complex Tree Transformations, ESOP 88, Lecture Notes on Computer Science, Springer 1988.
C. Hewitt, B. Smith, Towards a programming Apprentice, IEEE Transactions on Software Engineering, SE-1, No 1, March 1975, pp 26–45.
Paul Hudak & Philip Wadler (eds), Report on the Programming Language Haskell, YALEU/DCS/RR-777, 1 April 1990.
Robert R. Kessler, Lisp, Objects, and Symbolic Programming, Scott, Foreman/Little, Brown College Division, Glenview, Illinois, 1988.
Alain Laville, Évaluation paresseuse des filtrages avec priorité, Application au langage ML, Thèse de Doctorat, Université Paris VII, Février 1988.
Eugen Neidl, Étude des relations avec l'interprète dans la compilation de Lisp, Thèse de troisième cycle, Université Paris VI, 1984.
Simon L. Peyton Jones, The Implementation of Functional Programming Languages, Prentice-Hall, May 1986.
Christian Queinnec, Lisp, Macmillan, 1984.
Jonathan A. Rees, William Clinger, Revised 3 Report on the Algorithmic Language Scheme, ACM SIGPLAN Notices, 21, 12, Dec 1986, pp 37–79.
David A. Schmidt, Denotational Semantics, A Methodology for Language Development, Allyn and Bacon, Inc., Newton, Mass., 1986.
Joseph E. Stoy, Denotational Semantics: The Scott-Strachey Approach to Programming Language Theory, MIT Press, Cambridge, Mass., 1977.
M. Takeichi, Lambda-Hoisting: a Transformation technique for fully lazy evaluation of functional program, New Generation Computing, Vol 5, 1988, pp 377–391.
Warren Teitelman, InterLisp Reference Manual, 1978.
D. A. Turner, The SASL Language Manual, Technical Report CS/75/1, Department of Computational Science, University of Saint Andrews.
Philip Wadler, Efficient Compilation of Pattern-Matching, in PeytonJones86.
Pierre Weis, The CAML Reference Manual, INRIA 1989.
Patrick H. Winston, Berthold K. Horn, Lisp, 3rd Edition, Addison Wesley, 1988.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1990 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Queinnec, C. (1990). Compilation of non-linear, second order patterns on S-expressions. In: Deransart, P., Maluszyński, J. (eds) Programming Language Implementation and Logic Programming. PLILP 1990. Lecture Notes in Computer Science, vol 456. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0024194
Download citation
DOI: https://doi.org/10.1007/BFb0024194
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-53010-7
Online ISBN: 978-3-540-46298-9
eBook Packages: Springer Book Archive