Skip to main content

Computing Logic Programming Semantics in Linear Algebra

  • Conference paper
  • First Online:
Multi-disciplinary Trends in Artificial Intelligence (MIWAI 2018)

Part of the book series: Lecture Notes in Computer Science ((LNAI,volume 11248))

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.

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

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

  1. Saraswat, V.: Reasoning 2.0 or machine learning and logic–the beginnings of a new computer science. Data Science Day, Kista Sweden (2016)

    Google Scholar 

  2. Sato, T.: A linear algebraic approach to Datalog evaluation. Theory Pract. Log. Program. 17(3), 244–265 (2017)

    Article  MathSciNet  Google Scholar 

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

    Google Scholar 

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

    Google Scholar 

  5. Coecke, B., Sadrzadeh, M., Clarky, S.: Mathematical foundations for a compositional distributional model of meaning. Linguist. Anal. 36, 345–384 (2011)

    Google Scholar 

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

    Chapter  Google Scholar 

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

    Google Scholar 

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

    Chapter  Google Scholar 

  9. van Emden, M.H., Kowalski, R.A.: The semantics of predicate logic as a programming language. J. ACM 23(4), 733–742 (1976)

    Article  MathSciNet  Google Scholar 

  10. Kolda, T., Bader, B.: Tensor decompositions and applications. SIAM Rev. 51(3), 455–500 (2009)

    Article  MathSciNet  Google Scholar 

  11. Lin, F.: From satisfiability to linear algebra. In: Invited Talk, 26th Australian Joint Conference on Artificial Intelligence (2013)

    Google Scholar 

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

    Article  MathSciNet  Google Scholar 

  13. Fernandez, J.A., Lobo, J., Minker, J., Subrahmanian, V.S.: Disjunctive LP + integrity constraints = stable model semantics. AMAI 8(3–4), 449–474 (1993)

    MathSciNet  MATH  Google Scholar 

  14. Maple. https://www.maplesoft.com/support/install/maple2017_install.html

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

    Article  MathSciNet  Google Scholar 

  16. Clasp. https://potassco.org/clasp/

  17. DLV system. http://www.dlvsystem.com/dlv/

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

    Google Scholar 

Download references

Acknowledgment

This work was supported by JSPS KAKENHI Grant Numbers JP17H00763 and JP18H03288.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Hien D. Nguyen .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

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)

Publish with us

Policies and ethics