Abstract
The Robinson unification algorithm has exponential worst case behavior. This triggered the development of (semi-)linear versions around 1976 by Martelli and Montanari as well as by Paterson and Wegman (J Comput Syst Sci 16(2):158–167, 1978, https://doi.org/10.1016/0022-0000(78)90043-0). Another version emerged by Baader and Snyder around 2001. While these versions are distinctly faster on larger input pairs, the Robinson version still does better than them on small-sized inputs. This paper describes yet another (semi-)linear version that is faster and challenges also the Robinson version on small-sized inputs. All versions have been implemented and compared against each other on different types and sizes of input pairs.
Similar content being viewed by others
References
Baader, F., Snyder, W.: Unification theory. In: Robinson, A., Voronkov, A. (eds.) Handbook Of Automated Reasoning. Elsevier, Amsterdam (2001)
de Champeaux, D.: About the Paterson–Wegman linear unification algorithm. J. Comput. Syst. Sci. 32(1), 79–90 (1986). https://doi.org/10.1016/0022-0000(86)90003-6
Jacobson, E.: Unification and anti-unification. Technical Report (1991). http://erikjacobsen.com/pdf/unification.pdf
https://github.com/ddccc/Unification. Accessed 24 July 2022
Hoder, K., Voronkov, A.: Comparing unification algorithms in first-order theorem proving. In: Mertsching, B., Hund, M., Aziz, Z. (eds.) KI 2009: Advances in Artificial Intelligence. Lecture Notes in Computer Science, vol. 5803. Springer, Berlin (2009). https://doi.org/10.1007/978-3-642-04617-9_55
Kowalski, R.: A proof procedure using connection graphs. J. Assoc. Comput. Mach. 22(4), 572–659 (1975). https://doi.org/10.1145/321906.321919
Martelli, A., Montanari, U.: Unification in linear time and space: a structured presentation. Internal Report B76-16. Ist. di Elaborazione delle Informazione, Consiglio Nazionale delle Ricerche, Pisa, Italy (1976)
Martelli, A., Montanari, U.: An efficient unification algorithm. ACM Trans. Program. Lang. Syst. 4(2), 258–282 (1982)
Motroi, V., Ciobaco, S.: A Typo in the Paterson–Wegman–de Champeaux algorithm. Arxiv Preprint (2020). https://arxiv.org/abs/2007.00304
Paterson, M.S., Wegman, M.N.: Linear unification. J. Comput. Syst. Sci. 16(2), 158–167 (1978). https://doi.org/10.1016/0022-0000(78)90043-0
https://en.wikipedia.org/wiki/Planning_Domain_Definition_Language. Accessed 24 July 2022
Robinson, J.A.: A machine-oriented logic based on the resolution principle. J. Assoc. Comput. Mach. 12(1), 23–41 (1965)
https://en.wikipedia.org/wiki/Disjoint-set_data_structure. Accessed 24 July 2022
Funding
The author has not been funded.
Author information
Authors and Affiliations
Corresponding author
Ethics declarations
Conflict of interest
There are no competing interests.
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Appendix: Eight Generators
Appendix: Eight Generators
Eight generators were used for obtaining argument pairs to compare the performance of the versions discussed. These generators take as argument the size for a pair. To get an impression of the size of these problems, we show for each generator the instances for the sizes 1 and 2. The generators produce unifiable or non-unifiable pairs. The generator names that end with “f” produce non-unifiable pairs.
Generator | Size 1 | Size 2 |
---|---|---|
gen1 | P(h(x1 x1) y2 x2) P(x2 h(y1 y1) y2) | P(h(x1 x1) h(x2 x2) y2 y3 x3) P(x2 x3 h(y1 y1) h(y2 y2) y3 |
gen1f | P(h(x1 x1) y2 aa) P(x2 h(y1 y1) y2) | P(h(x1 x1) h(x2 x2) y2 y3 aa) P(x2 x3 h(y1 y1) h(y2 y2) y3 |
gen3 | P(x0 f(x1 x1) x1 f(x2 x2)) P(f(y0 y0) y0 f(y1 y1) y2) | P(x0 f(x1 x1) x1 f(x2 x2) x2 f(x3 x3)) P(f(y0 y0) y0 f(y1 y1) y1 f(y2 y2) y3) |
gen3f | P(x0 f(x1 x1) x1 f(x2 x2)) P(f(y0 y0) y0 f(x0 x0) y2) | P(x0 f(x1 x1) x1 f(x2 x2) x2 f(x3 x3)) P(f(y0 y0) y0 f(y1 y1) y1 f(x0 x0) y3) |
gen4 | P(x1 y1) P(g(y1 y1) f(x2)) | P(x1 y1 x2 y2) P(g(y1 y1) f(x2) g(y2 y2) f(x3)) |
gen4f | P(x1 y1) P(g(y1 y1) x1) | P(x1 y1 x2 y2) P(g(y1 y1) f(x2) g(y2 y2) x1) |
gen2 | P(x1) P(f(y))) | P(x1 f(x2)) P(f(x2) f(f(y))) |
gen2f | P(x1) P(f(x1)) | P(x1 f(x2)) P(f(x2) f(f(x1))) |
Rights and permissions
About this article
Cite this article
de Champeaux, D. Faster Linear Unification Algorithm. J Autom Reasoning 66, 845–860 (2022). https://doi.org/10.1007/s10817-022-09635-1
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10817-022-09635-1