Skip to main content

First-class patterns

  • BARRY JAY (a1) and DELIA KESNER (a2)

Pure pattern calculus supports pattern-matching functions in which patterns are first-class citizens that can be passed as parameters, evaluated and returned as results. This new expressive power supports two new forms of polymorphism. Path polymorphism allows recursive functions to traverse arbitrary data structures. Pattern polymorphism allows patterns to be treated as parameters which may be collected from various sources or generated from training data. A general framework for pattern calculi is developed. It supports a proof of confluence that is parameterised by the nature of the matching algorithm, suitable for the pure pattern calculus and all other known pattern calculi.

Hide All
Baader F. & Nipkow T. (1998) Term Rewriting and All That. Cambridge: Cambridge University Press.
Barendregt H. (1984) The Lambda Calculus: Its Syntax and Semantics, vol. 103, Studies in Logic and the Foundations of Mathematics. Amsterdam: North-Holland.
Barthe G., Cirstea H., Kirchner C. & Liquori L. (2003) Pure pattern type systems. In Proceedings of the 30th Annual ACM Symposium on Principles of Programming Languages (POPL). Morrisett Greg (ed), New Orleans, USA, New York: ACM Press, pp. 250261.
Bezem M., Klop J. W. & De Vrijer R. (eds) (2003) Term Rewriting Systems – Terese, vol. 55, Cambridge Tracts in Theoretical Computer Science. Cambridge: Cambridge University Press.
Böhm C., Piperno A. & Guerrini S. (1994) Lambda-definition of function(al)s by normal forms. In Proceedings of the 5th European Symposium on Programming (ESOP). Sannella Donald (ed), Edinburgh, vol. 788, Lecture Notes in Computer Science, Berlin: Springer, pp. 135149.
Cirstea H. & Faure G. (2007) Confluence of pattern-based lambda-calculi. In Proceedings of the 18th International Conference on Rewriting Techniques and Applications (RTA). Baader Franz (ed), Paris, vol. 4533, Lecture Notes in Computer Science, Berlin: Springer, pp. 7892.
Cirstea H. & Kirchner C. (2001) The rewriting calculus – Part I and II, Logic Journal of the IGPL, 9 (3), 427498.
De Nicola R., Ferrari G. L. & Pugliese R. (1998) KLAIM: A kernel language for agents interaction and mobility. IEEE Trans. Software Engng 24 (5), 315330.
Forest J. & Kesner D. (2003) Expression reduction systems with patterns. In Proceedings of the 14th International Conference on Rewriting Techniques and Applications (RTA). Nieuwenhuis Robert (ed), Valencia, Spain, vol. 2706, Lecture Notes in Computer Science, Berlin: Springer, pp. 107122.
Gelernter D. (1985) Generative communication in Linda. 7(1), 80–112.
Gorla D. & Pugliese R. (2003) Resource access and mobility control with dynamic privileges acquisition. In Proceedings of the 30th International Colloquium on Automata, Languages and Programming (ICALP). Baeten Jos C. M., Lenstra Jan Karel, Parrow Joachim & Woeginger Gerhard J. (eds), Eindhoven, The Netherlands, vol. 2719, Lecture Notes in Computer Science, Berlin: Springer, pp. 119132.
Huang F. Y., Jay C. B. & Skillicorn D. B. (2006a) Adaptiveness in well-typed java bytecode verification. In Proceedings of the 2006 conference of the Center for Advanced Studies on Collaborative research (CASCON). Lyons Kelly & Couturier Christian (eds), Toronto, Canada, New York: ACM Press, pp. 248262.
Huang F. Y., Jay C. B. & Skillicorn D. B. (2006b) Programming with heterogeneous structures: Manipulating XML data using bondi. 29th Australasian Computer Science Conference (ACSC'06). Dobbie Gill & Estivill-Castro Vladimir (eds). ACM, pp. 287296.
Jay B. (2009) Pattern Calculus: Computing with Functions and Structures. Berlin: Springer.
Jay B & Kesner D. (2006) Pure pattern calculus. In Proceedings of the 15th European Symposium on Programming (ESOP). Sestoft Peter (ed), Vienna, Austria, vol. 3924, Lecture Notes in Computer Science, Berlin: Springer, pp. 100114.
Jay C. B. (2004) The pattern calculus. ACM Trans. Prog. Lang. Sys. 26 (6), 911937.
Jay C. B. & Kesner D. (2006) Patterns as first-class citizens. Available at http://kern-1pt/
Kahl W. (2004) Basic pattern matching calculi: A fresh view on matching failure. In Proceedings of the 7th International Symposium on Functional and Logic Programming (FLOPS). Kameyama Yukiyoshi, Stuckey Peter J. (eds), Nara, Japan, vol. 2998, Lecture Notes in Computer Science, Berlin: Springer, pp. 276290.
Klop J.-W. (1980) Combinatory Reduction Systems. Amsterdam: Mathematical Centre Tracts, CWI.
Klop J.-W., van Oostrom V. & de Vrijer R. (2008) Lambda calculus with patterns. Theoret. Comp. Sci. 398 (1–3), 1631.
Lämmel R. & Peyton-Jones S. (2003) Scrap your boilerplate: A practical design pattern for generic programming. In Proceedings of the ACM SIGPLAN Workshop on Types in Language Design and Implementation (TLDI). Lee Peter (ed), New Orleans, USA, vol. 38, no. 3, SIGPLAN Notices, pp. 26–37.
Paulson L. C. (1994) Isabelle: A Generic Theorem-Prover, vol. 828, Lecture Notes in Computer Science. Springer.
Peyton Jones S. (1987) The Implementation of Functional Programming Languages. Prentice Hall.
Pfenning F. & Paulin-Mohring C. (1989) Inductively defined types in the calculus of constructions. In Proceedings of the 5th international conference on Mathematical Foundations of Programming Semantics (MFPS). Main Michael G., Melton Austin, Mislove Michael W. & Schmidt David A. (eds), New Orleans, USA, vol. 442, Lecture Notes in Computer Science, Berlin: Springer, pp. 209228.
Van Oostrom V. (1990) Lambda Calculus with Patterns. Amsterdam: Vrije Universiteit.
Visser E. (2004) Program transformation with Stratego/XT: Rules, strategies, tools, and systems in StrategoXT-0.9. In Domain-Specific Program Generation: Revised Papers, vol. 3016, Lecture Notes in Computer Science, Berlin: Springer pp. 216238.
Recommend this journal

Email your librarian or administrator to recommend adding this journal to your organisation's collection.

Journal of Functional Programming
  • ISSN: 0956-7968
  • EISSN: 1469-7653
  • URL: /core/journals/journal-of-functional-programming
Please enter your name
Please enter a valid email address
Who would you like to send this to? *


Full text views

Total number of HTML views: 0
Total number of PDF views: 7 *
Loading metrics...

Abstract views

Total abstract views: 64 *
Loading metrics...

* Views captured on Cambridge Core between September 2016 - 18th November 2017. This data will be updated every 24 hours.