Skip to main content
Log in

Faster Linear Unification Algorithm

  • Published:
Journal of Automated Reasoning Aims and scope Submit manuscript

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.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2

Similar content being viewed by others

References

  1. Baader, F., Snyder, W.: Unification theory. In: Robinson, A., Voronkov, A. (eds.) Handbook Of Automated Reasoning. Elsevier, Amsterdam (2001)

    Google Scholar 

  2. 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

    Article  MathSciNet  MATH  Google Scholar 

  3. Jacobson, E.: Unification and anti-unification. Technical Report (1991). http://erikjacobsen.com/pdf/unification.pdf

  4. https://github.com/ddccc/Unification. Accessed 24 July 2022

  5. 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

    Chapter  Google Scholar 

  6. Kowalski, R.: A proof procedure using connection graphs. J. Assoc. Comput. Mach. 22(4), 572–659 (1975). https://doi.org/10.1145/321906.321919

    Article  MathSciNet  MATH  Google Scholar 

  7. 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)

  8. Martelli, A., Montanari, U.: An efficient unification algorithm. ACM Trans. Program. Lang. Syst. 4(2), 258–282 (1982)

    Article  MATH  Google Scholar 

  9. Motroi, V., Ciobaco, S.: A Typo in the Paterson–Wegman–de Champeaux algorithm. Arxiv Preprint (2020). https://arxiv.org/abs/2007.00304

  10. 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

    Article  MathSciNet  MATH  Google Scholar 

  11. https://en.wikipedia.org/wiki/Planning_Domain_Definition_Language. Accessed 24 July 2022

  12. Robinson, J.A.: A machine-oriented logic based on the resolution principle. J. Assoc. Comput. Mach. 12(1), 23–41 (1965)

    Article  MathSciNet  MATH  Google Scholar 

  13. https://en.wikipedia.org/wiki/Disjoint-set_data_structure. Accessed 24 July 2022

Download references

Funding

The author has not been funded.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Dennis de Champeaux.

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(xh(y1  y1) y2)

P(h(x1 x1) h(x2 x2) y2 y3 x3)

P(x2 xh(y1 y1) h(y2 y2) y3

gen1f

P(h(x1 x1) y2 aa)

P(xh(y1 y1) y2)

P(h(x1 x1) h(x2 x2) y2 y3 aa)

P(x2 xh(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

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

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

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10817-022-09635-1

Keywords

Navigation