A Coalgebraic Approach to Unification Semantics of Logic Programming

  • Roberto BruniEmail author
  • Ugo Montanari
  • Giorgio Mossa
Part of the Lecture Notes in Computer Science book series (LNCS, volume 11760)


In the version of logic programming (LP) based on interpretations where variables occur in atoms, a goal reduction via unification can be seen as a transition labelled by the most general unifier. Categorically, it is thus natural to model a logic program as a coalgebra. In the paper we represent: (i) goals as the substitutive monoid freely generated by the predicate symbols; (ii) the LTS as the structured coalgebra defined by the SOS rules implicit in the LP semantics; (iii) the bisimulation semantics of a logic program as its image on the final coalgebra.



We thank Andrea Corradini who read a preliminary version of this paper and helped us to improve the presentation. We also thank the anonymous referees for their useful remarks and pointers to the literature.


  1. 1.
    Adamek, J., Rosicky, J.: Locally Presentable and Accessible Categories. London Mathematical Society Lecture Note Series. Cambridge University Press, Cambridge (1994)zbMATHCrossRefGoogle Scholar
  2. 2.
    Amato, G., Lipton, J., McGrail, R.: On the algebraic structure of declarative programming languages. Theor. Comp. Sci. 410(46), 4626–4671 (2009)MathSciNetzbMATHCrossRefGoogle Scholar
  3. 3.
    Barr, M.: Terminal coalgebras in well-founded set theory. Theor. Comp. Sci. 114(2), 299–315 (1993)MathSciNetzbMATHCrossRefGoogle Scholar
  4. 4.
    Bonchi, F., Montanari, U.: Reactive systems, (semi-)saturated semantics and coalgebras on presheaves. Theor. Comput. Sci. 410(41), 4044–4066 (2009). Festschrift for Mogens Nielsen’s 60th birthdayMathSciNetzbMATHCrossRefGoogle Scholar
  5. 5.
    Bonchi, F., Zanasi, F.: Bialgebraic semantics for logic programming. Logical Methods Comput. Sci. 11(1), 1–47 (2015)MathSciNetzbMATHCrossRefGoogle Scholar
  6. 6.
    Bonsangue, M.M., Hansen, H.H., Kurz, A., Rot, J.: Presenting distributive laws. In: Heckel, R., Milius, S. (eds.) CALCO 2013. LNCS, vol. 8089, pp. 95–109. Springer, Heidelberg (2013). Scholar
  7. 7.
    Bruni, R., Montanari, U., Rossi, F.: An interactive semantics of logic programming. Theory Pract. Logic Program. 1(6), 647–690 (2001)MathSciNetzbMATHCrossRefGoogle Scholar
  8. 8.
    Corradini, A., Asperti, A.: A categorical model for logic programs: indexed monoidal categories. In: de Bakker, J.W., de Roever, W.-P., Rozenberg, G. (eds.) REX 1992. LNCS, vol. 666, pp. 110–137. Springer, Heidelberg (1993). Scholar
  9. 9.
    Corradini, A., Heckel, R., Montanari, U.: From SOS specifications to structured coalgebras: how to make bisimulation a congruence. ENTCS 19, 118–141 (1999)MathSciNetzbMATHGoogle Scholar
  10. 10.
    Corradini, A., Montanari, U.: An algebraic semantics for structured transition systems and its applications to logic programs. Theor. Comput. Sci. 103(1), 51–106 (1992)MathSciNetzbMATHCrossRefGoogle Scholar
  11. 11.
    de Simone, R.: Higher-level synchronising devices in meije-sccs. Theor. Comput. Sci. 37, 245–267 (1985)MathSciNetzbMATHCrossRefGoogle Scholar
  12. 12.
    Falaschi, M., Levi, G., Palamidessi, C., Martelli, M.: Declarative modeling of the operational behavior of logic languages. Theor. Comput. Sci. 69(3), 289–318 (1989)MathSciNetzbMATHCrossRefGoogle Scholar
  13. 13.
    Finkelstein, S.E., Freyd, P., Lipton, J.: Logic programming in tau categories. In: Pacholski, L., Tiuryn, J. (eds.) CSL 1994. LNCS, vol. 933, pp. 249–263. Springer, Heidelberg (1995). Scholar
  14. 14.
    Gray, J.: The category of sketches as a model for algebraic semantics. In: Categories in Computer Science and Logic. Contemporary Mathematics, vol. 92. AMS (1989)Google Scholar
  15. 15.
    Komendantskaya, E., Power, J.: Coalgebraic semantics for derivations in logic programming. In: Corradini, A., Klin, B., Cîrstea, C. (eds.) CALCO 2011. LNCS, vol. 6859, pp. 268–282. Springer, Heidelberg (2011). Scholar
  16. 16.
    Komendantskaya, E., Power, J.: Logic programming: laxness and saturation. J. Log. Algebr. Meth. Program. 101, 1–21 (2018)MathSciNetzbMATHCrossRefGoogle Scholar
  17. 17.
    Komendantskaya, E., Power, J., Schmidt, M.: Coalgebraic logic programming: from semantics to implementation. J. Log. Comput. 26(2), 745–783 (2016)MathSciNetzbMATHCrossRefGoogle Scholar
  18. 18.
    Kowalski, R.A.: Algorithm = logic + control. Comm. ACM 22(7), 424–436 (1979)zbMATHCrossRefGoogle Scholar
  19. 19.
    Lanese, I., Montanari, U.: Mapping fusion and synchronized hyperedge replacement into logic programming. Theory Pract. Logic Program. 7(1–2), 123–151 (2007)MathSciNetzbMATHCrossRefGoogle Scholar
  20. 20.
    Leifer, J.J., Milner, R.: Deriving bisimulation congruences for reactive systems. In: Palamidessi, C. (ed.) CONCUR 2000. LNCS, vol. 1877, pp. 243–258. Springer, Heidelberg (2000). Scholar
  21. 21.
    Levi, G., Palamidessi, C.: Contributions to the semantics of logic perpetual processes. Acta Inf. 25(6), 691–711 (1988)MathSciNetzbMATHCrossRefGoogle Scholar
  22. 22.
    Lloyd, J.W.: Foundations of Logic Programming, 2nd edn. Springer, Heidelberg (1987). Scholar
  23. 23.
    Montanari, U., Rossi, F.: Perfect relaxation in constraint logic programming. In: ICLP 1991, pp. 223–237. MIT Press (1991)Google Scholar
  24. 24.
    Montanari, U., Sammartino, M., Tcheukam, A.: Decomposition structures for soft constraint evaluation problems: an algebraic approach. In: Heckel, R., Taentzer, G. (eds.) Graph Transformation, Specifications, and Nets. LNCS, vol. 10800, pp. 179–200. Springer, Cham (2018). Scholar
  25. 25.
    Turi, D., Plotkin, G.D.: Towards a mathematical operational semantics. In: LICS 1997, pp. 280–291. IEEE Computer Society (1997)Google Scholar

Copyright information

© Springer Nature Switzerland AG 2019

Authors and Affiliations

  1. 1.Dipartimento di InformaticaUniversità di PisaPisaItaly
  2. 2.Dipartimento di MatematicaUniversità di PisaPisaItaly

Personalised recommendations