Skip to main content

Compilation of non-linear, second order patterns on S-expressions

  • Implementation Of Pattern Matching
  • Conference paper
  • First Online:
Programming Language Implementation and Logic Programming (PLILP 1990)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 456))

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Bibliography

  1. Harold Abelson, Gerald Sussman, with Julie Sussman, Structure and Interpretation of Computer Programs, MIT Press, Cambridge MA, 1985.

    Google Scholar 

  2. Jean-Paul Arcangeli, Christian Pomian, Principles of Plasma pattern and alternative structure compilation, Theoretical Computer Science, Vol 71, 1970, pp 177–191.

    Google Scholar 

  3. Lennart Augustsson, Compiling Pattern Matching, Conference on Functional Programming and Machine Architecture, Nancy 1985, Lecture Note in Computer Science 201, Springer Verlag 1985.

    Google Scholar 

  4. R. M. Burstall, Proving Properties of Programs by structural Induction, The Computer Journal, Vol 12, No 1.

    Google Scholar 

  5. 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.

    Google Scholar 

  6. Reinhold Heckmann, A Functional Language for the Specification of Complex Tree Transformations, ESOP 88, Lecture Notes on Computer Science, Springer 1988.

    Google Scholar 

  7. C. Hewitt, B. Smith, Towards a programming Apprentice, IEEE Transactions on Software Engineering, SE-1, No 1, March 1975, pp 26–45.

    Google Scholar 

  8. Paul Hudak & Philip Wadler (eds), Report on the Programming Language Haskell, YALEU/DCS/RR-777, 1 April 1990.

    Google Scholar 

  9. Robert R. Kessler, Lisp, Objects, and Symbolic Programming, Scott, Foreman/Little, Brown College Division, Glenview, Illinois, 1988.

    Google Scholar 

  10. Alain Laville, Évaluation paresseuse des filtrages avec priorité, Application au langage ML, Thèse de Doctorat, Université Paris VII, Février 1988.

    Google Scholar 

  11. Eugen Neidl, Étude des relations avec l'interprète dans la compilation de Lisp, Thèse de troisième cycle, Université Paris VI, 1984.

    Google Scholar 

  12. Simon L. Peyton Jones, The Implementation of Functional Programming Languages, Prentice-Hall, May 1986.

    Google Scholar 

  13. Christian Queinnec, Lisp, Macmillan, 1984.

    Google Scholar 

  14. Jonathan A. Rees, William Clinger, Revised 3 Report on the Algorithmic Language Scheme, ACM SIGPLAN Notices, 21, 12, Dec 1986, pp 37–79.

    Google Scholar 

  15. David A. Schmidt, Denotational Semantics, A Methodology for Language Development, Allyn and Bacon, Inc., Newton, Mass., 1986.

    Google Scholar 

  16. Joseph E. Stoy, Denotational Semantics: The Scott-Strachey Approach to Programming Language Theory, MIT Press, Cambridge, Mass., 1977.

    Google Scholar 

  17. M. Takeichi, Lambda-Hoisting: a Transformation technique for fully lazy evaluation of functional program, New Generation Computing, Vol 5, 1988, pp 377–391.

    Google Scholar 

  18. Warren Teitelman, InterLisp Reference Manual, 1978.

    Google Scholar 

  19. D. A. Turner, The SASL Language Manual, Technical Report CS/75/1, Department of Computational Science, University of Saint Andrews.

    Google Scholar 

  20. Philip Wadler, Efficient Compilation of Pattern-Matching, in PeytonJones86.

    Google Scholar 

  21. Pierre Weis, The CAML Reference Manual, INRIA 1989.

    Google Scholar 

  22. Patrick H. Winston, Berthold K. Horn, Lisp, 3rd Edition, Addison Wesley, 1988.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Pierre Deransart Jan Maluszyński

Rights and permissions

Reprints 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

Publish with us

Policies and ethics