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.
Supplemental Material
Available for Download
This artifact is accompanying the ICFP 2017 paper entitled Prototyping a Query Compiler Using Coq. It is distributed as a virtual appliance using the Open Virtualization Format. It is a Linux image containing: - the paper: `~/icfp17.pdf` - the source code of the Q*cert query compiler in Coq: `~/qcert` - some examples: `~/samples` - the executable binary of the compiler: `qcert` - the dependencies needed to rebuild the compiler (Coq, OCaml, ...). Log in to the machine: - username: `qcert` - password: `querycert`
- 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 Scholar
- 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 Scholar
- 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 Scholar
- V. Benzaken, E. Contejean, and S. Dumbrava. 2014. A Coq Formalization of the Relational Data Model. In ESOP. Google Scholar
Digital Library
- M. Berler, R. Cattell, and D. Barry. 2000. The object data standard: ODMG 3.0. Morgan Kaufman.Google Scholar
- 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 Scholar
Digital Library
- J. Cheney and Ch. Urban. 2011. Mechanizing the Metatheory of mini-XQuery. In CPP. Google Scholar
Digital Library
- M. Cherniack and S. Zdonik. 1996. Rule Languages and Internal Algebras for Rule-Based Optimizers. In SIGMOD. http: //www.cs.brandeis.edu/~cokokola .Google Scholar
- X. Clerc. 2015. OCaml-Java. (2015). http://ocamljava.org .Google Scholar
- Cloudant 2015. Anatomy of the Cloudant DBaaS. (2015). https://cloudant.com/CloudantTechnicalOverview.pdf .Google Scholar
- S. Cluet and G. Moerkotte. 1993. Nested Queries in Object Bases. In DBPL.Google Scholar
- L. Fegaras and D. Maier. 2000. Optimizing object queries using an effective calculus. TODS 25, 4 (2000). Google Scholar
Digital Library
- K. Fisher. 2014. Using formal methods to enable more secure vehicles: DARPA’s HACMS program. ACM SIGPLAN Notices 49, 9 (2014), 1–1. Google Scholar
Digital Library
- Ch. Forgy. 1981. OPS5 user’s manual. Technical Report 2397. CMU.Google Scholar
- 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 Scholar
Digital Library
- G. Graefe. 1993. Query evaluation techniques for large databases. CSUR 25, 2 (1993). Google Scholar
Digital Library
- IBM. 2017. Operational Decision Manager. http://www.ibm.com/software/products/en/odm/ . (2017).Google Scholar
- 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 Scholar
Cross Ref
- 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 Scholar
- Y. Klonatos, C. Koch, T. Rompf, and H. Chafi. 2014. Building Efficient Query Engines in a High-Level Language. (2014), 853–864.Google Scholar
- X. Leroy. 2012. Mechanized Semantics for Compiler Verification. In CPP.Google Scholar
- L. Libkin and L. Wong. 1994. Some properties of query languages for bags. In DBPL. Google Scholar
Cross Ref
- G. Malecha, G. Morrisett, A. Shinnar, and R. Wisnesky. 2010. Toward a verified relational database management system. In POPL. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- C. Marché. 2015. The Krakatoa Verification Tool for Java programs. INRIA.Google Scholar
- The Coq development team. 2016. The Coq proof assistant reference manual. LogiCal Project. http://coq.inria.fr Version 8.5pl2.Google Scholar
- G. Moerkotte. 2014. Building Query Compilers. Univ. Mannheim. http://pi3.informatik.uni-mannheim.de/~moer/ querycompiler.pdfGoogle Scholar
- Martin Odersky, Lex Spoon, and Bill Venners. 2016. Programming in Scala: Updated for Scala 2.12 (3rd ed.). Artima Incorporation, USA.Google Scholar
- H. Pirahesh, J. M. Hellerstein, and W. Hasan. 1992. Extensible/Rule Based Query Rewrite Optimization in Starburst. In SIGMOD. 39–48.Google Scholar
- F. Pottier and Y. Régis-Giannas. 2016. Menhir Reference Manual. (2016).Google Scholar
- 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 Scholar
- A. Shinnar, J. Siméon, and M. Hirzel. 2015. A Pattern Calculus for Rule Languages: Expressiveness, Compilation, and Mechanization. In ECOOP.Google Scholar
- Matthieu Sozeau and Nicolas Oury. 2008. First-Class Type Classes. Springer Berlin Heidelberg, Berlin, Heidelberg, 278–293. Google Scholar
Digital Library
- V. Tannen, P. Buneman, and L. Wong. 1992. Naturally Embedded Query Languages. In ICDT.Google Scholar
- P. W. Trinder and P. L. Wadler. 1988. List Comprehensions and the Relational Calculus. In GalFp.Google Scholar
- J. Ullman and J. Widom. 2000. Database Systems: The Complete Book. Prentice Hall.Google Scholar
- 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 Scholar
- 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 Scholar
Index Terms
Prototyping a query compiler using Coq (experience report)
Recommendations
xmonad in Coq (experience report): programming a window manager in a proof assistant
Haskell '12: Proceedings of the 2012 Haskell SymposiumThis report documents the insights gained from implementing the core functionality of xmonad, a popular window manager written in Haskell, in the Coq proof assistant. Rather than focus on verification, this report outlines the technical challenges ...
xmonad in Coq (experience report): programming a window manager in a proof assistant
Haskell '12This report documents the insights gained from implementing the core functionality of xmonad, a popular window manager written in Haskell, in the Coq proof assistant. Rather than focus on verification, this report outlines the technical challenges ...
The Reflective Milawa Theorem Prover is Sound (Down to the Machine Code that Runs it)
This paper presents, we believe, the most comprehensive evidence of a theorem prover's soundness to date. Our subject is the Milawa theorem prover. We present evidence of its soundness down to the machine code. Milawa is a theorem prover styled after ...






Comments