A ρ-calculus of explicit constraint application



Theoretical presentations of the rewriting or ρ-calculus often treat the matching constraint computations as an atomic operation although matching constraints are explicitly expressed. Actual implementations have to take a more realistic view: computations needed in order to find the solutions of a matching equation can have an important impact on the (efficiency of the) calculus for some matching theories and the substitution application usually involves a term traversal.

Following the works on explicit substitutions in the λ-calculus, we present two versions of the ρ-calculus, one with explicit matching and one with explicit substitutions, together with a version that combines the two and considers efficiency issues and more precisely the composition of substitutions. The approach is general, allowing for potential extensions to various matching theories. We establish the confluence of the calculus and the termination of the explicit constraint handling and application sub-calculus.


Rewriting calculus Explicit substitution Explicit matching Pattern matching 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Abadi, M., Cardelli, L., Curien, P.-L., Lévy, J.-J.: Explicit substitutions. J. Func. Progr. 1(4), 375–416 (1991)MATHCrossRefGoogle Scholar
  2. 2.
    Barendregt, H.: The Lambda-Calculus, its syntax and semantics. Studies in Logic and the Foundation of Mathematics. 2nd edn. Elsevier Science Publishers B.V. (North-Holland), Amsterdam (1984)Google Scholar
  3. 3.
    Barthe, G., Cirstea, H., Kirchner, C., Liquori, L.: Pure patterns type systems. In: Principles of Programming Languages—POPL2003, New Orleans, USA. ACM (2003)Google Scholar
  4. 4.
    Berkling, K., Fehr, E.: A consistent extension of the lambda-calculus as a base for functional programming languages. Inform. Contr. 55(1–3), 89–101 (1982)MATHCrossRefMathSciNetGoogle Scholar
  5. 5.
    Bloo, R., Rose, K.H.: Combinatory reduction systems with explicit substitution that preserve strong nomalisation. In: Proceedings of the Fifth International Conference on Rewriting Techniques and Application (RTA ’96), pp. 169–183 (1996)Google Scholar
  6. 6.
    Borovanský, P.: Controlling rewriting: study and implementation of a strategy formalism. Elect. Notes Theor. Comp. Sci. 15 (1998)Google Scholar
  7. 7.
    Borovanský, P., Kirchner, C., Kirchner, H.: A functional view of rewriting and strategies for a semantics of ELAN. In: Sato, M., Toyama, Y. (eds.) The Third Fuji International Symposium on Functional and Logic Programming, pp. 143–167. Kyoto (1998). World Scientific. Also report LORIA 98-R-165Google Scholar
  8. 8.
    Borovanský, P., Kirchner, C., Kirchner H., Moreau, P.-E., Ringeissen, C.: An overview of ELAN. In: Proceedings of Workshop on Rewriting Techniques and Application—WRLA’1998, vol. 15. Electronic Notes in Theoretical Computer Science (1998) Report LORIA 98-R-316Google Scholar
  9. 9.
    van den Brand, M., de Jong, H., Klint, P., Olivier, P.: Efficient annotated terms. Softw. Prac. Exp. 30, 259–291 (2000)CrossRefGoogle Scholar
  10. 10.
    Chailloux, E., Manoury. P., Pagano, B.: Développement d’applications avec Objective CAML. O’REILLY (2000)Google Scholar
  11. 11.
    Cirstea, H.: Calcul de réécriture: fondements et applications. PhD thesis, Université Henri Poincaré—Nancy I (2000)Google Scholar
  12. 12.
    Cirstea, H., Faure, G., Kirchner, C.: A rho-calculus of explicit constraint application. In: Workshop on Rewriting Logic and Applications, Barcelona (Spain) (2004). Electronic Notes in Theoretical Computer ScienceGoogle Scholar
  13. 13.
    Cirstea, H., Kirchner, C.: The rewriting calculus—Part I and II. Logic J. Interest Group in Pure and Appl. Logics 9(3), 427–498 (2001)MathSciNetGoogle Scholar
  14. 14.
    Cirstea, H., Kirchner, C., Liquori, L.: Matching Power. In: Proceedings of Rewriting Techniques and Applications RTA’2001, http://www.springer.de/comp/lncs/index.htmlLecture Notes in Computer Science, Utrecht (The Netherlands). Springer-Verlag (2001)
  15. 15.
    Cirstea, H., Kirchner, C., Liquori, L.: Rewriting calculus with(out) types. In: Fabio Gadducci, Ugo Montanari (eds.) Proceedings of the Fourth Workshop on Rewriting Logic and Applications, Pisa (Italy) (2002). Electronic Notes in Theoretical Computer ScienceGoogle Scholar
  16. 16.
    Cirstea, H., Kirchner, C., Liquori, L., Wack, B.: Rewrite strategies in the rewriting calculus. In: Proceedings of the Third International Workshop on Reduction Strategies in Rewriting and Programming, Valencia, Spain (2003). Electronic Notes in Theoretical Computer ScienceGoogle Scholar
  17. 17.
    Clavel, M., Eker, S., Lincoln, P., Meseguer, J.: Principles of Maude. In: José Meseguer (ed.) Proceedings of the First International Workshop on Rewriting Logic, vol. 4. Asilomar (California) (1996). Electronic Notes in Theoretical Computer ScienceGoogle Scholar
  18. 18.
    Curien, P.-L., Hardin, T., Lévy, J.-J.: Confluence properties of weak and strong calculi of explicit substitutions. J. ACM (JACM) 43(2), 362–397 (1996)MATHCrossRefGoogle Scholar
  19. 19.
    David, R., Guillaume, B.: A λ-calculus with explicit weakening and explicit substitution. Math. Struct. Comp. Sci. 11, 169–206 (2001)MATHCrossRefMathSciNetGoogle Scholar
  20. 20.
    de Bruijn, N.: Lambda calculus with namefree formulas involving symbols that represent reference transforming mappings. Indagationes Mathematicae 40, 348–356 (1978)MathSciNetGoogle Scholar
  21. 21.
    de Bruijn, N.G.: A lambda calculus notation with nameless dummies, a tool for automatic formula manipulation, with application to the church-rosser theorem. Indagationes Mathematicae 34, 381–392 (1972)MathSciNetGoogle Scholar
  22. 22.
    Dowek, G., Hardin, T., Kirchner, C.: Higher order unification via explicit substitutions. Inform. Comp. 157(1/2), 183–235 (2000)MATHCrossRefMathSciNetGoogle Scholar
  23. 23.
    Eker, S.: Associative-commutative matching via bipartite graph matching. Comp. J. 38(5), 381–399 (1995)CrossRefGoogle Scholar
  24. 24.
    Faure, G., Kirchner, C.: Exceptions in the rewriting calculus. In: Proceedings of Rewriting Techniques and Applications—RTA’2002, vol. 2378 of LNCS, pp. 66–82, Copenhagen, Springer-Verlag (2002)Google Scholar
  25. 25.
    Gordon, M.J., Milner, R., Wadsworth, C.P.: Edinburgh LCF: A Mechanized Logic of Computation, vol. 78 of Lecture Notes in Computer Science. Springer-Verlag, New York (NY, USA) (1979)Google Scholar
  26. 26.
    Hendriks, D., van Oostrom, V.: The λ calculus. In: Proceedings of Conference on Automated Deduction—CADE’2003, vol. 2741 of Lecture Notes in Artificial Intelligence, pp. 136–150 (2003)Google Scholar
  27. 27.
    Hudak, P., Fasel, J.H.: A gentle introduction to Haskell. ACM SIGPLAN Notices 27(5), T-1–T-53 (1992)Google Scholar
  28. 28.
    Huet, G.: Resolution d’Equations dans les Languages d’Ordre 1,2,...,ω. These de Doctorat D’Etat, Universite Paris VII (1976)Google Scholar
  29. 29.
    Huet, G.: Confluent reductions: Abstract properties and applications to term rewriting systems. J. ACM 27(4), 797–821 (1980)MATHCrossRefMathSciNetGoogle Scholar
  30. 30.
    Jouannaud, J.-P., Kirchner, H.: Completion of a set of rules modulo a set of equations. SIAM J. Comp. 15(4), 1155–1194 (1986)MATHCrossRefMathSciNetGoogle Scholar
  31. 31.
    Kesner, D., Lengrand, S.: Extending the explicit substitution paradigm. In: Proceedings of the 6th International Conference on Rewriting Techniques and Applications (RTA ’05), LNCS 256 (2005)Google Scholar
  32. 32.
    Kirchner, C., Kirchner, H.: Rewriting, solving, proving. A preliminary version of a book available at |www.loria.fr/~ckirchne/rsp.ps.gz| (1999)
  33. 33.
    Kirchner, C., Kirchner, H.: Rule-based programming and proving : the ELAN experience outcomes. In: Ninth Asian Computing Science Conference—ASIAN’04, Chiang Mai, Thailand (2004)Google Scholar
  34. 34.
    Kirchner, C., Moreau, P.-E., Reilles, A.: Formal validation of pattern matching code. In: PPDP ’05: Proceedings of the 7th ACM SIGPLAN International Conference on Principles and Practice of Declarative Programming, pp. 187–197, ACM Press, New York, NY, USA (2005)Google Scholar
  35. 35.
    Klop, J.W.: Combinatory Reduction Systems. Ph.D. thesis, Mathematisch Centrum, Amsterdam (1980)Google Scholar
  36. 36.
    Leroy, X.: Compiling functional languages. Summer school on Semantics of programming languages (2002)Google Scholar
  37. 37.
    Lescanne, P.: From λσ to λv a journey through calculi of explicit substitutions. In: Conference Record of POPL ’94, pp. 60–69. ACM (1994)Google Scholar
  38. 38.
    Liang, C., Nadathur, G.: Choices in representation and reduction strategies for lambda terms in intensional contexts. J. Auto. Reasoning 33(2), 89–132 (2004)MATHCrossRefMathSciNetGoogle Scholar
  39. 39.
    Liquori, L., Serpette, B.: irho: an imperative rewriting calculus. In: Proceedings of te International Conference on Principles and Practice of Declarative Programming (PPDP’04), pp. 167–178 (2004)Google Scholar
  40. 40.
    Moreau, P.-E., Ringeissen, C., Vittek, M.: A Pattern Matching Compiler for Multiple Target Languages. In: Hedin G. (ed.) 12th Conference on Compiler Construction, Warsaw (Poland), vol. 2622 of LNCS, pp. 61–76. Springer-Verlag (2003)Google Scholar
  41. 41.
    Muñoz, C.: Un calcul de substitutions pour la représentation de preuves partielles en théorie de types. Thése de doctorat, Université Paris 7 (1997). English version available as INRIA research report RR-3309Google Scholar
  42. 42.
    Nadathur, G.: The suspension notation for lambda terms and its use in metalanguage implementations. In: Ninth Workshop on Logic, Language, Information and Computation (WoLLIC’02) Electronic Notes in Theoretical Computer Science, vol. 67 (2002)Google Scholar
  43. 43.
    Nguyen, Q.-H., Kirchner, C., Kirchner, H.: External rewriting for skeptical proof assistants. J. Auto. Reasoning 29(3–4), 309–336 (2002)MATHCrossRefMathSciNetGoogle Scholar
  44. 44.
    Ohlebusch, E.: Church-rosser theorems for abstract reduction modulo an equivalence relation. In: Proceedings of Rewriting Techniques and Applications (RTA-98), vol. 1379 of LNCS, pp. 17–31. Springer (1998)Google Scholar
  45. 45.
    Pagano, B.: X.R.S: Explicit reduction systems—A first-order calculus for higher-order calculi. In: Proceedings of the International Conference on Automated Deduction (CADE ’98), pp. 72–87 (1998)Google Scholar
  46. 46.
    Rose, K.H.: Operational Reduction Models for Functional Programming Languages. Ph.D. Thesis, DIKU, University of Copenhagen, Denmark (1996)Google Scholar
  47. 47.
    Sinot, F.-R.: Director strings revisited: A generic approach to the efficient representation of free variables in higher-order rewriting. J. Log. Comput. 15(2), 201–218 (2005)MATHCrossRefMathSciNetGoogle Scholar
  48. 48.
    Stehr, M.-O.: CINNI—A generic calculus of explicit substitutions and its application to lambda-, varsigma- and pi-calculi. Elect. Notes Theor. Comp. Sci. 36 (2000)Google Scholar
  49. 49.
    Stump, A., Deivanayagam, A., Kathol, S., Lingelbach, D., Schobel, D.: Rogue decision procedures. In: 1st International Workshop on Pragmatics of Decision Procedures in Automated Reasoning—PDPAR (2003)Google Scholar
  50. 50.
    Wack, B.: Aspects logique du calcul de réécriture. Ph.D. Thesis, Université Henri Poincaré—Nancy I (2005)Google Scholar
  51. 51.
    Yokouchi, H., Hikita, T.: A rewriting system for categorical combinators with multiple arguments. SIAM J. Comput. 19(1), 78–97 (1990)MATHCrossRefMathSciNetGoogle Scholar

Copyright information

© Springer Science+Business Media, LLC 2007

Authors and Affiliations

  • Horatiu Cirstea
    • 1
  • Germain Faure
    • 2
  • Claude Kirchner
    • 3
  1. 1.Université Nancy 2 & LORIAVandoeuvre-lès-Nancy CedexFrance
  2. 2.Université Henri Poincaré & LORIAVandoeuvre-lès-Nancy CedexFrance
  3. 3.INRIA & LORIAVandoeuvre-lès-Nancy CedexFrance

Personalised recommendations