Abstract
Unification in first-order languages is a central operation in symbolic computation and logic programming. Many unification algorithms have been proposed in the past, however there is no consensus on which algorithm is the best to use in practice. While Paterson and Wegman's linear unification algorithm has the lowest time complexity in the worst case, it requires an important overhead to be implemented. This is true also, although less importantly, for Martelli and Montanari's algorithm [MM82], and Robinson's algorithm [Rob71] is finally retained in many applications despite its exponential worst-case time complexity. There are many explanations for that situation: one important argument is that in practice unification subproblems are not independent, and linear unification algorithms do not perform well on sequences of unify-deunify operations [MU86]. In this paper we present average case complexity theoretic arguments. We first show that the family of unifiable pairs of binary trees is exponentially negligible with respect to the family of arbitrary pairs of binary trees formed over l binary function symbols, c constants and v variables. We analyze the different reasons for failure and get asymptotical and numerical evaluations. We then extend the previous results of [DL89] to these families of trees, we show that a slight modification of Herbrand-Robinson's algorithm has a constant average cost on random pairs of trees. On the other hand, we show that various variants of Martelli and Montanari's algorithm all have a linear average cost on random pairs of trees. The point is that failures by clash are not sufficient to lead to a constant average cost, an efficient occur check (i.e. without a complete traversal of subterms) is necessary. In the last section we extend the results on the probability of the occur check in presence of an unbounded number of variables.
This research was partially supported by the ESPRIT BRA Program of the EC under contract no. 3075, project ALCOM.
Preview
Unable to display preview. Download preview PDF.
VII. Bibliography
A.V. Aho, J.E. Hopcroft and J.D. Ullman. The design and analysis of computer algorithms. Addison Wesley Pub. Comp. 1974.
L. Albert and F. Fages. Average case complexity analysis of the RETE pattern match algorithm. Proceedings of the 15 th International Colloquium on Automata, Languages and Programming, Lecture Notes in Computer Science 317, Tampere, Finland, pages 18–37. Springer Verlag, July 1988.
L. Albert. Average case complexity analysis of RETE pattern match algorithm and average size of join in Databases. Proceedings of the 9 th conference on Foundations of Software Technology and Theoretical Computer Science, Lecture Notes in Computer Science 405, Bangalore, India, pages 223–241. Springer Verlag, December 1989.
L. Albert. Quelques analyses de complexité en moyenne sur les algorithmes de multi-filtrage, d'unification et de requête multiple. PhD. Thesis N. 1379. Université Paris XI, 1990.
L. Albert, R. Casas, J. Diaz and A. Torrecillas. On unification over unrestricted pairs of trees. Submitted to Mathematical Foundations of Computer Science '90, Bratislava, Czechoslovakia, August 1990. Report de Recerca LSI-89-26, universitat politecnica de catalunya, 1989. In Alcom workshop on probabilistic algorithms and average case analysis, Computer Technology Institute, Patras, Greece, March 4–7 1990.
A. Boudet, J.P. Jouannaud and M. Schmidt-Schauss. Unification in Boolean rings and Abelian groups. LICS'88. 1988.
Formel Project. The CAML reference manual. INRIA, 1989.
A. Corbin and M. Bidoit. A rehabilitation of Robinson's unification algorithm. In Information processing 83, R.E.A. Mason, pages 909–914. North Holland 1983.
R. Casas, J. Diaz and J.M. Steyaert. Average case analysis of Robinson's unification algorithm with two different variables. Information proceedings letters, 31, pages 227–232, June 1989.
C.L. Chang and R.C. Lee. Symbolic Logic and Mechanical Theorem Proving. Academic Press, New-York. 1973.
A. Colmerauer. Les grammaires de métamorphose. Natural Language Communication with Computer, Lectures Notes in Computer Science. Springer-Verlag. 1978.
A. Colmerauer. Prolog II, manuel de référence et modèle théorique. Rapport interne, Groupe d'Intelligence Artificielle, Université d'Aix-Marseille II. March 1982.
A. Colmerauer. Equations and inequations on finite and infinite trees. Proceedings of the International Conference on Fith Generation Computer Systems. 1984.
B. Courcelle. Fundamental properties of infinite trees. Theoretical Computer Science. 1983
N. Dershowitz and N. Lindenstrauss. Average time analyses related to logic programming. In 6th International Conference on Logic Programming, pages 369–381. Lisboa 1989.
C. Dwork, P.C. Kanellakis and J.C. Mitchell. On the sequential nature of unification. Journal of logic programming 1, pages 35–50. 1984.
G. Escalada-Imaz and M. Ghallab. A practically efficient and almost linear unification algorithm. Artificial Intelligence, volume 36, number 2, pages 249–263. Sept. 1988.
F. Fages. Formes canoniques dans les algèbres booléennes, et application à la démonstration automatique en logique de premier ordre. Thèse de l'Université de Paris VI. 1983.
F. Fages. Associative-commutative unification. 7th CADE, Napa Valley. 1984.
F. Fages and G. Huet. Complete sets of unifiers and matchers in equational theories. Theoretical Computer Science. July 1986.
P. Flajolet. Mathematical methods in the analysis of algorithms and data structures. In Trends in theoretical computer science, E. Borger, Computer science press, ch. 6, pages 225–304. Rockville, Maryland, 1988. (Lecture Notes for a Graduate Course in Computer Science, Udine, 1984).
P. Flajolet and A. Odlyzko. Singularity Analysis of Generating Functions. In SIAM Journal of Disc. Math., vol. 3, N. 2, pages 216–240, 1990.
P. Flajolet, B. Salvy and P. Zimmermann. Lambda-upsilon-omega: The 1989 Cookbook. Inria Research Report 1073, Institut National de Recherche en Informatique et Automatique, August 1989.
P. Flajolet and J. Vitter. Average Case Analysis of Algorithms and Data Structures. In a Handbook of Theoretical Computer Science, North-Holland, 1987.
J. Herbrand. Recherches sur la théorie de la démonstration. Thèse de l'Université de Paris. 1930. In Ecrits logiques de Jacques Herbrand. Paris, PUF, 1968.
G. Huet and D. Oppen. Equations and Rewrite Rules: a Survey. In Formal Languages: Perspectives and Open Problems, Ed. Book R., Academic Press. 1980.
G. Huet. A Unification Algorithm for Typed Lambda Calculus. Theoretical Computer Science, 1.1, pages 27–57. 1975
G. Huet. Résolution d'équations dans les langages d'ordre 1,2,...,ω. Thèse d'état de l'Université Paris VII. 1976.
J. Jaffar. Efficient unification over infinite terms. New Generation Computing, 2, pages 207–219. 1984.
D. Knuth and P. Bendix. Simple Word Problems in Universal Algebras. In Computational Problems in Abstract Algebra, Ed. Leech J., Pergamon Press, pages 263–297. 1970.
R.A. Kowalski. Predicate Logic as Programming Language. Proceedings IFIP 74, North Holland, pages 569–574. 1974.
J.L. Lassez, M.J. Maher and K. Marriott. Unification revisited. In Foundations of deductive databases and Logic Programming, J. Minker. 1986. IBM Research Report RC12355, 1986.
B.W. Char, K.O. Geddes, G.H. Gonnet, M.B. Monagan and S.M. Watt. MAPLE: Reference Manual. University of Waterloo, 1988. 5th edition.
H.G. Mairson. Deciding ML typability is complete for deterministic exponential time. POPL, San Francisco. January 1990.
R. Milner. A Theory of Type Polymorphism in Programming. JCSS 17, pages 348–375. 1978.
A. Martelli and U. Montanari. Unification in Linear Time and Space: a Structured Presentation. Internal Report B76-16, IEI, Pisa. July 1976.
A. Martelli and U. Montanari. An efficient unification algorithm. In ACM Transactions on Programming Languages and Systems, volume 4, number 2, pages 258–282. April 1982.
H. Mannila and E. Ukkonen. On the complexity of unification sequences. Logic programming. 1986.
G. Plotkin. Building-in Equational Theories. Machine Intelligence 7, pages 73–90. 1972.
M.S. Paterson and M.N. Wegman. Linear unification. In Journal of computer and system sciences 16, pages 158–167. 1978.
J.A. Robinson. A machine-oriented logic based on the resolution principle. In Journal of the Association for Computing Machinery, volume 12, number 1, pages 23–41. Jan. 1965.
J.A. Robinson. Computational Logic: the Unification Computation. Machine Intelligence 6, Eds B. Meltzer and D. Michie American Elsevier, New-York. 1971.
L. Sterling and E. Shapiro. The Art of Prolog: Advanced Programming Techniques. MIT Press Series in Logic Programming, 1986.
M.E. Stickel. A Complete Unification Algorithm for Associative-Commutative Functions. 4th International Joint Conference on Artificial Intelligence, Tbilisi. 1975.
R.E. Tarjan and J. van Leeuwen. Worst-case analysis of set union algorithms. In Journal of the association for computing machinery, volume 31, number 2, pages 245–281. April 1984.
M. Venturini-Zilli. Complexity of the Unification Algorithm for First-Order Expressions. Calcolo XII, Fasc. IV, pages 361–372. 1975.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1991 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Albert, L., Casas, R., Fages, F., Torrecillas, A., Zimmermann, P. (1991). Average case analysis of unification algorithms. In: Choffrut, C., Jantzen, M. (eds) STACS 91. STACS 1991. Lecture Notes in Computer Science, vol 480. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0020799
Download citation
DOI: https://doi.org/10.1007/BFb0020799
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-53709-0
Online ISBN: 978-3-540-47002-1
eBook Packages: Springer Book Archive