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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
Notes
- 1.
Available at http://users.informatik.uni-halle.de/~brass/sldmagic/.
References
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)
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
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
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
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
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/
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
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
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
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
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/
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
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
Ramakrishnan, R., Srivastava, D., Sudarshan, S., Seshadri, P.: The CORAL deductive system. VLDB J. 3, 161–210 (1994)
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
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)
Schütz, H.: Tupelweise Bottom-up-Auswertung von Logikprogrammen (Tuple-wise bottom-up evaluation of logic programs). Ph.D. thesis, TU München (1993)
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
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2018 Springer International Publishing AG
About this paper
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)