Abstract
The execution of a Prolog program can be viewed as a sequence of unifications and backtracks over unifications. We study the time requirement of executing a sequence of such operations (the unify-deunify problem). It is shown that the well-known set union problem is reducible to this problem. As the set union problem requires nonlinear time on large class of algorithms, the same holds for the unify-deunify problem. Thus the linearity of single unifications does not give a complete picture of the time complexity of Prolog primitives. We discuss the methods for executing sequences of unifications used in Prolog interpreters and show that many of them require even quadratic time in the worst case. We also outline some theoretically better methods.
Preview
Unable to display preview. Download preview PDF.
References
A.V. Aho, J.E. Hopcroft and J.D. Ullman: The Design and Analysis of Computer Algorithms. Addison-Wesley, 1974.
H.N. Gabow and R.E. Tarjan: A linear-time algorithm for a special case of disjoint set union. STOC '83, 246–251.
C.J. Hogger: Introduction to Logic Programming. Academic Press, 1984.
H. Mannila and E. Ukkonen: The set union problem with backtracking. Thirteenth International Colloquium on Automata, Languages, and Programming, Rennes, France, July 15–19, 1986 (ICALP 86), to appear.
M.S. Paterson and M.N. Wegman: Linear unification. Journal of Computer and System Sciences 16, 158–167.
R.E. Tarjan: Efficiency of a good but not linear disjoint set union algorithm. J. ACM 22, 2 (April 1975), 215–225.
R.E. Tarjan: A class of algorithms which require nonlinear time to maintain disjoint sets. J. Computer and System Sciences 18 (1979), 110–127.
R.E. Tarjan and J. van Leeuwen: Worst-case analysis of set union algorithms. J. ACM 31, 2 (April 1984), 245–281.
J. van Leeuwen and T. van der Weide: Alternative path compression techniques. Technical Report RUU-CS-77-3, Rijksuniversiteit Utrecht, Utrecht, The Netherlands.
J.S. Vitter and R.A. Simons: New classes for parallel complexity: a study of unification and other complete problems in P. Technical Report CS-84-06, Department of Computer Science, Brown University, 1984.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1986 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Mannila, H., Ukkonen, E. (1986). On the complexity of unification sequences. In: Shapiro, E. (eds) Third International Conference on Logic Programming. ICLP 1986. Lecture Notes in Computer Science, vol 225. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-16492-8_69
Download citation
DOI: https://doi.org/10.1007/3-540-16492-8_69
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-16492-0
Online ISBN: 978-3-540-39831-8
eBook Packages: Springer Book Archive