Abstract
Intuitionistic logic programming provides the notion of embedded implication in rule bodies, which can be used to reason about a current database modified by the antecedent. This can be applied to a system that translates SQL to Datalog to solve SQL WITH queries, for which relations are locally defined and can therefore be understood as locally added to the current database. In addition, assumptions in SQL queries as either adding or removing data can be modelled in this way as well, which is an interesting feature for decision-support scenarios. This work suggests a way to apply intuitionistic logic programming to SQL, and provides a pointer to a working system implementing this idea.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
Aranda-López, G., Nieva, S., Sáenz-Pérez, F., Sánchez-Hernández, J.: Incorporating hypothetical views and extended recursion into SQL database systems. In: Mcmillan, K., Middeldorp, A., Sutcliffe, G., Voronkov, A. (eds.) International Conference on Logic for Programming, Artificial Intelligence and Reasoning (LPAR-19). EPiC Series in Computing, vol. 26, pp. 9–22. EasyChair (2014)
Atzeni, P., Jensen, C.S., Orsi, G., Ram, S., Tanca, L., Torlone, R.: The relational model is dead, SQL is dead, and i don’t feel so good myself. SIGMOD Rec. 42(2), 64–68 (2013)
Bonner, A.J., Datalog, H.: Negation and linear recursion. In: Proceedings of the ACM Symposium on Principles of Database Systems (PODS), pp. 286–300 (1989)
Bonner, A.J.: Hypothetical datalog: complexity and expressibility. Theor. Comput. Sci. 76, 3–51 (1990)
Bonner, A.J., McCarty, L.T.: Adding negation-as-failure to intuitionistic logic programming. In: Lusk, E.L., Overbeek, R.A. (eds.) Proceedings of the North American Conference on Logic Programming (NACLP), pp. 681–703. The MIT Press (1990)
Bonner, A.J., McCarty, L.T., Vadaparty, K.: Expressing database queries with intuitionistic logic. In: Lusk, E.L., Overbeek, R.A. (eds.) Proceedings of the North American Conference on Logic Programming (NACLP), pp. 831–850 (1989)
Caballero, R., García-Ruiz, Y., Sáenz-Pérez, F.: Declarative debugging of wrong and missing answers for SQL views. In: Schrijvers, T., Thiemann, P. (eds.) FLOPS 2012. LNCS, vol. 7294, pp. 73–87. Springer, Heidelberg (2012). doi:10.1007/978-3-642-29822-6_9
Codd, E.: A relational model for large shared databanks. Commun. ACM 13(6), 377–390 (1970)
Codd, E.: Relational completeness of data base sublanguages. In: Rustin, R. (ed.) Data Base Systems, Courant Computer Science Symposia Series, vol. 6. Prentice-Hall, Englewood Cliffs (1972)
Gabbay, D.M.: N-prolog: an extension of prolog with hypothetical implication II - logical foundations, and negation as failure. J. Log. Program. 2(4), 251–283 (1985)
Garcia-Molina, H., Ullman, J.D., Widom, J.: Database Systems: The Complete Book. Prentice Hall PTR, Upper Saddle River (2008)
Grefen, P.W., de By, R.A.: A multi-set extended relational algebra.: a formal approach to a practical issue. In: Proceedings of the Tenth International Conference on Data Engineering (ICDE), pp. 80–88. IEEE (1994)
Hodas, J., Miller, D.: Logic programming in a fragment of intuitionistic linear logic. Inf. Comput. 110(2), 327–365 (1994)
McCarty, L.T.: Clausal intuitionistic logic I - fixed-point semantics. J. Log. Program. 5(1), 1–31 (1988)
Miller, D.: A logical analysis of modules in logic programming. J. Log. Program. 6(1), 79–108 (1989)
Nieva, S., Sánchez-Hernández, J., Sáenz-Pérez, F.: Formalizing a constraint deductive database language based on hereditary Harrop formulas with negation. In: Garrigue, J., Hermenegildo, M.V. (eds.) FLOPS 2008. LNCS, vol. 4989, pp. 289–304. Springer, Heidelberg (2008). doi:10.1007/978-3-540-78969-7_21
Sáenz-Pérez, F.: Implementing tabled hypothetical datalog. In: Proceedings of the 25th IEEE International Conference on Tools with Artificial Intelligence (ICTAI), pp. 596–601, November 2013
Sáenz-Pérez, F.: Towards bridging the expressiveness gap between relational and deductive databases. Electron. Commun. EASST 64, 1–22 (2014)
Sáenz-Pérez, F.: Restricted predicates for hypothetical datalog. Electron. Proc. Theor. Comput. Sci. 200, 64–79 (2015)
Sáenz-Pérez, F.: Datalog educational system (2016). http://des.sourceforge.net/
Silberschatz, A., Korth, H., Sudarshan, S.: Database Systems Concepts, 6th edn. McGraw-Hill Inc., New York (2010)
Sterling, L., Shapiro, E.: The Art of Prolog: Advanced Programming Techniques. MIT Press, Cambridge (1986)
Ullman, J.D.: Database and Knowledge-Base Systems, vols. I (Classical Database Systems) and II (The New Technologies). Computer Science Press (1988)
Zaniolo, C., Ceri, S., Faloutsos, C., Snodgrass, R.T., Subrahmanian, V.S., Zicari, R.: Advanced Database Systems. Morgan Kaufmann, San Francisco (1997)
Acknowledgements
Thanks to the anonymous referees for their suggestions to improve this work, which has been partially supported by the Spanish MINECO project CAVI-ART (TIN2013-44742-C4-3-R), Madrid regional project N-GREENS Software-CM (S2013/ICE-2731) and UCM grant GR3/14-910502.
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
Sáenz-Pérez, F. (2017). Intuitionistic Logic Programming for SQL. In: Hermenegildo, M., Lopez-Garcia, P. (eds) Logic-Based Program Synthesis and Transformation. LOPSTR 2016. Lecture Notes in Computer Science(), vol 10184. Springer, Cham. https://doi.org/10.1007/978-3-319-63139-4_17
Download citation
DOI: https://doi.org/10.1007/978-3-319-63139-4_17
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-63138-7
Online ISBN: 978-3-319-63139-4
eBook Packages: Computer ScienceComputer Science (R0)