Skip to main content

Pipelined Bottom-Up Evaluation of Datalog Programs: The Push Method

  • Conference paper
  • First Online:
Perspectives of System Informatics (PSI 2017)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 10742))

Abstract

In this paper, we present a method for bottom-up evaluation of Datalog programs in deductive databases that “pushes” derived facts immediately to other rules where they are used for deriving more facts. In this way, the materialization of derived relations is avoided as far as possible. Derived facts are represented by values in variables and a location in the program, and not as explicitly constructed tuples. This helps to avoid copying operations and to keep the actively used memory small to make better use of modern processors. The method can be quite easily explained by translating Datalog to functions in a standard programming language like C++ and then using optimizations of the C++ compiler like inlining. First performance tests with benchmarks from the OpenRuleBench collection give good results. This is interesting because systems based on SLD-resolution with tabling such as XSB have beaten older deductive database implementations based on bottom-up evaluation. Now it seems that bottom-up evaluation can be done in a very competitive way.

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.

    Available at http://users.informatik.uni-halle.de/~brass/sldmagic/.

References

  1. Bancilhon, F., Maier, D., Sagiv, Y., Ullman, J.D.: Magic sets and other strange ways to implement logic programs. In: Proceedings of the 5th ACM Symposium on Principles of Database Systems (PODS 1986), pp. 1–15. ACM Press (1986)

    Google Scholar 

  2. Brass, S.: SLDMagic—the real magic (with applications to web queries). In: Lloyd, J., Dahl, V., Furbach, U., Kerber, M., Lau, K.-K., Palamidessi, C., Pereira, L.M., Sagiv, Y., Stuckey, P.J. (eds.) CL 2000. LNCS (LNAI), vol. 1861, pp. 1063–1077. Springer, Heidelberg (2000). https://doi.org/10.1007/3-540-44957-4_71

    Chapter  Google Scholar 

  3. Brass, S.: Implementation alternatives for bottom-up evaluation. In: Hermenegildo, M., Schaub, T. (eds.) Technical Communications of the 26th International Conference on Logic Programming (ICLP 2010), Leibniz International Proceedings in Informatics (LIPIcs), vol. 7, pp. 44–53. Schloss Dagstuhl (2010). http://drops.dagstuhl.de/opus/volltexte/2010/2582

  4. Brass, S.: Order in Datalog with applications to declarative output. In: Barceló, P., Pichler, R. (eds.) Datalog 2.0 2012. LNCS, vol. 7494, pp. 56–67. Springer, Heidelberg (2012). https://doi.org/10.1007/978-3-642-32925-8_7

    Chapter  Google Scholar 

  5. Brass, S.: A framework for goal-directed query evaluation with negation. In: Calimeri, F., Ianni, G., Truszczynski, M. (eds.) LPNMR 2015. LNCS (LNAI), vol. 9345, pp. 151–157. Springer, Cham (2015). https://doi.org/10.1007/978-3-319-23264-5_14

    Chapter  Google Scholar 

  6. Brass, S., Stephan, H.: Bottom-up evaluation of Datalog: preliminary report. In: Schwarz, S., Hölldobler, S. (eds.) 29th Workshop on (Constraint) Logic Programming (WLP 2015), pp. 21–35. HTWK Leipzig (2015). http://www.imn.htwk-leipzig.de/WLP2015/

  7. Costa, V.S.: Optimising bytecode emulation for Prolog. In: Nadathur, G. (ed.) PPDP 1999. LNCS, vol. 1702, pp. 261–277. Springer, Heidelberg (1999). https://doi.org/10.1007/10704567_16

    Chapter  Google Scholar 

  8. Costa, V.S., Rocha, R., Damas, L.: The YAP Prolog system. Theory Pract. Logic Programm. 12(1–2), 5–34 (2012). https://www.dcc.fc.up.pt/~ricroc/homepage/publications/2012-TPLP.pdf

  9. Leis, V., Kemper, A., Neumann, T.: The adaptive radix tree: ARTful indexing for main-memory databases. In: Proceedings of the 2013 IEEE International Conference on Data Engineering (ICDE 2013), pp. 38–49. IEEE Computer Society (1997). http://www3.informatik.tu-muenchen.de/~leis/papers/ART.pdf

  10. Leone, N., Pfeifer, G., Faber, W., Eiter, T., Gottlob, G., Perri, S., Scarcello, F.: The DLV system for knowledge representation and reasoning. ACM Trans. Comput. Logic 7(3), 499–562 (2006). https://arxiv.org/pdf/cs/0211004

    Article  MathSciNet  MATH  Google Scholar 

  11. Liang, S., Fodor, P., Wan, H., Kifer, M.: OpenRuleBench: an analysis of the performance of rule engines. In: Proceedings of the 18th International Conference on World Wide Web (WWW 2009), pp. 601–610. ACM (2009). http://rulebench.projects.semwebcentral.org/

  12. Liu, Y.A., Stoller, S.D.: From Datalog rules to efficient programs with time and space guarantees. In: Proceedings of the 5th ACM SIGPLAN International Conference on Principles and Practice of Declarative Programming (PPDP 2003), pp. 172–183. ACM (2003). http://www3.cs.stonybrook.edu/~liu/papers/Rules-PPDP03.pdf

  13. Neumann, T.: Efficiently compiling efficient query plans for modern hardware. Proc. VLDB Endow. 4(9), 539–550 (2011). http://www.vldb.org/pvldb/vol4/p539-neumann.pdf

    Article  Google Scholar 

  14. Ramakrishnan, R., Srivastava, D., Sudarshan, S., Seshadri, P.: The CORAL deductive system. VLDB J. 3, 161–210 (1994)

    Article  Google Scholar 

  15. Sagonas, K., Swift, T., Warren, D.S.: XSB as an efficient deductive database engine. In: Snodgrass, R.T., Winslett, M. (eds.) Proceedings of the 1994 ACM SIGMOD International Conference on Management of Data (SIGMOD 1994), pp. 442–453 (1994). http://user.it.uu.se/~kostis/Papers/xsbddb.html

  16. 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 (CC 2016), pp. 196–206. ACM (2016)

    Google Scholar 

  17. Schütz, H.: Tupelweise Bottom-up-Auswertung von Logikprogrammen (Tuple-wise bottom-up evaluation of logic programs). Ph.D. thesis, TU München (1993)

    Google Scholar 

  18. Smith, D.A., Utting, M.: Pseudo-naive evaluation. In: Australasian Database Conference, pp. 211–223 (1999). http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.177.5047

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Stefan Brass .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Springer International Publishing AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Brass, S., Stephan, H. (2018). Pipelined Bottom-Up Evaluation of Datalog Programs: The Push Method. In: Petrenko, A., Voronkov, A. (eds) Perspectives of System Informatics. PSI 2017. Lecture Notes in Computer Science(), vol 10742. Springer, Cham. https://doi.org/10.1007/978-3-319-74313-4_4

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-74313-4_4

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-74312-7

  • Online ISBN: 978-3-319-74313-4

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics