Skip to main content
Log in

Database query languages and functional logic programming

  • Regular Paper
  • Published:
New Generation Computing Aims and scope Submit manuscript

Abstract

Functional logic programming is a paradigm which integrates functional and logic programming. It is based on the use of rewriting rules for defining programs, and rewriting for goal solving. In this context, goals, usually, consist of equality (and, sometimes, inequality) constraints, which are solved in order to obtain answers, represented by means of substitutions. On the other hand, database programming languages involve a data model, a data definition language and, finally, a query language against the data defined according to the data model. To use functional logic programming as a database programming language, (1) we will propose a data model involving the main features adopted from functional logic programming (for instance, handling of partial and infinite data), (2) we will use conditional rewriting rules as data definition language, and finally, (3) we will deal with equality and inequality constraints as query language. Moreover, as most database systems, (4) we will propose an extended relational calculus and algebra, which can be used as alternative query languages in this framework. Finally, (5) we will prove that three alternative query languages are equivalent.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Abiteboul, S. and Beeri, C., “The Power of Languages for the Manipulation of Complex Values,”The VLDB Journal, 4, 4, pp. 727–794, 1995.

    Article  Google Scholar 

  2. Abiteboul, S., Hull, R. and Vianu, V.,Foundations of Databases, Addison-Wesley, 1995.

  3. Almendros-Jiménez, J.M. and Becerra-Terón, A., “A Framework for Goal-Directed Bottom-Up Evaluation of Functional Logic Programs, inProc. of International Symposium on Functional and Logic Programming, FLOPS, LNCS 2024, pp. 153–169. Springer, 2001.

  4. Almendros-Jiménez, J. M. and Becerra-Terón, A., “A Relational Algebra for Functional Logic Deductive Databases,”Procs. of Perspectives of System Informatics, PSI, LNCS 2890, pp. 494–508, Springer, 2003.

  5. Almendros-Jiménez, J.M. and Becerra-Terón, A., “A Safe Relational Calculus for Functional Logic Deductive Databases, Selected Papers of the International Workshop on functional and (Constraint) Logic Programming,”WFLP, Electronic Notes on Theoretical Computer Science, ENTCS,86,3, 2003.

  6. Almendros-Jiménez, J.M., Becerra-Terón, A. and Sánchez-Hernández, J., “A Computational Model for Functional Logic Deductive Databases,”Proc. of International Conference on Logic Programming, ICLP, LNCS 2237, PP. 331–347, Springer, 2001.

  7. Belussi, A., Bertino, E. and Catania, B., “An Extended Algebra for Constraint Databases,”IEEE Transactions on Knowledge and Data Engineering, TKDE,10,5, 1998.

  8. Benedikt, M. and Libkin, L., “Query Safety with Constraints (chapter),”Constraint Databases, pp. 109–129, Springer, 2000.

  9. Buneman, P., Naqvi, S.A., Tannen, V. and Wong, L., “Principles of Programming with Complex Objects and Collection Types,”Theoretical Computer Science, TCS, 149, 1, pp. 3–48, 1995.

    Article  MATH  MathSciNet  Google Scholar 

  10. Chimenti, D., Gamboa, R., Krishnamurthy, R., Naqvi, S.A., Tsur, S. and Zaniolo, C., “The LDL System Prototype,”IEEE Transactions on Knowledge and Data Engineering, TKDE, 2, 1, pp. 76–90, 1990.

    Article  Google Scholar 

  11. Codd, E.F., “A Relational Model of Data for Large Shared Data Banks,”Communications of the ACM, CACM, 13, 6, pp. 377–387, 1970.

    Article  MATH  Google Scholar 

  12. González-Moreno, J.C., Hortalá-González, M.T., López-Fraguas, F.J. and Rodríguez-Artalejo, M., “An Aproach to Declarative Programming Based on a Rewriting Logic,”Journal of Logic Programming JLP, 40, 1, pp. 47–87, 1999.

    Article  MATH  Google Scholar 

  13. Hanus, M., “The Integration of Functions into Logic Programming: From Theory to Practice,”Journal of Logic Programming, JLP, 19, 20, pp. 583–628, 1994.

    Article  MathSciNet  Google Scholar 

  14. Hanus, M., “Curry: An Integrated Functional Logic Language, Version 0.8,”Technical report, University of Kiel, Germany, 2003.

    Google Scholar 

  15. Hull, R. and Su, J., “Deductive Query Language for Recursively Typed Complex Objects,”Journal of Logic Programming, JLP, 35, 3, pp. 231–261, 1998.

    Article  MATH  MathSciNet  Google Scholar 

  16. Kanellakis, P. and Goldin, D., “Constraint Query Algebras,”Constraints, 1, 1–2, pp. 45–83, 1996.

    MathSciNet  Google Scholar 

  17. Kanellakis, P., Kuper, G. and Revesz, P., “Constraint Query Languages,”Journal of Computer and System Sciences, JCSS, 51, 1, pp. 26–52, 1995.

    Article  MathSciNet  Google Scholar 

  18. Kuper, G.M., Libkin, L. and Paredaens, J.,Constraint Databases, Springer, 2000.

  19. Libkin, L., “A Semantics-based Approach to Design of Query Languages for Partial Information,”Proc. of Semantics in Databases, LNCS, 1358, pp. 170–208, Springer, 1995.

    Article  Google Scholar 

  20. Liu, M., “Deductive Database Languages: Problems and Solutions,”ACM Computing Surveys, 31, 1, pp. 27–62, 1999.

    Article  Google Scholar 

  21. López-Fraguas, F.J. and Sánchez-Hernández, J., “TOY: A Multiparadigm Declarative System,”Procs. of Conference on Rewriting Techniques and Applications, RTA, LNCS 1631, pp. 244–247, Springer, 1999.

  22. López-Fraguas, F.J. and Sánchez-Hernández, J., “Proving Failure in Functional Logic Programs,”Proc. of the International Conference on Computational Logic, CL, LNCS 1861, pp. 179–193, Springer, 2000.

  23. López-Fraguas, F.J. and Sánchez-Hernández, J., “A Proof Theoretic Approach to Failure in Functional, Logic Programming,”Theory and Practice of Logic Programming, TPLP, 4, 1–2, pp. 41–74, 2004.

    Article  MATH  Google Scholar 

  24. Milner, R., Tofte, M. and Harper, R.,The Definition of Standard ML, MIT Press, 1990.

  25. Moreno-Navarro, J.J. and Rodríguez-Artalejo, M., “Logic Programming with Functions and Predicates: The Language BABEL,”Journal of Logic Programming, JLP, 12, 3, pp. 191–223, 1992.

    Article  MATH  Google Scholar 

  26. Paton, N., Cooper, R., Williams, H. and Trinder, P.,Database Programming Languages, C.A.R. Hoare Series, Prentice Hall, 1996.

  27. Poulovassilis, A., “FDL: An Integration of the Functional Data Model and the Functional Computation Model,”Proc. of the British National Conference on Databases, BNCOD, pp. 215–236, Cambridge University Press, 1988.

  28. Poulovassilis, A., “The Implementation of FDL, a Functional Database Language,”The Computer Journal 35, 2, pp. 119–128, 1992.

    Article  MATH  Google Scholar 

  29. Poulovassilis, A. and King, P., “Extending the Functional Data Model to Computational Completeness,”Proc. of International Conference on Extending Database Technology, EDBT, LNCS 416, pp. 75–91, 1990.

  30. Poulovassilis, A. and Small, C., “A Functional Programming Approach to Deductive Databases,”Proc. of Very Large Data Bases Conference, VLDB, pp. 491–500, Morgan Kaufmann, 1991.

  31. Ramakrishnan, R., Srivastava, D., Sudarshan, S. and Seshadri, P., “Implementation of the CORAL Deductive Database System,”Proc. of the ACM SIGMOD International Conference on Management of Data (Eds. Buneman, P. and Jajodia, S.), pp. 167–176, ACM Press, 1993.

  32. Revesz, P.Z., “Safe Datalog, Queries with Linear Constraints,”Proc. of International Conferente on Principles and Practice of Constraint Programming, CP, LNCS 1520, pp. 355–369, Springer, 1998.

  33. Revesz, P.Z., “Safe Query Languages for Constraint Databases,”ACM Transactions on Database Systems TODS, 23, 1, pp. 58–99, 1998.

    Article  Google Scholar 

  34. Rigaux, P., Scholl, M., Segoufin, L. and Grumbach, S., “Building a Constraint-based Spatial Database System: Model, Languages, and Implementation,”Information Systems, 28, 6, pp. 563–595, 2003.

    Article  MATH  Google Scholar 

  35. Shipman, D.W., “The Functional Data Model and the Data Language DAPLEX,”ACM Transactions on Database Systems, TODS, 6, 1, pp. 140–173, 1981.

    Article  Google Scholar 

  36. Shmueli, O., Tsur, S. and Zaniolo, C., “Compilation of Set Terms in the Logic Data Language (LDL),”Journal of Logic Programming, JLP, 12, 1–2, pp. 89–110, 1992.

    Article  MATH  MathSciNet  Google Scholar 

  37. Small, C. and Poulovassilis, A., “An Overview of PFL,”Proc. of International Workshop on Database Programming Languages, DBPL, pp. 96–110, Morgan Kaufmann, 1991.

  38. Trinder, P.W., “Comprehensions, A Query Notation for DBPL,”Proc. of International Workshop on Database Programming Languages, DBPL, pp. 55–68, Morgan Kaufman, 1991.

  39. Vaghani, J., Ramamohanarao, K., Kemp, D.B., Somogyi, Z., Stuckey, P.J., Leask, T.S. and Harland, J., “The Aditi Deductive Database System,”The VLDB Journal, 3, 2, pp. 245–288, 1994.

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Additional information

Jesús M. Almendros-Jiménez, Ph.D.: He received his M.S. and Ph.D. degrees from the Complutense University of Madrid, Spain, in 1992 and 1999, respectively. From 1992 to 1999 he was associate professor at the Complutense University of Madrid. From 1999, he is associate professor at the University of Almeria. His research interest has been on Functional-Logic Programming, Type Systems, Deductive Databases and Database Query Languages. He is currently working on Web Databases, especially Database Query Languages for XML, and Software Engineering, especially on UML.

Antonio Becerra-Terón, Ph.D.: He is associate professor at the University of Almeria. He received his B.S., M.S. and Ph.D. degrees from the University of Granada and Almeria, Spain, in 1991, 1993 and 2003, respectively. His research interest has been on Functional-Logic Programming, Deductive Databases and Database Query Languages. He is currently working on Web Databases, especially Database Query Languages for XML.

About this article

Cite this article

Almendros-Jiménez, J.M., Becerra-Terón, A. Database query languages and functional logic programming. New Gener Comput 24, 129–184 (2006). https://doi.org/10.1007/BF03037296

Download citation

  • Received:

  • Revised:

  • Issue Date:

  • DOI: https://doi.org/10.1007/BF03037296

Keywords

Navigation