Associative-Commutative Rewriting on Large Terms

  • Steven Eker
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 2706)


We introduce a novel representation for associative-commutative (AC) terms which, for certain important classes of rewrite rules, allows both the AC matching and the AC renormalization steps to be accomplished using time and space that is logarithmic in the size of the flattened AC argument lists involved. This novel representation can be cumbersome for other, more general algorithms and manipulations. Hence, we describe machine efficient techniques for converting to and from a more conventional representation together with a heuristic for deciding at runtime when to convert a term to the new representation. We sketch how our approach can be generalized to order-sorted AC rewriting and to other equational theories. We also present some experimental results using the Maude 2 interpreter.


Function Symbol Equational Theory Ground Term Large Term Maximum Multiplicity 
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.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    G. M. Adel’son-Vel’skii and E. M. Landis. An algorithm for the organization of information. Soviet Mathematics Doklady, 3:1259–1263, 1962.Google Scholar
  2. 2.
    R. Bayer. Symmetric binary B-trees: Data structure and maintenance algorithms. Acta Informatica, 1:290–306, 1972.zbMATHCrossRefMathSciNetGoogle Scholar
  3. 3.
    Dan Benanav, Deepak Kapur, and Paliath Narendran. Complexity of matching problems. Journal of Symbolic Computation, 3(1–2):203–216, February 1987.zbMATHMathSciNetCrossRefGoogle Scholar
  4. 4.
    Peter Borovanský, Claude Kirchner, Helèné Kirchner, and Pierre-Etienne Moreau. ELAN from a rewriting logic point of view. Journal of Theoretical Computer Science, 285(2):155–185, August 2002.zbMATHCrossRefGoogle Scholar
  5. 5.
    M. Clavel, F. Durán, S. Eker, P. Lincoln, N. Martí-Oliet, J. Meseguer, and J.F. Quesada. Maude: specification and programming in rewriting logic. Journal of Theoretical Computer Science, 285(2):187–243, August 2002.zbMATHCrossRefGoogle Scholar
  6. 6.
    M. Clavel, F. Durán, S. Eker, P. Lincoln, N. Martí-Oliet, J. Meseguer, and C. Talcott. The Maude 2.0 system. This volume.Google Scholar
  7. 7.
    Thomas H. Cormen, Charles E. Leierson, and Ronald L. Rivest. Introduction to Algorithms. MIT Press and McGra w-Hill, 1990.Google Scholar
  8. 8.
    Răzvan Diaconescu and Kokichi Futatsugi. Logical foundations of CafeOBJ. Journal of Theoretical Computer Science, 285(2):289–318, August 2002.zbMATHCrossRefMathSciNetGoogle Scholar
  9. 9.
    S. M. Eker. Associative-commutative matching via bipartite graph matching. Computer Journal, 38(5):381–399, 1995.CrossRefGoogle Scholar
  10. 10.
    Steven Eker. Fast matching in combinations of regular equational theories. In J. Meseguer, editor, Proceedings of the First International Workshop on Rewriting Logic and its Applications, volume 4 of Electronic Notes in Theoretical Computer Science. Elsevier, 1996.Google Scholar
  11. 11.
    Steven Eker. Single elementary associative-commutative matching. Journal of Automated Reasoning, 28(1):35–51, January 2002.zbMATHCrossRefMathSciNetGoogle Scholar
  12. 12.
    S. J. Garland and J. V. Guttag. An overview of LP, the Larch Prover. In N. Dershowitz, editor, Proceedings of 3rd International Conference on Rewriting Techniques and Applications (RTA’ 89), number 355 in Lecture Notes in Computer Science, pages 137–151. Springer-Verlag, April 1989.Google Scholar
  13. 13.
    J. Goguen and J. Meseguer. Order sorted algebra I: equational deduction for multiple inheritance, overloading, exceptions and partial operations. Theoretical Computer Science, 105(2):217–273, November 1992.zbMATHCrossRefMathSciNetGoogle Scholar
  14. 14.
    J. A. Goguen, T. Winkler, J. Meseguer, K. Futatsugi, and J.-P. Jouannaud. Introducing OBJ3. Technical Report SRI-CSL-92-03, Computer Science Laboratory, SRI International, March 1992.Google Scholar
  15. 15.
    Bernhard Gramlich and Jörg Denzinger. Efficient AC-matching using constraint propagation. Technical report, FB Informatik, Universität Kaiserslautern, Pf. 3049, D-6750, Kaiserslautern, Germany, 1988.Google Scholar
  16. 16.
    Ralf Hinze. Constructing red-black trees. In Chris Okasaki, editor, Proceedings of the Workshop on Algorithmic Aspects of Advanced Programming Languages (WAAAPL’ 99), volume CUCS-023-99 of Computer Science Technical Reports, pages 89–99. Columbia University, September 1999.Google Scholar
  17. 17.
    M. Ishisone and T. Sawada. Brute: brute force rewriting engine. In Proceedings of the CafeOBJ Symposium’ 98, Numazu, Japan. CafeOBJ Project, April 1998.Google Scholar
  18. 18.
    Haim Kaplan, Chris Okasaki, and Robert E. Tarjan. Simple confluently persistent catenable lists. SIAM Journal on Computing, 30(3):965–977, 2000.zbMATHCrossRefMathSciNetGoogle Scholar
  19. 19.
    Haim Kaplan and Robert E. Tarjan. Persistent lists with catenation via recursive slowdown. In Proceedings of the 27th Annual ACM Symposium on the Theory of Computing (STOC’ 95), pages 93–102. ACM Press, May 1995.Google Scholar
  20. 20.
    Helèné Kirchner and Pierre-Etienne Moreau. Promoting rewriting to a programming language: A compiler for non-deterministic rewrite programs in associative-commutative theories. Journal of Functional Programming, 11(2):207–251, March 2001.zbMATHMathSciNetGoogle Scholar
  21. 21.
    William McCune. Solution of the Robbins problem. Journal of Automated Reasoning, 19(3):263–276, December 1997.zbMATHCrossRefMathSciNetGoogle Scholar
  22. 22.
    Pierre-Etienne Moreau and Helèné Kirchner. A compiler for rewrite programs in associative-commutative theories. In C. Palamidessi, H. Glaser, and K. Meinke, editors, Principles of Declarative Programming (PLILP/ALP’ 98), number 1490 in Lecture Notes in Computer Science, pages 230–249. Springer-Verlag, September 1998.CrossRefGoogle Scholar
  23. 23.
    Chris Okasaki. Functional pearl: Red-black trees in a functional setting. Journal of Functional Programming, 9(4):471–477, July 1999.zbMATHCrossRefGoogle Scholar
  24. 24.
    Salvador Roura. A new method for balancing binary search trees. In Fernando Orejas, Paul G. Spirakis, and Jan van Leeuwen, editors, Proceedings of the 28th International Colloquium on Automata, Languages and Programming (ICALP 2001), number 2076 in Lecture Notes in Computer Science, pages 469–480. Springer-Verlag, July 2001.CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2003

Authors and Affiliations

  • Steven Eker
    • 1
  1. 1.Computer Science LaboratorySRI InternationalMenlo ParkUSA

Personalised recommendations