Abstract
Logic programming is a logic-based programming paradigm, and provides languages for declarative problem solving and symbolic reasoning. In this paper, we develop new algorithms for computing logic programming semantics in linear algebra. We first introduce an algorithm for computing the least model of a definite logic program using matrices. Next, we introduce an algorithm for computing stable models of a normal logic program. We also develop optimization techniques for speeding-up those algorithms. Finally, the complexity of them is analyzed and tested in practice.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
In [8], the fact is represented by \( ^{{{\prime \prime }}} p_{i} \leftarrow {\sf T}^{{{\prime \prime }}} \) and is encoded in a matrix by aij = 1 where \( {\text{row}}_{i} \left( {M_{P} } \right) = p_{i} \;{\text{and}}\;{\text{col}}_{j} \left( {M_{P} } \right) = {\sf T}. \):
- 2.
A definite program P satisfies the MD-condition if it satisfies the following condition: For any two rules r1 and r2 in P (r1 ≠ r2): head(r1) = head(r2) implies |body(r1)| ≤1 and |body(r2)| ≤ 1.
References
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.: A linear algebraic approach to Datalog evaluation. Theory Pract. Log. Program. 17(3), 244–265 (2017)
Yang, B., Yih, W., He, X., Gao, J., Deng, L.: Embedding entities and relations for learning and inference in knowledge bases. In: Third International Conference on Learning Representations (ICLR 2015), San Diego, USA (2015)
Grefenstette, E.: Towards a formal distributional semantics: simulating logical calculi with tensors. In: Proceedings of Second Joint Conference on Lexical and Computational Semantics (*SEM), vol. 1, pp. 1–10, Atlanta, USA (2013)
Coecke, B., Sadrzadeh, M., Clarky, S.: Mathematical foundations for a compositional distributional model of meaning. Linguist. Anal. 36, 345–384 (2011)
Serafini, L., d’Avila Garcez, A.S.: Learning and reasoning with logic tensor networks. In: Adorni, G., Cagnoni, S., Gori, M., Maratea, M. (eds.) AI*IA 2016. LNCS (LNAI), vol. 10037, pp. 334–348. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-49130-1_25
Serafini, L., Donadello, I., Garcez, A.: Learning and reasoning with logic tensor networks: theory and application to semantic image interpretation. In: Proceedings of 32nd ACM SIGAPP Symposium on Applied Computing (SAC 2017), pp. 125–130, Marrakech, Morocco (2017)
Sakama, C., Inoue, K., Sato, T.: Linear algebraic characterization of logic programs. In: Li, G., Ge, Y., Zhang, Z., Jin, Z., Blumenstein, M. (eds.) KSEM 2017. LNCS (LNAI), vol. 10412, pp. 520–533. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-63558-3_44
van Emden, M.H., Kowalski, R.A.: The semantics of predicate logic as a programming language. J. ACM 23(4), 733–742 (1976)
Kolda, T., Bader, B.: Tensor decompositions and applications. SIAM Rev. 51(3), 455–500 (2009)
Lin, F.: From satisfiability to linear algebra. In: Invited Talk, 26th Australian Joint Conference on Artificial Intelligence (2013)
Alferes, J.J., Leite, J.A., Pereira, L.M., Przymusinska, H., Przymusinski, T.: Dynamic updates of non-monotonic knowledge bases. J. Logic Program. 45(1–3), 43–70 (2000)
Fernandez, J.A., Lobo, J., Minker, J., Subrahmanian, V.S.: Disjunctive LP + integrity constraints = stable model semantics. AMAI 8(3–4), 449–474 (1993)
Maple. https://www.maplesoft.com/support/install/maple2017_install.html
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)
Clasp. https://potassco.org/clasp/
DLV system. http://www.dlvsystem.com/dlv/
Sakama, C., Nguyen, H.D., Sato, T., Inoue, K.: Partial evaluation of logic programs in vector space. In: 11th Workshop on Answer Set Programming and Other Computing Paradigms (ASPOCP 2018), Oxford, UK, July 2018
Acknowledgment
This work was supported by JSPS KAKENHI Grant Numbers JP17H00763 and JP18H03288.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2018 Springer Nature Switzerland AG
About this paper
Cite this paper
Nguyen, H.D., Sakama, C., Sato, T., Inoue, K. (2018). Computing Logic Programming Semantics in Linear Algebra. In: Kaenampornpan, M., Malaka, R., Nguyen, D., Schwind, N. (eds) Multi-disciplinary Trends in Artificial Intelligence. MIWAI 2018. Lecture Notes in Computer Science(), vol 11248. Springer, Cham. https://doi.org/10.1007/978-3-030-03014-8_3
Download citation
DOI: https://doi.org/10.1007/978-3-030-03014-8_3
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-03013-1
Online ISBN: 978-3-030-03014-8
eBook Packages: Computer ScienceComputer Science (R0)