Skip to main content

lp2cpp: A Tool For Compiling Stratified Logic Programs

  • Conference paper
  • First Online:
AI*IA 2017 Advances in Artificial Intelligence (AI*IA 2017)

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

Included in the following conference series:

Abstract

The evaluation of logic programs is traditionally implemented in monolithic systems that are general-purpose in the sense that they are able to process an entire class of programs. In this paper, we follow a different approach; we present a compilation procedure that is able to generate a problem-specific executable implementation of a given (non-ground) logic program. Our implementation follows a bottom-up evaluation strategy. Moreover, we implemented such procedure into a C++ tool and we present an experimental analysis that shows the performance benefits that can be obtained by a compilation-based approach.

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.

    Safety and stratification are standard properties of Datalog programs cfr. [19].

  2. 2.

    The tool can be downloaded from http://goo.gl/XhZXWh.

References

  1. Arni, F., Ong, K., Tsur, S., Wang, H., Zaniolo, C.: The deductive database system LDL++. TPLP 3(1), 61–94 (2003)

    MATH  Google Scholar 

  2. Brewka, G., Eiter, T., Truszczynski, M.: Answer set programming at a glance. Commun. ACM 54(12), 92–103 (2011)

    Article  Google Scholar 

  3. Calì, A., Gottlob, G., Lukasiewicz, T., Pieris, A.: Datalog+/-: a family of languages for ontology querying. In: de Moor, O., Gottlob, G., Furche, T., Sellers, A. (eds.) Datalog 2.0 2010. LNCS, vol. 6702, pp. 351–368. Springer, Heidelberg (2011). https://doi.org/10.1007/978-3-642-24206-9_20

    Chapter  Google Scholar 

  4. Calimeri, F., Fuscà, D., Perri, S., Zangari, J.: \(\cal{I}\)-dlv: the new intelligent grounder of dlv. In: Adorni, G., Cagnoni, S., Gori, M., Maratea, M. (eds.) AI*IA 2016. LNCS, vol. 10037, pp. 192–207. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-49130-1_15

    Chapter  Google Scholar 

  5. Ceri, S., Gottlob, G., Tanca, L.: Logic Programming and Databases. Springer, Heidelberg (1990). https://doi.org/10.1007/978-3-642-83952-8

    Book  Google Scholar 

  6. Cuteri, B., Ricca, F.: A compiler for stratified datalog programs: preliminary results. In: 25th Italian Symposium on Advanced Database Systems, SEBD 2017, Squillace, Catanzaro, Italy, 25–29 June 2017. (2017, to appear)

    Google Scholar 

  7. Erdem, E., Gelfond, M., Leone, N.: Applications of answer set programming. AI Mag. 37(3), 53–68 (2016)

    Article  Google Scholar 

  8. Gebser, M., Kaminski, R., Kaufmann, B., Ostrowski, M., Schaub, T., Wanko, P.: Theory solving made easy with clingo 5. In: ICLP 2016 TCs. pp. 2:1–2:15 (2016)

    Google Scholar 

  9. Huang, S.S., Green, T.J., Loo, B.T.: Datalog and emerging applications: an interactive tutorial. In: Proceedings of SIGMOD 2011, pp. 1213–1216. ACM (2011)

    Google Scholar 

  10. Kaufmann, B., Leone, N., Perri, S., Schaub, T.: Grounding and solving in answer set programming. AI Mag. 37(3), 25–32 (2016)

    Article  Google Scholar 

  11. Kifer, M., Lozinskii, E.L.: On compile-time query optimization in deductive databases by means of static filtering. ACM TDS 15(3), 385–426 (1990)

    Article  MathSciNet  Google Scholar 

  12. Leone, N., Pfeifer, G., Faber, W., Eiter, T., Gottlob, G., Perri, S., Scarcello, F.: The DLV system for knowledge representation and reasoning. ACM TOCL 7(3), 499–562 (2006)

    Article  MATH  MathSciNet  Google Scholar 

  13. Liang, S., Fodor, P., Wan, H., Kifer, M.: Openrulebench: an analysis of the performance of rule engines. In: Proceedings of WWW 2009, pp. 601–610. ACM (2009)

    Google Scholar 

  14. Liu, Y.A., Stoller, S.D.: From datalog rules to efficient programs with time and space guarantees. ACM Trans. Program. Lang. Syst. 31(6), 21:1–21:38 (2009)

    Article  Google Scholar 

  15. Scholz, B., Jordan, H., Subotić, P., Westmann, T.: On fast large-scale program analysis in datalog. In: Proceedings of the 25th International Conference on Compiler Construction, pp. 196–206. ACM (2016)

    Google Scholar 

  16. Scholz, B., Vorobyov, K., Krishnan, P., Westmann, T.: A datalog source-to-source translator for static program analysis: an experience report. In: 2015 24th Australasian Software Engineering Conference (ASWEC), pp. 28–37. IEEE (2015)

    Google Scholar 

  17. Sereni, D., Avgustinov, P., de Moor, O.: Adding magic to an optimising datalog compiler. In: Proceedings of the 2008 ACM SIGMOD International Conference on Management of Data, pp. 553–566. ACM (2008)

    Google Scholar 

  18. Terracina, G., Leone, N., Lio, V., Panetta, C.: Experimenting with recursive queries in database and logic programming systems. Theory Pract. Logic Program. 8(2), 129–165 (2008)

    Article  MATH  MathSciNet  Google Scholar 

  19. Ullman, J.D.: Principles of Database and Knowledge-Base Systems. Computer Science Press, New York (1988)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Bernardo Cuteri .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2017 Springer International Publishing AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Cuteri, B., De Rosis, A.F., Ricca, F. (2017). lp2cpp: A Tool For Compiling Stratified Logic Programs. In: Esposito, F., Basili, R., Ferilli, S., Lisi, F. (eds) AI*IA 2017 Advances in Artificial Intelligence. AI*IA 2017. Lecture Notes in Computer Science(), vol 10640. Springer, Cham. https://doi.org/10.1007/978-3-319-70169-1_15

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-70169-1_15

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-70168-4

  • Online ISBN: 978-3-319-70169-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics