Skip to main content

Higher Order Matching for Program Transformation

  • Conference paper
Functional and Logic Programming (FLOPS 1999)

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

Included in the following conference series:

Abstract

We present a simple, practical algorithm for higher order matching in the context of automatic program transformation. Our algorithm finds more matches than the standard second order matching algorithm of Huet and Lang, but it has an equally simple specification, and it is better suited to the transformation of programs in modern programming languages such as Haskell or ML. The algorithm has been implemented as part of the MAG system for transforming functional programs.

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Alt, M., Fecht, C., Ferdinand, C., Wilhelm, R.: The TrafoLa-H subsystem. In: Hoffmann, B., Krieg-Brückner, B. (eds.) Program Development by Specification and Transformation The PROSPECTRA Methodology, Language Family, and System. LNCS, vol. 680, pp. 539–576. Springer, Heidelberg (1993)

    Google Scholar 

  2. Biggerstaff, T.: Pattern matching for program generation: A user manual. Technical Report MSR TR-98-55, Microsoft Research (1998), Available from http://www.research.microsoft.com/~tedb/Publications.htm

  3. Bird, R.S.: The promotion and accumulation strategies in functional programming. ACM Transactions on Programming Languages and Systems 6(4), 487–504 (1984)

    Article  MATH  MathSciNet  Google Scholar 

  4. Bird, R.S.: Introduction to Functional Programming in Haskell. International Series in Computer Science. Prentice Hall, Englewood Cliffs (1998)

    Google Scholar 

  5. Boulton, R.J.: A restricted form of higher-order rewriting applied to an HDL semantics. In: Hsiang, J. (ed.) RTA 1995. LNCS, vol. 914, pp. 309–323. Springer, Heidelberg (1995)

    Google Scholar 

  6. Cai, J., Paige, R., Tarjan, R.E.: More efficient bottom-up multi-pattern matching in trees. Theoretical Computer Science 106(1), 21–60 (1992)

    Article  MATH  MathSciNet  Google Scholar 

  7. Comon, H.: Higher-order matching and tree automata. In: Nielsen, M. (ed.) CSL 1997. LNCS, vol. 1414, pp. 157–176. Springer, Heidelberg (1998)

    Chapter  Google Scholar 

  8. Crew, R.F.: A language for examining abstract syntax trees. In: Ramming, C. (ed.) Proc. of the Conf. on Domain-Specific Languages. Usenix (1997)

    Google Scholar 

  9. de Moor, O., Sittampalam, G.: Generic program transformation. In: Third International Summer School on Advanced Functional Programming. LNCS. Springer, Heidelberg (1998)

    Google Scholar 

  10. de Moor, O., Sittampalam, G.: Higher-order matching for program transformation (full report) (March 1999), Available from http://www.comlab.ox.ac.uk/oucl/users/oege.demoor/pubs.htm

  11. Dougherty, D.J.: Higher-order unification via combinators. Theoretical Computer Science 114, 273–298 (1993)

    Article  MATH  MathSciNet  Google Scholar 

  12. Dowek, G.: A second-order pattern matching algorithm for the cube of typed lambda calculi. In: Tarlecki, A. (ed.) MFCS 1991. LNCS, vol. 520, pp. 151–160. Springer, Heidelberg (1991)

    Google Scholar 

  13. Dowek, G.: Third order matching is decidable. In: Nielsen, M., Thomas, W. (eds.) Logic in Computer Science (LICS). IEEE, Los Alamitos (1992)

    Google Scholar 

  14. Huet, G., Lang, B.: Proving and applying program transformations expressed with second-order patterns. Acta Informatica 11, 31–55 (1978)

    Article  MATH  MathSciNet  Google Scholar 

  15. Krieg-Brückner, B., Liu, J., Shi, H., Wolff, B.: Towards correct, efficient and reusable transformational developments. In: Jähnichen, S., Broy, M. (eds.) KORSO 1995. LNCS, vol. 1009, pp. 270–284. Springer, Heidelberg (1995)

    Google Scholar 

  16. Miller, D.: A logic programming language with lambda-abstraction, function variables, and simple unification. Journal of Logic and Computation 1, 479–536 (1991)

    Article  Google Scholar 

  17. Nipkow, T.: Higher-order unification, polymorphism, and subsorts. In: Okada, M., Kaplan, S. (eds.) CTRS 1990. LNCS, vol. 516, pp. 436–447. Springer, Heidelberg (1991)

    Google Scholar 

  18. Nipkow, T.: Functional unification of higher-order patterns. In: 8th IEEE Symposium on Logic in Computer Science, pp. 64–74. IEEE Computer Society Press, Los Alamitos (1993)

    Google Scholar 

  19. Paige, R.: Viewing a program transformation system at work. In: Penjam, J. (ed.) PLILP 1994. LNCS, vol. 844, pp. 5–24. Springer, Heidelberg (1994)

    Google Scholar 

  20. Peyton-Jones, S.L., Santos, A.L.M.: A transformation-based optimiser for Haskell. Science of Computer Programming 32(1-3), 3–48 (1998)

    Article  Google Scholar 

  21. Pfenning, F., Elliott, C.: Higher-order abstract syntax. In: Proc. SIGPLAN 1988 Conf. on Programming Language Design and Implementation, pp. 199–208. ACM, New York (1988)

    Chapter  Google Scholar 

  22. Simonyi, C.: Intentional programming: Innovation in the legacy age. Presented at IFIP Working group 2.1(1996), Available from http://www.research.microsoft.com/research/ip/

  23. Smith, D.R.: KIDS: A semiautomatic program development system. IEEE Transactions on Software Engineering 16(9), 1024–1043 (1990)

    Article  Google Scholar 

  24. Springintveld, J.: Third-order matching in the presence of type constructors. In: Dezani-Ciancaglini, M., Plotkin, G. (eds.) TLCA 1995. LNCS, vol. 902, pp. 428–442. Springer, Heidelberg (1995)

    Chapter  Google Scholar 

  25. Wolfram, D.A.: The Clausal Theory of Types. Cambridge Tracts in Theoretical Computer Science, vol. 21. Cambridge University Press, Cambridge (1993)

    Book  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 1999 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

de Moor, O., Sittampalam, G. (1999). Higher Order Matching for Program Transformation. In: Middeldorp, A., Sato, T. (eds) Functional and Logic Programming. FLOPS 1999. Lecture Notes in Computer Science, vol 1722. Springer, Berlin, Heidelberg. https://doi.org/10.1007/10705424_14

Download citation

  • DOI: https://doi.org/10.1007/10705424_14

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-66677-6

  • Online ISBN: 978-3-540-47950-5

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics