Abstract
This paper introduces a novel approach to computing logic programming semantics. First, a propositional Herbrand base is represented in a vector space and if-then rules in a program are encoded in a matrix. Then the least fixpoint of a definite logic program is computed by matrix-vector products with a non-linear operation. Second, disjunctive logic programs are represented in third-order tensors and their minimal models are computed by algebraic manipulation of tensors. Third, normal logic programs are represented by matrices and third-order tensors, and their stable models are computed. The result of this paper exploits a new connection between linear algebraic computation and symbolic computation, which has the potential to realize logical inference in huge scale of knowledge bases.
Similar content being viewed by others
References
Alferes, J.J., Leite, J.A., Pereira, L.M., Przymusinska, H., Przymusinski, T.: Dynamic updates of non-monotonic knowledge bases. J. Log. Program. 45, 43–70 (2000)
Aspis, Y., Broda, K., Russo, A., Lobo, J.: Stable and supported semantics in continuous vector spaces. In: Proc. 17Th International Conference on Principles of Knowledge Representation and Reasoning, Rhodes, Greece, September, pp. 59–68 (2020)
Bell, C., Nerode, A., Ng, R.T., Subrahmanian, V.S.: Mixed integer programming methods for computing nonmonotonic deductive databases. J. ACM 41(6), 1178–1215 (1994)
Brewka, G. Eiter, T., Truszczynski, M. (eds.): Special issue on answer set programming. AI Magazine 37(3), Fall (2016)
Copilowish, I.M.: Matrix development of the calculus of relations. J. Symb. Log. 13, 193–203 (1948)
d’Avila Garcez, D., Lamb, L.C.: Neurosymbolic AI: the 3rd wave. arXiv:2012.05876 (2020)
Dowling, W.F., Gallier, J.H.: Linear-time algorithms for testing the satisfiability of propositional Horn formulae. J. Logic Program. 1(3), 267–284 (1984)
Fernandez, J.A., Lobo, J., Minker, J., Subrahmanian, V.S.: Disjunctive LP + integrity constraints = stable model semantics. Annals of Mathematics and AI 8(3-4), 449–474 (1993)
Gelfond, M., Lifschitz, V.: The stable model semantics for logic programming. In: Proc. 5Th Int. Conf. And Symp. Logic Programming, pp.1070–1080. MIT Press (1988)
Grefenstette, E.: Towards a formal distributional semantics: simulating logical calculi with tensors. In: Proc. 2Nd Joint Conf.Lexical and Computational Semantics, pp. 1–10 (2013)
Gordon, G.J., Hong, S.A., Dudík, M.: First-order mixed integer linear programming. In: Proc. 25Th Conf. Uncertainty in Artificial Intelligence, pp. 213–222 (2009)
Hooker, J.N.: A quantitative approach to logical inference. Decis. Support. Syst. 4(1), 45–69 (1988)
Kolda, T.G., Bader, B.W.: Tensor decompositions and applications. SIAM Rev. 51(3), 455–500 (2009)
Liu, G., Janhunen, T., Niemelä, I.: Answer Set Programming via Mixed Integer Programming. In: Proc. 13Th Int. Conf. Principles of Knowledge Representation and Reasoning, pp.32–42 (2012)
Lloyd, J.W.: Foundations of Logic Programming, 2nd edn. Springer, Heidelberg (1987)
Mizraji, E.: Vector logics: the matrix-vector representation of logical calculus. Fuzzy Set. Syst. 50, 179–185 (1992)
Nickel, M., Murphy, K., Tresp, V., Gabrilovich, E.: A Review of Relational Machine Learning for Knowledge Graphs. Proc. IEEE 104(1), 11–33 (2016)
Nguyen, H.D., Sakama, C., Sato, T., Inoue, K.: Computing logic programming semantics in linear algebra. In: Proc. 12Th International Conference on Multi-Disciplinary Trends in Artificial Intelligence, Lecture Notes in Artificial Intelligence 11248, Springer, pp.32–48 (2018)
Nguyen, H.D., Sakama, C., Sato, T., Inoue, K.: An efficient reasoning method on logic programming using partial evaluation in vector spaces. Journal of Logic and Computation 31(5), 1298–1316 (2021). Preliminary version: Partial evaluation of logic programs in vector spaces. In: Proc.11th Workshop on Answer Set Programming and Other Computing Paradigms (ASPOCP 2018), Oxford UK, July 2018. arXiv:1812.03508v3
Nguyen, T., Inoue, K., Sakama, C.: Enhancing linear algebraic computation of logic programs using sparse representation. EPTCS Online Proceedings of ICLP (2020)
Rocktaschel, T., Bosnjak, M., Singh, S., Riedel, S.: Low-dimensional embeddings of logic. In: Proc. ACL 2014 Workshop on Semantic Parsing, pp.45–49 (2014)
Sakama, C., Inoue, K., Sato, T.: Linear algebraic characterization of logic programs. In: Proc. 10Th International Conference on Knowledge Science, Engineering and Management, Lecture Notes in Artificial Intelligence 10412, pp.520–533. Springer (2017)
Saraswat, V.: Reasoning 2.0 Or Machine Learning and Logic–The Beginnings of a New Computer Science. Data Science Day, Kista Sweden (2016)
Sato, T.: Embedding tarskian semantics in vector spaces. In: Proc. AAAI-17 Workshop on Symbolic Inference and Optimization (2017)
Sato, T.: A linear algebraic approach to Datalog evaluation. Theory Pract. Log. Program. 17(3), 244–265 (2017)
Sato, T., Inoue, K., Sakama, C.: Abducing relations in continuous spaces. In: Proc.IJCAI-18, pp. 1956–1962 (2018)
Sato, T., Sakama, C., Inoue, K.: From 3-valued semantics to supported model computation for logic programs in vector spaces. In: Proc. 12Th International Conference on Agents and Artificial Intelligence (ICAART), pp. 758–765. Malta (2020)
Serafini, L., d’Avila Garcez, A.: Learning and Reasoning with Logic Tensor Networks. Advances in Artificial Intelligence, LNCS, vol. 10037, pp 334–348. Springer, Heidelberg (2016)
van Emden, M.H., Kowalski, R.A.: The semantics of predicate logic as a programming language. JACM 23(4), 733–742 (1976)
Yang, B., Yih, W.-t., He, X., Gao, J., Deng, L.: Embedding entities and relations for learning and inference in knowledge bases. In: Proc. Int. Conf. Learning Representations (2015)
Acknowledgments
We thank the reviewers for valuable comments. This work is supported by JSPS KAKENHI Grant Number JP18H03288.
Funding
This work is supported by JSPS KAKENHI Grant Number JP18H03288
Author information
Authors and Affiliations
Contributions
All authors contributed to the study conception and formulation. The first draft of the manuscript was written by the first author and all authors commented on previous versions of the manuscript. All authors read and approved the final manuscript.
Corresponding author
Ethics declarations
Conflict of Interests
The authors declare that they have no conflict of interest.
Additional information
Publisher’s note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
About this article
Cite this article
Sakama, C., Inoue, K. & Sato, T. Logic programming in tensor spaces. Ann Math Artif Intell 89, 1133–1153 (2021). https://doi.org/10.1007/s10472-021-09767-x
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10472-021-09767-x