Abstract
The pure pattern calculus generalises the pure lambda-calculus by basing computation on pattern-matching instead of beta-reduction. The simplicity and power of the calculus derive from allowing any term to be a pattern. As well as supporting a uniform approach to functions, it supports a uniform approach to data structures which underpins two new forms of polymorphism. Path polymorphism supports searches or queries along all paths through an arbitrary data structure. Pattern polymorphism supports the dynamic creation and evaluation of patterns, so that queries can be customised in reaction to new information about the structures to be encountered. In combination, these features provide a natural account of tasks such as programming with XML paths.
As the variables used in matching can now be eliminated by reduction it is necessary to separate them from the binding variables used to control scope. Then standard techniques suffice to ensure that reduction progresses and to establish confluence of reduction.
Chapter PDF
Similar content being viewed by others
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
References
Barendregt, H.: The Lambda Calculus: Its Syntax and Semantics. Studies in Logic and the Foundations of Mathematics, vol. 103. North-Holland, Amsterdam (1984) (Revised Edition)
Barthe, G., Cirstea, H., Kirchner, C., Liquori, L.: Pure Pattern Type Systems. In: Proceedings of the 30th Annual ACM Symposium on Principles of Programming Languages (POPL), pp. 250–261. ACM, New York (2003)
Bird, R., de Moor, O., Hoogendijk, P.: Generic functional programming with types and relations. Journal of Functional Programming 6(1), 1–28 (1996)
Burstall, R.M.: Proving properties of programs by structural induction. The Computer Journal (1969)
Cirstea, H., Kirchner, C.: ρ-calculus, the rewriting calculus. In: 5th International Workshop on Constraints in Computational Logics, CCL (1998)
Cerrito, S., Kesner, D.: Pattern matching as cut elimination. In: Longo, G. (ed.) 14th Annual IEEE Symposium on Logic in Computer Science (LICS), pp. 98–108. IEEE Computer Society Press, Los Alamitos (1999)
Forest, J., Kesner, D.: Expression reduction systems with patterns. In: Nieuwenhuis, R. (ed.) RTA 2003. LNCS, vol. 2706, pp. 107–122. Springer, Heidelberg (2003)
Forest, J.: A weak calculus with explicit operators for pattern matching and substitution. In: Tison, S. (ed.) RTA 2002. LNCS, vol. 2378, pp. 174–191. Springer, Heidelberg (2002)
Gibbons, J., Jeuring, J. (eds.): Generic Programming: IFIP TC2/WG2.1 Working Conference on Generic Programming, Dagstuhl, Germany, July 11-12, 2002. Kluwer Academic Publishers, Dordrecht (2003)
The Haskell language, http://www.haskell.org/
Huang, F.Y., Jay, C.B., Skillicorn, D.B.: Dealing with complex patterns in XML processing. Technical Report 2005-497, Queen’s University School of Computing (2005)
Huang, F.Y., Jay, C.B., Skillicorn, D.B.: Programming with heterogeneous structures: Manipulating XML data using bondi. Technical Report 2005-494, Queen’s University School of Computing (2005) (to appear in ACSW 2006)
Jansson, P.: Functional Polytypic Programming. PhD thesis, Computing Science, Chalmers University of Technology and Göteborg University, Sweden (May 2000)
Jay, C.B.: Higher-order patterns (2004), Available as www-staff.it.uts.edu.au/~cbj/Publications/higher_order_patterns.pdf
Jay, C.B.: Methods as pattern-matching functions. In: Drossopoulou, S. (ed.) Proc. of the 11th International Workshop on Foundations of Object-Oriented Languages (2004), available as http://www.doc.ic.ac.uk/~scd/FOO.pdf
Jay, C.B.: The pattern calculus. ACM Transactions on Programming Languages and Systems (TOPLAS) 26(6), 911–937 (2004)
Jay, C.B., Bell‘e, G., Moggi, E.: Functorial ML. Journal of Functional Programming 8(6), 573–619 (1998)
Kahl, W.: Basic pattern matching calculi: Syntax, reduction, confluence, and normalisation. Technical Report 16, Software Quality Research Laboratory, McMaster Univ. (2003)
Jay, C.B., Cockett, J.R.B.: Shapely types and shape polymorphism. In: Sannella, D. (ed.) ESOP 1994. LNCS, vol. 788, pp. 302–316. Springer, Heidelberg (1994)
Kesner, D.: Reasoning about redundant patterns. Journal of Functional and Logic Programming 1997(4) (June 1997)
Klop, J.-W.: Combinatory Reduction Systems. PhD thesis, Mathematical Centre Tracts 127, CWI, Amsterdam (1980)
Kesner, D., Puel, L., Tannen, V.: A Typed Pattern Calculus. Information and Computation 124(1), 32–61 (1996)
The Objective Caml language, http://caml.inria.fr/
StandardML of New Jersey, http://cm.bell-labs.com/cm/cs/what/smlnj/
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2006 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Jay, B., Kesner, D. (2006). Pure Pattern Calculus. In: Sestoft, P. (eds) Programming Languages and Systems. ESOP 2006. Lecture Notes in Computer Science, vol 3924. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11693024_8
Download citation
DOI: https://doi.org/10.1007/11693024_8
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-33095-0
Online ISBN: 978-3-540-33096-7
eBook Packages: Computer ScienceComputer Science (R0)