Skip to main content

Basic Pattern Matching Calculi: a Fresh View on Matching Failure

  • Conference paper
Book cover Functional and Logic Programming (FLOPS 2004)

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

Included in the following conference series:

Abstract

We propose pattern matching calculi as a refinement of λ-calculus that integrates mechanisms appropriate for fine-grained modelling of non-strict pattern matching.

Compared with the functional rewriting strategy usually employed to define the operational semantics of pattern matching in non-strict functional programming languages like Haskell or Clean, our pattern matching calculi achieve the same effects using simpler and more local rules.

The main device is to embed into expressions the separate syntactic category of matchings; the resulting language naturally encompasses pattern guards and Boolean guards as special cases.

By allowing a confluent reduction system and a normalising strategy, these pattern matching calculi provide a new basis for operational semantics of non-strict programming languages and also for implementations.

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. Aczel, P.: A general Church-Rosser theorem. unpublished note, see [20] (1978)

    Google Scholar 

  2. Barthe, G., et al.: Pure Patterns Type Systems. In: POPL 2003, ACM, New York (2003)

    Google Scholar 

  3. Breazu-Tannen, V., Kesner, D., Puel, L.: A Typed Pattern Calculus. In: Proceedings, Eighth Annual IEEE Symposium on Logic in Computer Science, Montreal, Canada, pp. 262–274. IEEE Computer Society Press, Los Alamitos (1993)

    Chapter  Google Scholar 

  4. Cirstea, H., Kirchner, C.: Combining Higher-Order and First-Order Computation Using ρ-calculus: Towards a semantics of ELAN. In: Gabbay, D., de Rijke, M. (eds.) Frontiers of Combining Systems 2, October 1998, pp. 95–120. Wiley, Chichester (1999)

    Google Scholar 

  5. Cirstea, H., Kirchner, C.: The rewriting calculus — Part I and II. Logic Journal of the Interest Group in Pure and Applied Logics 9, 427–498 (2001)

    MathSciNet  Google Scholar 

  6. Erwig, M., Jones, S.P.: Pattern Guards and Transformational Patterns. In: Haskell Workshop 2000. ENTCS, vol. 41(1), pp. 12.1–12.27 (2001)

    Google Scholar 

  7. Faure, G., Kirchner, C.: Exceptions in the rewriting calculus. In: Tison, S. (ed.) RTA 2002. LNCS, vol. 2378, pp. 66–82. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  8. Forest, J., Kesner, D.: Expression Reduction Systems with Patterns. In: Nieuwenhuis, R. (ed.) RTA 2003. LNCS, vol. 2706, pp. 107–122. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  9. Harrison, W.L., Sheard, T., Hook, J.: Fine Control of Demand in Haskell. In: Boiten, E.A., Möller, B. (eds.) MPC 2002. LNCS, vol. 2386, p. 68. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  10. Kahl, W.: Basic Pattern Matching Calculi: Syntax, Reduction, Confluence, and Normalisation. SQRL Rep. 16, Software Quality Res. Lab., McMaster Univ. (2003)

    Google Scholar 

  11. Klop, J.W.: Combinatory Reduction Systems. Mathematical Centre Tracts 127, Centre for Mathematics and Computer Science, Amsterdam, PhD thesis (1980)

    Google Scholar 

  12. Le Fessant, F., Maranget, L.: Optimizing Pattern Matching. In: Leroy, X. (ed.) ICFP 2001, pp. 26–37. ACM, New York (2001)

    Chapter  Google Scholar 

  13. Maranget, L.: Two Techniques for Compiling Lazy Pattern Matching. Technical Report RR 2385, INRIA (1994)

    Google Scholar 

  14. de Mol, M., van Eekelen, M., Plasmeijer, R.: Theorem Proving for Functional Programmers — Sparkle: A Functional Theorem Prover. In: Arts, T., Mohnen, M. (eds.) IFL 2002. LNCS, vol. 2312, pp. 55–71. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  15. Nipkow, T., Paulson, L.C., Wenzel, M.: Isabelle/HOL. LNCS, vol. 2283. Springer, Heidelberg (2002)

    MATH  Google Scholar 

  16. van Oostrom, V.: Lambda Calculus with Patterns. Technical Report IR 228, Vrije Universiteit, Amsterdam (1990)

    Google Scholar 

  17. van Oostrom, V., van Raamsdonk, F.: Comparing combinatory reduction systems and higher-order rewrite systems. In: Heering, J., Meinke, K., Möller, B., Nipkow, T. (eds.) HOA 1993. LNCS, vol. 816, pp. 276–304. Springer, Heidelberg (1994)

    Google Scholar 

  18. Peyton Jones, S.L.: The Implementation of Functional Programming Languages. Prentice-Hall, Englewood Cliffs (1987)

    MATH  Google Scholar 

  19. Plasmeijer, R., van Eekelen, M.: Functional Programming and Parallel Graph Rewriting. International Computer Science Series. Addison-Wesley, Reading (1993)

    MATH  Google Scholar 

  20. van Raamsdonk, F.: Higher-order Rewriting. In: Terese (ed.) Term Rewriting Systems, ch. 11, pp. 588–667. Cambridge Univ. Press, Cambridge (2003)

    Google Scholar 

  21. Tullsen, M.: First Class Patterns. In: Pontelli, E., Santos Costa, V. (eds.) PADL 2000. LNCS, vol. 1753, pp. 1–15. Springer, Heidelberg (2000)

    Chapter  Google Scholar 

  22. Vestergaard, R., Brotherston, J.: A Formalised First-Order Confluence Proof for the λ-Calculus using One-Sorted Variable Names. In: Middeldorp, A. (ed.) RTA 2001. LNCS, vol. 2051, pp. 306–321. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  23. Wadler, P.: Views: A Way for Pattern Matching to Cohabit with Data Abstraction. In: Munchnik, S. (ed.) POPL 1987, pp. 307–313. ACM Press, New York (1987)

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2004 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Kahl, W. (2004). Basic Pattern Matching Calculi: a Fresh View on Matching Failure. In: Kameyama, Y., Stuckey, P.J. (eds) Functional and Logic Programming. FLOPS 2004. Lecture Notes in Computer Science, vol 2998. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-24754-8_20

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-24754-8_20

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-21402-1

  • Online ISBN: 978-3-540-24754-8

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics