Parallel algorithms for term matching

  • Cynthia Dwork
  • Paris Kanellakis
  • Larry Stockmeyer
Unification Theory
Part of the Lecture Notes in Computer Science book series (LNCS, volume 230)


We present a new randomized parallel algorithm for term matching. Let n be the number of nodes of the directed acyclic graphs (dags) representing the terms to be matched, then our algorithm uses O(log2n) parallel time and M(n) processors, where M(n) is the complexity of n by n matrix multiplication. The number of processors is a significant improvement over previously known bounds. Under various syntactic restrictions on the form of the input dags only O(n2) processors are required in order to achieve deterministic O(log2n) parallel time. Furthermore, we reduce directed graph reachability to term matching using constant parallel time and O(n2) processors. This is strong evidence that in practice, taking M(n) to be n3, no deterministic algorithm can beat the processor bound of our randomized algorithm. We also improve the lower bound of [DKM] on the unification problem. We show that unification is logspace-complete in PTIME even if both input terms are linear, i.e., no variable appears more than once in each term.


Span Tree Matrix Multiplication Parallel Algorithm Function Symbol Parallel Time 
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.

5. References

  1. [A]
    Aggarwal, A., Chazelle, B., Guibas, L., O'Dunlaing, C., and Yap, C., "Parallel computational geometry", Proc. 26th IEEE FOCS, 1985, pp. 468–478.Google Scholar
  2. [CM]
    Clocksin, W.F., Mellish, C.S., Programming in Prolog, Springer-Verlag, 1981.Google Scholar
  3. [CW]
    Coppersmith, D., and Winograd, S., "On the asymptotic complexity of matrix multiplication", SIAM J. Comput. 11 (1982), pp. 472–492.CrossRefGoogle Scholar
  4. [DKM]
    Dwork, C., Kanellakis, P., Mitchell, J., "On the Sequential Nature of Unification", J. of Logic Programming 1(1), pp.35–50.Google Scholar
  5. [FW]
    Fortune, S., Wyllie, J., "Parallelism in Random Access Machines", Proc. 10th ACM STOC, 1978, pp. 114–118.Google Scholar
  6. [Ga]
    Galil, Z., "Optimal parallel algorithms for string matching", Proc. 16th ACM STOC, 1984, pp. 240–248.Google Scholar
  7. [GP]
    Galil, Z., and Pan., V., "Improved processor bounds for algebraic and combinatorial problems in RNC", Proc. 26th IEEE FOCS, 1985, pp. 490–496.Google Scholar
  8. [Go]
    Goldschlager, L.M., "The Monotone and Planar Circuit Value Problems are Log Space Complete for P", SIGACT News 9(2), 1977, pp. 25–29.CrossRefGoogle Scholar
  9. [HO]
    G. Huet, D. Oppen, "Equations and Rewrite Rules: A Survey", in: Formal Language Theory: Perspectives and Open Problems, R.V. Book (ed), Academic Press, 1980.Google Scholar
  10. [KUW]
    Karp, R. M., Upfal, E., and Wigderson, A., "Constructing a perfect matching is in random NC", Proc. 17th ACM STOC, 1985, pp. 22–32.Google Scholar
  11. [Ko]
    Kowalski, R., "Predicate Logic as a Programming Language". Proceedings IFIP 74, 1974, pp. 569–574.Google Scholar
  12. [MK]
    Maluszynski J., Komorowski H.J., "Unification-free Execution of Horn-clause Programs", Proc. 2nd Logic Programming Symposium, IEEE, July 1985.Google Scholar
  13. [M]
    Milner, R., "A Theory of Type Polymorphism in Programming", JCSS 17, 1978, pp. 348–375.Google Scholar
  14. [PR]
    Pan, V., and Reif, J., "Efficient parallel solution of linear systems", Proc. 17th ACM STOC, 1985, pp. 143–152.Google Scholar
  15. [PW]
    Paterson, M.S., Wegman, M.N., "Linear Unification", JCSS 16, 1978, pp.158–167.Google Scholar
  16. [Ra]
    Rabin, M.O., "Probabilistic algorithm for testing primality", J. Number Theory 12 (1980), pp. 128–138.CrossRefGoogle Scholar
  17. [Re]
    Reif, J., "Optimal parallel algorithms for integer sorting and graph connectivity", Proc. 26th IEEE FOCS, 1985, pp.496–505.Google Scholar
  18. [R]
    Robinson, J.A., "A Machine Oriented Logic Based on the Resolution Principle", JACM 12(1), 1965, pp. 23–41.CrossRefGoogle Scholar
  19. [S]
    Schwartz, J.T., "Fast Probabilistic Algorithms for Verification of Polynomial Identities", JACM 27(4), 1980, pp. 701–717.CrossRefGoogle Scholar
  20. [St]
    Strassen, V., "Gaussian elimination is not optimal", Numerische Mathematik 13 (1969), pp. 354–356.Google Scholar
  21. [TV]
    Tarjan, R.E., and Vishkin, U., "Finding biconnected components and computing tree functions in logarithmic parallel time", Proc. 25th IEEE FOCS, 1984, pp. 12–20.Google Scholar
  22. [Vi]
    Vishkin, U., "Randomized speed-ups in parallel computation", Proc. 16th ACM STOC, 1984, pp. 230–239.Google Scholar
  23. [VS]
    Vitter, J.S., and Simons, R., "New classes for parallel complexity: a study of unification and other complete problems for P", IEEE Trans. on Computers, to appear.Google Scholar
  24. [Ya]
    Yasuura, H., "On the Parallel Computational Complexity of Unification", Yajima Lab., Research Report, ER 83-01, Oct. 1983.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1986

Authors and Affiliations

  • Cynthia Dwork
    • 1
  • Paris Kanellakis
    • 2
  • Larry Stockmeyer
    • 3
  1. 1.IBM Research LabSan Jose and MIT Lab for Computer ScienceUSA
  2. 2.Brown University and MIT Lab for Computer ScienceUSA
  3. 3.IBM Research LabSan Jose

Personalised recommendations