Skip to main content

Intuitionistic Logic Programming for SQL

  • Conference paper
  • First Online:
Logic-Based Program Synthesis and Transformation (LOPSTR 2016)

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

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.

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

References

  1. 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)

    Google Scholar 

  2. 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)

    Article  Google Scholar 

  3. 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)

    Google Scholar 

  4. Bonner, A.J.: Hypothetical datalog: complexity and expressibility. Theor. Comput. Sci. 76, 3–51 (1990)

    Article  MathSciNet  MATH  Google Scholar 

  5. 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)

    Google Scholar 

  6. 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)

    Google Scholar 

  7. 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

    Chapter  Google Scholar 

  8. Codd, E.: A relational model for large shared databanks. Commun. ACM 13(6), 377–390 (1970)

    Article  MATH  Google Scholar 

  9. 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)

    Google Scholar 

  10. 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)

    Article  MathSciNet  MATH  Google Scholar 

  11. Garcia-Molina, H., Ullman, J.D., Widom, J.: Database Systems: The Complete Book. Prentice Hall PTR, Upper Saddle River (2008)

    Google Scholar 

  12. 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)

    Google Scholar 

  13. Hodas, J., Miller, D.: Logic programming in a fragment of intuitionistic linear logic. Inf. Comput. 110(2), 327–365 (1994)

    Article  MathSciNet  MATH  Google Scholar 

  14. McCarty, L.T.: Clausal intuitionistic logic I - fixed-point semantics. J. Log. Program. 5(1), 1–31 (1988)

    Article  MathSciNet  MATH  Google Scholar 

  15. Miller, D.: A logical analysis of modules in logic programming. J. Log. Program. 6(1), 79–108 (1989)

    Article  MathSciNet  MATH  Google Scholar 

  16. 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

    Chapter  Google Scholar 

  17. 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

    Google Scholar 

  18. Sáenz-Pérez, F.: Towards bridging the expressiveness gap between relational and deductive databases. Electron. Commun. EASST 64, 1–22 (2014)

    MathSciNet  Google Scholar 

  19. Sáenz-Pérez, F.: Restricted predicates for hypothetical datalog. Electron. Proc. Theor. Comput. Sci. 200, 64–79 (2015)

    Article  Google Scholar 

  20. Sáenz-Pérez, F.: Datalog educational system (2016). http://des.sourceforge.net/

  21. Silberschatz, A., Korth, H., Sudarshan, S.: Database Systems Concepts, 6th edn. McGraw-Hill Inc., New York (2010)

    MATH  Google Scholar 

  22. Sterling, L., Shapiro, E.: The Art of Prolog: Advanced Programming Techniques. MIT Press, Cambridge (1986)

    MATH  Google Scholar 

  23. Ullman, J.D.: Database and Knowledge-Base Systems, vols. I (Classical Database Systems) and II (The New Technologies). Computer Science Press (1988)

    Google Scholar 

  24. Zaniolo, C., Ceri, S., Faloutsos, C., Snodgrass, R.T., Subrahmanian, V.S., Zicari, R.: Advanced Database Systems. Morgan Kaufmann, San Francisco (1997)

    MATH  Google Scholar 

Download references

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

Authors

Corresponding author

Correspondence to Fernando Sáenz-Pérez .

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics