skip to main content
research-article
Open Access
Artifacts Available
Artifacts Evaluated & Functional

Prototyping a query compiler using Coq (experience report)

Published:29 August 2017Publication History
Skip Abstract Section

Abstract

Designing and prototyping new features is important in many industrial projects. Functional programming and formal verification tools can prove valuable for that purpose, but lead to challenges when integrating with existing product code or when planning technology transfer.

This article reports on our experience using the Coq proof assistant as a prototyping environment for building a query compiler intended for use in IBM's ODM Insights product. We discuss the pros and cons of using Coq for this purpose and describe our methodology for porting the compiler to Java, as required for product integration.

Skip Supplemental Material Section

Supplemental Material

References

  1. M. Arnold, D. Grove, B. Herta, M. Hind, M. Hirzel, A. Iyengar, L. Mandel, V. Saraswat, A. Shinnar, J. Siméon, M. Takeuchi, O. Tardieu, and W. Zhang. 2016. META: Middleware for Events, Transactions, and Analytics. IBM R&D 60, 2–3 (2016), 15:1–15:10.Google ScholarGoogle Scholar
  2. Joshua Auerbach, Martin Hirzel, Louis Mandel, Avi Shinnar, and Jérôme Siméon. 2017a. Handling Environments in a Verified Query Compiler. In SIGMOD.Google ScholarGoogle Scholar
  3. Joshua Auerbach, Martin Hirzel, Louis Mandel, Avi Shinnar, and Jérôme Siméon. 2017b. Prototyper un compilateur de requêtes avec Coq. In Vingt-septièmes Journées Francophones des Langages Applicatifs. Gourette, France.Google ScholarGoogle Scholar
  4. V. Benzaken, E. Contejean, and S. Dumbrava. 2014. A Coq Formalization of the Relational Data Model. In ESOP. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. M. Berler, R. Cattell, and D. Barry. 2000. The object data standard: ODMG 3.0. Morgan Kaufman.Google ScholarGoogle Scholar
  6. L. Burdy, Y Cheon, D. Cok, M. Ernst, J. Kiniry, G. Leavens, R. Leino, and E. Poll. 2005. An overview of JML tools and applications. STTT 7, 3 (2005). Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. J. Cheney and Ch. Urban. 2011. Mechanizing the Metatheory of mini-XQuery. In CPP. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. M. Cherniack and S. Zdonik. 1996. Rule Languages and Internal Algebras for Rule-Based Optimizers. In SIGMOD. http: //www.cs.brandeis.edu/~cokokola .Google ScholarGoogle Scholar
  9. X. Clerc. 2015. OCaml-Java. (2015). http://ocamljava.org .Google ScholarGoogle Scholar
  10. Cloudant 2015. Anatomy of the Cloudant DBaaS. (2015). https://cloudant.com/CloudantTechnicalOverview.pdf .Google ScholarGoogle Scholar
  11. S. Cluet and G. Moerkotte. 1993. Nested Queries in Object Bases. In DBPL.Google ScholarGoogle Scholar
  12. L. Fegaras and D. Maier. 2000. Optimizing object queries using an effective calculus. TODS 25, 4 (2000). Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. K. Fisher. 2014. Using formal methods to enable more secure vehicles: DARPA’s HACMS program. ACM SIGPLAN Notices 49, 9 (2014), 1–1. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Ch. Forgy. 1981. OPS5 user’s manual. Technical Report 2397. CMU.Google ScholarGoogle Scholar
  15. G. Gonthier, A. Asperti, J. Avigad, Y. Bertot, C. Cohen, F. Garillot, S. Le Roux, A. Mahboubi, R. O’Connor, S. O. Biha, et al. 2013. A machine-checked proof of the odd order theorem. In ITP. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. G. Graefe. 1993. Query evaluation techniques for large databases. CSUR 25, 2 (1993). Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. IBM. 2017. Operational Decision Manager. http://www.ibm.com/software/products/en/odm/ . (2017).Google ScholarGoogle Scholar
  18. J. S. Jorge, V. M. Gulías, and D. Cabrero. 2007. Certifying properties of programs using theorem provers. In Verification, Validation and Testing in Software Engineering. IGI Global, Chapter 10, 220–267. Google ScholarGoogle ScholarCross RefCross Ref
  19. G. Klein, K. Elphinstone, G. Heiser, J. Andronick, D. Cock, Ph. Derrin, D. Elkaduwe, K. Engelhardt, R. Kolanski, M. Norrish, et al. 2009. seL4: Formal verification of an OS kernel. In SOSP.Google ScholarGoogle Scholar
  20. Y. Klonatos, C. Koch, T. Rompf, and H. Chafi. 2014. Building Efficient Query Engines in a High-Level Language. (2014), 853–864.Google ScholarGoogle Scholar
  21. X. Leroy. 2012. Mechanized Semantics for Compiler Verification. In CPP.Google ScholarGoogle Scholar
  22. L. Libkin and L. Wong. 1994. Some properties of query languages for bags. In DBPL. Google ScholarGoogle ScholarCross RefCross Ref
  23. G. Malecha, G. Morrisett, A. Shinnar, and R. Wisnesky. 2010. Toward a verified relational database management system. In POPL. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. G. Malecha and R. Wisnesky. 2015. Using Dependent Types and Tactics to Enable Semantic Optimization of Languageintegrated Queries. In Proceedings of the 15th Symposium on Database Programming Languages (DBPL 2015). 49–58. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. C. Marché. 2015. The Krakatoa Verification Tool for Java programs. INRIA.Google ScholarGoogle Scholar
  26. The Coq development team. 2016. The Coq proof assistant reference manual. LogiCal Project. http://coq.inria.fr Version 8.5pl2.Google ScholarGoogle Scholar
  27. G. Moerkotte. 2014. Building Query Compilers. Univ. Mannheim. http://pi3.informatik.uni-mannheim.de/~moer/ querycompiler.pdfGoogle ScholarGoogle Scholar
  28. Martin Odersky, Lex Spoon, and Bill Venners. 2016. Programming in Scala: Updated for Scala 2.12 (3rd ed.). Artima Incorporation, USA.Google ScholarGoogle Scholar
  29. H. Pirahesh, J. M. Hellerstein, and W. Hasan. 1992. Extensible/Rule Based Query Rewrite Optimization in Starburst. In SIGMOD. 39–48.Google ScholarGoogle Scholar
  30. F. Pottier and Y. Régis-Giannas. 2016. Menhir Reference Manual. (2016).Google ScholarGoogle Scholar
  31. Avraham Shinnar and Jérôme Siméon. 2016. A Branding Strategy for Business Types. In A List of Successes That Can Change the World: Essays Dedicated to Philip Wadler on the Occasion of His 60th Birthday. Springer International Publishing, Cham, 367–387.Google ScholarGoogle Scholar
  32. A. Shinnar, J. Siméon, and M. Hirzel. 2015. A Pattern Calculus for Rule Languages: Expressiveness, Compilation, and Mechanization. In ECOOP.Google ScholarGoogle Scholar
  33. Matthieu Sozeau and Nicolas Oury. 2008. First-Class Type Classes. Springer Berlin Heidelberg, Berlin, Heidelberg, 278–293. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. V. Tannen, P. Buneman, and L. Wong. 1992. Naturally Embedded Query Languages. In ICDT.Google ScholarGoogle Scholar
  35. P. W. Trinder and P. L. Wadler. 1988. List Comprehensions and the Relational Calculus. In GalFp.Google ScholarGoogle Scholar
  36. J. Ullman and J. Widom. 2000. Database Systems: The Complete Book. Prentice Hall.Google ScholarGoogle Scholar
  37. J. Van den Bussche and S. Vansummeren. 2007. Polymorphic type inference for the named nested relational calculus. Transactions on Computational Logic (TOCL) 9, 1 (2007).Google ScholarGoogle Scholar
  38. M. Zaharia, M. Chowdhury, T. Das, A. Dave, J. Ma, M. Mccauley, M. Franklin, S. Shenker, and I. Stoica. 2012. Fast and interactive analytics over Hadoop data with Spark. USENIX Login 37, 4 (2012), 45–51.Google ScholarGoogle Scholar

Index Terms

  1. Prototyping a query compiler using Coq (experience report)

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in

      Full Access

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!