The complexity of counting problems in equational matching

  • Miki Hermann
  • Phokion G. Kolaitis
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 814)


We introduce a class of counting problems that arise naturally in equational matching and study their computational complexity. If E is an equational theory, then #E-Matching is the problem of counting the number of complete minimal E-matchers of two given terms. #E-Matching is a well-defined algorithmic problem for every finitary equational theory. Moreover, it captures more accurately the computational difficulties associated with finding complete sets of minimal E-matchers than the corresponding decision problem for E-matching does.

In 1979, L. Valiant developed a computational model for measuring the complexity of counting problems and demonstrated the existence of #P- complete problems, i.e., counting problems that are complete for counting non-deterministic Turing machines of polynomial-time complexity. Using the theory of #P-completeness, we analyze the computational complexity of #E-matching for several important equational theories E. We establish that if E is one of the equational theories A, C, AC, I, U, ACI, Set, ACU, or ACIU, then #E-Matching is a #P-complete problem. We also show that there are equational theories, such as the restriction of AC-matching to linear terms, for which the underlying decision matching problem is solvable in polynomial time, while the associated counting matching problem is #P-complete.


Polynomial Time Turing Machine Equational Theory Conjunctive Normal Form Truth Assignment 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. [BKN87]
    D. Benanav, D. Kapur, and P. Narendran. Complexity of matching problems. Journal of Symbolic Computation, 3:203–216, 1987.Google Scholar
  2. [BS86]
    R. Book and J. Siekmann. On unification: equational theories are not bounded. Journal of Symbolic Computation, 2:317–324, 1986.Google Scholar
  3. [CH93]
    N. Creignou and M. Hermann. On #P-completeness of some counting problems. Research report 93-R-188, Centre de Recherche en Informatique de Nancy, 1993.Google Scholar
  4. [Der87]
    N. Dershowitz. Termination of rewriting. Journal of Symbolic Computation, 3(1 & 2):69–116, 1987. Special issue on Rewriting Techniques and Applications.Google Scholar
  5. [Dom92]
    E. Domenjoud. Number of minimal unifiers of the equation αx1+⋯+αxb, =ac Βy1+⋯+Βyq. Journal of Automated Reasoning, 8:39–44, 1992.Google Scholar
  6. [FH86]
    F. Fages and G. Huet. Complete sets of unifiers and matchers in equational theories. Theoretical Computer Science, 43(1):189–200, 1986.Google Scholar
  7. [Joh90]
    D.S. Johnson. A catalog of complexity classes. In J. van Leeuwen, editor, Handbook of Theoretical Computer Science, Volume A: Algorithms and Complexity, chapter 2, pages 67–161. North-Holland, Amsterdam, 1990.Google Scholar
  8. [KN86]
    D. Kapur and P. Narendran. NP-completeness of the set unification and matching problems. In J.H. Siekmann, editor, Proceedings 8th International Conference on Automated Deduction, Oxford (England), volume 230 of Lecture Notes in Computer Science, pages 489–495. Springer-Verlag, July 1986.Google Scholar
  9. [KN92a]
    D. Kapur and P. Narendran. Complexity of unification problems with associative-commutative operators. Journal of Automated Reasoning, 9:261–288, 1992.Google Scholar
  10. [KN92b]
    D. Kapur and P. Narendran. Double-exponential complexity of computing a complete set of AC-unifiers. In Proceedings 7th IEEE Symposium on Logic in Computer Science, Santa Cruz (California, USA), pages 11–21, 1992.Google Scholar
  11. [Koz92]
    D.C. Kozen. The design and analysis of algorithms, chapter 26: Counting problems and #P, pages 138–143. Springer-Verlag, 1992.Google Scholar
  12. [MN89]
    U. Martin and T. Nipkow. Boolean unification — the story so far. Journal of Symbolic Computation, 7(3 & 4):275–294, 1989.Google Scholar
  13. [Plo72]
    G. Plotkin. Building-in equational theories. Machine Intelligence, 7:73–90, 1972.Google Scholar
  14. [Sny93]
    W. Snyder. On the complexity of recursive path orderings. Information Processing Letters, 46:257–262, 1993.Google Scholar
  15. [SS82]
    J. Siekmann and P. Szabó. Universal unification and classification of equational theories. In D.W. Loveland, editor, Proceedings 6th International Conference on Automated Deduction, New York (NY, USA), volume 138 of Lecture Notes in Computer Science, pages 369–389. Springer-Verlag, June 1982.Google Scholar
  16. [TA87]
    E. Tidén and S. Arnborg. Unification problems with one-sided distributivity. Journal of Symbolic Computation, 3(1 & 2):183–202, 1987.Google Scholar
  17. [Val79a]
    L.G. Valiant. The complexity of computing the permanent. Theoretical Computer Science, 8:189–201, 1979.Google Scholar
  18. [Val79b]
    L.G. Valiant. The complexity of enumeration and reliability problems. SIAM Journal on Computing, 8(3):410–421, 1979.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1994

Authors and Affiliations

  • Miki Hermann
    • 1
  • Phokion G. Kolaitis
    • 2
  1. 1.CRIN (CNRS) and INRIA-LorraineVandceuvre-lès-NancyFrance
  2. 2.Computer and Information SciencesUniversity of CaliforniaSanta CruzUSA

Personalised recommendations