Journal of Automated Reasoning

, Volume 22, Issue 1, pp 45–63 | Cite as

An Algorithm for General Set Unification and Its Complexity

  • Frieder Stolzenburg


In this paper, an algorithm for set unification – which is a restricted case of the associative-commutative-idempotent (ACI) unification – is presented. The algorithm is able to unify finite sets containing arbitrary terms. It is nondeterministic and can easily be implemented in Prolog. Because of the simplicity of the algorithm, the computation of a single solution is quite fast, and the exact complexity of the algorithm and of the set unification problem itself can be analyzed easily. The algorithm is compared with some other set unification algorithms. All algorithms have single exponential complexity, because the set unification problem is NP-complete, but our exact complexity analysis provides more details. It is shown how the algorithm presented here can be used to solve a generalized set unification problem where sets with tails are admissible. The algorithm can be used in any logic programming language embedding (finite) sets, or in other contexts where set unification is needed, for example, in some unification-based grammar formalisms.

finite sets unification algorithms complexity analysis 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Arenas-Sánchez, P. and Dovier, A.: Minimal set unification, in M. Hermenegildo and S. D. Swierstra (eds.), Proceedings of the 7th International Symposium on Programming Language Implementation and Logic Programming, LNCS 982, Springer, Berlin, Heidelberg, New York, 1995, pp. 397–414.Google Scholar
  2. 2.
    Domenjoud, E.: A technical note on AC-unification: The number of minimal unifiers of the equation 1 - 1, J. Automated Reasoning 8 (1992), 39–44.Google Scholar
  3. 3.
    Dovier, A., Omodeo, E. G., Pontelli, E. and Rossi, G.: {log}: A language for programming in logic with finite sets, J. Logic Programming 28(1) (1996), 1–44.Google Scholar
  4. 4.
    ECRC GmbH, München: ECLiPSe 3.5: User Manual – Extensions User Manual, 1995. Two volumes.Google Scholar
  5. 5.
    Graham, R. L., Knuth, D. E. and Patashnik, O.: Concrete Mathematics, 2nd edition, Addison-Wesley, Reading, MA, 1994.Google Scholar
  6. 6.
    Jayaraman, B. and Plaisted, D. A.: Functional programming with sets, in G. Kahn (ed.), Proceedings of the 3rd International Conference on Functional Programming Languages and Computer Architecture, LNCS 274, Springer, Berlin, Heidelberg, New York, 1987, pp. 194–211.Google Scholar
  7. 7.
    Jayaraman, B. and Plaisted, D. A.: Programming with equations, subsets, and relations, in E. L. Lusk and R. A. Overbeek (eds.), Proceedings of the North American Conference on Logic Programming, Cleveland, OH, MIT Press, Cambridge, MA, London, 1989, pp. 1051–1068.Google Scholar
  8. 8.
    Jouannaud, J.-P. and Kirchner, C.: Solving equations in abstract algebras: A rule-based survey of unification, in J.-L. Lassez and G. Plotkin (eds.), Computational Logic: Essays in Honor of Alan Robinson, MIT Press, Cambridge, MA, London, 1991, pp. 257–321.Google Scholar
  9. 9.
    Kapur, D. and Narendran, P.: NP-completeness of the set unification and matching problems, in J. H. Siekmann (ed.), Proceedings of the 8th International Conference on Automated Deduction, Oxford, LNCS 230, Springer, Berlin, Heidelberg, 1986, pp. 489–495.Google Scholar
  10. 10.
    Kapur, D. and Narendran, P.: Double-exponential complexity of computing a complete set of AC-unifiers, in Proceedings of the 7th Annual Symposium on Logic in Computer Science, Santa Cruz, CA, 1992, pp. 11–21.Google Scholar
  11. 11.
    Kapur, D. and Narendran, P.: A unification algorithm for associative-commutative-idempotent theories, preliminary report, State University of New York at Albany Department of Computer Science Institute for Programming and Logics, Albany, NY, 1993.Google Scholar
  12. 12.
    Lincoln, P. and Christian, J.: Adventures in associative-commutative unification (a summary), in E. Lusk and R. Overbeek (eds.), Proceedings of the 9th International Conference on Automated Deduction, Argonne, IL, LNCS 310, Springer, Berlin, Heidelberg, New York, 1988, pp. 358–367.Google Scholar
  13. 13.
    Pollard, C. J. and Moshier, M. D.: Unifying partial description of sets, in P. Hanson (ed.), Information, Language, and Cognition, University of British Columbia Press, Vancouver, BC, 1990, pp. 285–322.Google Scholar
  14. 14.
    Pollard, C. J. and Sag, I. A.: Head-Driven Phrase Structure Grammar, University of Chicago Press, Chicago, London, 1994. CSLI publication.Google Scholar
  15. 15.
    Shmueli, O., Tsur, S. and Zaniolo, C.: Compilation of set terms in the logic data language (LDL), J. Logic Programming 12(1–2) (1992), 89–119.Google Scholar
  16. 16.
    Siekmann, J. H.: Unification theory, J. Symbolic Comput. 7(1) (1989), 207–274.Google Scholar
  17. 17.
    Stolzenburg, F.: An algorithm for general set unification and its complexity, in E. G. Omodeo and G. Rossi (eds.), Proceedings of the Workshop on Logic Programming with Sets in Conjunction with 10th International Conference on Logic Programming, Budapest, 1993, pp. 17–22.Google Scholar
  18. 18.
    Stolzenburg, F.: Membership-constraints and complexity in logic programming with sets, in F. Baader and K. U. Schulz (eds.), Frontiers in Combining Systems, Kluwer Academic Publ., Dordrecht, The Netherlands, 1996, pp. 285–302.Google Scholar
  19. 19.
    Vitter, J. S. and Flajolet, P.: Average-case analysis of algorithms and data structures, in J. van Leeuwen (ed.), Handbook of Theoretical Computer Science, Elsevier Science, Amsterdam, 1990, pp. 431–524.Google Scholar

Copyright information

© Kluwer Academic Publishers 1999

Authors and Affiliations

  • Frieder Stolzenburg
    • 1
  1. 1.Univ. Koblenz, Institut fKoblenzGermany

Personalised recommendations