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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Aczel, P.: A general Church-Rosser theorem. unpublished note, see [20] (1978)
Barthe, G., et al.: Pure Patterns Type Systems. In: POPL 2003, ACM, New York (2003)
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)
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)
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)
Erwig, M., Jones, S.P.: Pattern Guards and Transformational Patterns. In: Haskell Workshop 2000. ENTCS, vol. 41(1), pp. 12.1–12.27 (2001)
Faure, G., Kirchner, C.: Exceptions in the rewriting calculus. In: Tison, S. (ed.) RTA 2002. LNCS, vol. 2378, pp. 66–82. Springer, Heidelberg (2002)
Forest, J., Kesner, D.: Expression Reduction Systems with Patterns. In: Nieuwenhuis, R. (ed.) RTA 2003. LNCS, vol. 2706, pp. 107–122. Springer, Heidelberg (2003)
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)
Kahl, W.: Basic Pattern Matching Calculi: Syntax, Reduction, Confluence, and Normalisation. SQRL Rep. 16, Software Quality Res. Lab., McMaster Univ. (2003)
Klop, J.W.: Combinatory Reduction Systems. Mathematical Centre Tracts 127, Centre for Mathematics and Computer Science, Amsterdam, PhD thesis (1980)
Le Fessant, F., Maranget, L.: Optimizing Pattern Matching. In: Leroy, X. (ed.) ICFP 2001, pp. 26–37. ACM, New York (2001)
Maranget, L.: Two Techniques for Compiling Lazy Pattern Matching. Technical Report RR 2385, INRIA (1994)
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)
Nipkow, T., Paulson, L.C., Wenzel, M.: Isabelle/HOL. LNCS, vol. 2283. Springer, Heidelberg (2002)
van Oostrom, V.: Lambda Calculus with Patterns. Technical Report IR 228, Vrije Universiteit, Amsterdam (1990)
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)
Peyton Jones, S.L.: The Implementation of Functional Programming Languages. Prentice-Hall, Englewood Cliffs (1987)
Plasmeijer, R., van Eekelen, M.: Functional Programming and Parallel Graph Rewriting. International Computer Science Series. Addison-Wesley, Reading (1993)
van Raamsdonk, F.: Higher-order Rewriting. In: Terese (ed.) Term Rewriting Systems, ch. 11, pp. 588–667. Cambridge Univ. Press, Cambridge (2003)
Tullsen, M.: First Class Patterns. In: Pontelli, E., Santos Costa, V. (eds.) PADL 2000. LNCS, vol. 1753, pp. 1–15. Springer, Heidelberg (2000)
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)
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)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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