Abstract
Deductive databases promise that an important part of the application program can be developed in a declarative language, seamlessly integrated with the query language. The author is currently developing a Datalog-to-C++ compiler that implements the “Push” method for bottom-up evaluation. While such a compiler is certainly not a typical database application, our goal is to write a significant portion of it in an extended Datalog language. In this paper, we propose some extensions of the Datalog language that are needed for our application: (1) templates for declarative output, (2) arrays/tuples as a restricted form of structured terms, (3) a way to assign integer levels based on orders (e.g. for computing stratifications). All is done in a way such that termination is guaranteed. Termination is also considered for arithmetic computations.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
Aref, M., ten Cate, B., Green, T.J., Kimelfeld, B., Olteanu, D., Pasalic, E., Veldhuizen, T.L., Washburn, G.: Design and implementation of the LogicBlox system. In: Proceedings of the 2015 ACM SIGMOD International Conference on Management of Data, pp. 1371–1382. ACM (2015). https://developer.logicblox.com/wp-content/uploads/2016/01/logicblox-sigmod15.pdf
Becket, R.: Mercury tutorial. Technical report, University of Melbourne, Department of Computer Science (2010). http://mercurylang.org/documentation/papers/book.pdf
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). doi:10.1007/978-3-642-32925-8_7. http://users.informatik.uni-halle.de/~brass/order/
Brass, S., Stephan, H.: Bottom-up evaluation of Datalog: preliminary report. In: Schwarz, S., Voigtländer, J. (eds.) Proceedings 29th and 30th Workshops on (Constraint) Logic Programming and 24th International Workshop on Functional and (Constraint) Logic Programming (WLP 2015/2016/WFLP 2016). Electronic Proceedings in Theoretical Computer Science, no. 234, pp. 13–26. Open Publishing Association (2017). https://arxiv.org/abs/1701.00623
Brass, S., Stephan, H.: Experiences with some benchmarks for deductive databases and implementations of bottom-up evaluation. In: Schwarz, S., Voigtländer, J. (eds.) Proceedings 29th and 30th Workshops on (Constraint) Logic Programming and 24th International Workshop on Functional and (Constraint) Logic Programming (WLP 2015/2016/WFLP 2016). Electronic Proceedings in Theoretical Computer Science, no. 234, pp. 57–72. Open Publishing Association (2017). https://arxiv.org/abs/1701.00627
Brass, S., Stephan, H.: Pipelined bottom-up evaluation of Datalog: The push method. In: Petrenko, A.K., Voronkov, A. (eds.) 11th A.P. Ershov Informatics Conference (PSI 2017) (2017). http://www.informatik.uni-halle.de/brass/push/publ/psi17.pdf
Cabeza, D., Hermenegildo, M.: Distributed WWW programming using (Ciao-) Prolog and the PiLLoW library. Theory Pract. Logic Programm. 1(3), 251–282 (2001). https://arxiv.org/abs/cs/0312031
Calì, A., Gottlob, G., Lukasiewicz, T.: A general Datalog-based framework for tractable query answering over ontologies. In: Proceedings of the 28th ACM SIGMOD-SIGACT-SIGART Symposium on Principles of Database Systems (PODS 2009), pp. 77–86. ACM (2009)
Gebser, M., Schaub, T., Thiele, S.: GrinGo: A new grounder for answer set programming. In: Baral, C., Brewka, G., Schlipf, J. (eds.) LPNMR 2007. LNCS (LNAI), vol. 4483, pp. 266–271. Springer, Heidelberg (2007). doi:10.1007/978-3-540-72200-7_24
Greco, S., Molinaro, C.: Datalog and Logic Databases. Morgan and Claypool Publishers, Burlington (2015)
Greco, S., Palopoli, L., Spadafora, E.: Datalog\(^A\): Array manipulations in a deductive database language. In: Ling, T.W., Masunaga, Y. (eds.) Proceedings of the Fourth International Conference on Database Systems for Advanced Applications (DASFAA 1995), pp. 180–188. World Scientific (1995). http://www.comp.nus.edu.sg/lingtw/dasfaa_proceedings/DASFAA95/P180.pdf
Hellerstein, J.M.: The declarative imperative. SIGMOD Rec. 39(1), 5–19 (2010). http://db.cs.berkeley.edu/papers/sigrec10-declimperative.pdf
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/
Meyerovich, L.: Topological sort in Datalog (2011). http://lmeyerov.blogspot.de/2011/04/topological-sort-in-datalog.html
Polleres, A.: How (well) do Datalog, SPARQL and RIF interplay? In: Barceló, P., Pichler, R. (eds.) Datalog 2.0 2012. LNCS, vol. 7494, pp. 27–30. Springer, Heidelberg (2012). doi:10.1007/978-3-642-32925-8_4
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)
Shkapsky, A., Yang, M., Interlandi, M., Chiu, H., Condie, T., Zaniolo, C.: Big data analytics with Datalog queries on Spark. In: Proceedings of the 2016 International Conference on Management of Data (SIGMOD 2016), pp. 1135–1149. ACM (2016). http://yellowstone.cs.ucla.edu/~yang/paper/sigmod2016-p958.pdf
Acknowledgements
I would like to thank Heike Stephan and Andreas Behrend for very valuable discussions.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2017 Springer International Publishing AG
About this paper
Cite this paper
Brass, S. (2017). Language Constructs for a Datalog Compiler. In: Benslimane, D., Damiani, E., Grosky, W., Hameurlain, A., Sheth, A., Wagner, R. (eds) Database and Expert Systems Applications. DEXA 2017. Lecture Notes in Computer Science(), vol 10438. Springer, Cham. https://doi.org/10.1007/978-3-319-64468-4_10
Download citation
DOI: https://doi.org/10.1007/978-3-319-64468-4_10
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-64467-7
Online ISBN: 978-3-319-64468-4
eBook Packages: Computer ScienceComputer Science (R0)