skip to main content
10.1145/1706299.1706329acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
research-article

Toward a verified relational database management system

Published: 17 January 2010 Publication History

Abstract

We report on our experience implementing a lightweight, fully verified relational database management system (RDBMS). The functional specification of RDBMS behavior, RDBMS implementation, and proof that the implementation meets the specification are all written and verified in Coq. Our contributions include: (1) a complete specification of the relational algebra in Coq; (2) an efficient realization of that model (B+ trees) implemented with the Ynot extension to Coq; and (3) a set of simple query optimizations proven to respect both semantics and run-time cost. In addition to describing the design and implementation of these artifacts, we highlight the challenges we encountered formalizing them, including the choice of representation for finite relations of typed tuples and the challenges of reasoning about data structures with complex sharing. Our experience shows that though many challenges remain, building fully-verified systems software in Coq is within reach.

References

[1]
Serge Abiteboul, Richard Hull, and Victor Vianu. Database Foundations. Addison-Wesley, 1995.
[2]
Yves Bertot and Pierre Castéran. Interactive Theorem Proving and Program Development. Coq'Art: The Calculus of Inductive Constructions. Texts in Theoretical Computer Science. Springer Verlag, 2004.
[3]
R. Bornat, C. Calcagno, and P. OHearn. Local Reasoning, Separation and Aliasing. Proc. SPACE, volume 4, 2004.
[4]
Stephen Brookes. A semantics for concurrent separation logic. Theor. Comput. Sci., 375(1--3):227--270, 2007.
[5]
Adam Chlipala, Gregory Malecha, Greg Morrisett, Avraham Shinnar, and Ryan Wisnesky. Effective interactive proofs for higher-order imperative programs. In Proc. ICFP, 2009.
[6]
C. J. Date. Introduction to Database Systems. Addison-Wesley Longman Publishing Co., Inc., 2002.
[7]
Ramez Elmasri and Shamkant B. Navathe. Fundamentals of Database Systems (5th Edition). Addison Wesley, 2006.
[8]
Parke Godfrey, Jarek Gryz, and Calisto Zuzarte. Exploiting constraint-like data characterizations in query optimization. In Proc. SIGMOD, 2001.
[9]
Carlos Gonzalia. Relations in Dependent Type Theory. PhD Thesis, Chalmers University of Technology, 2006.
[10]
Conor Mcbride. Elimination with a motive. In Proc. TYPES, 2000.
[11]
Conor McBride and James McKinna. The view from the left. J. Functional Programming, 14(1):69--111, 2004.
[12]
James Mckinna and Joel Wright. A type-correct, stack-safe, provably correct expression compiler in epigram. In J. Functional Programming, 2006.
[13]
Aleksandar Nanevski, Paul Govereau, and Greg Morrisett. Towards type-theoretic semantics for transactional concurrency. In Proc. TLDI, 2009.
[14]
Aleksandar Nanevski, Greg Morrisett, and Lars Birkedal. Polymorphism and separation in hoare type theory. In Proc. ICFP, 2006.
[15]
Aleksandar Nanevski, Greg Morrisett, Avraham Shinnar, Paul Govereau, and Lars Birkedal. Ynot: Dependent types for imperative programs. In Proc. ICFP, 2008.
[16]
Ulf Norell. Towards a Practical Programming Language Based on Dependent Type Theory. PhD thesis, Chalmers University of Technology, 2007.
[17]
Peter W. O'Hearn. Resources, concurrency, and local reasoning. Theor. Comput. Sci., 375(1--3):271--307, 2007.
[18]
Peter W. O'Hearn, John C. Reynolds, and Hongseok Yang. Local reasoning about programs that alter data structures. In Proc. CSL, 2001.
[19]
Nicolas Oury and Wouter Swierstra. The power of pi. Proc. ICFP, 2008.
[20]
Sharon E. Perl and Margo Seltzer. Data management for internet-scale single-sign-on. In Proc. WORLDS, 2006.
[21]
P. Rajagopalan and C. P. Tsang. A generic algebra for data collections based on constructive logic. In Algebraic Methodology and Software Technology, volume 936 of LNCS, pages 546--560. Springer Berlin / Heidelberg, 1995.
[22]
John C. Reynolds. Separation logic: A logic for shared mutable data structures. In Proc. LICS, 2002.
[23]
Alan Sexton and Hayo Thielecke. Reasoning about b+ trees with operational semantics and separation logic. Electron. Notes Theor. Comput. Sci., 218:355--369, 2008.
[24]
Alan Sexton and Hayo Thielecke. Reasoning about b+ trees with operational semantics and separation logic. Electron. Notes Theor. Comput. Sci., 218:355--369, 2008.
[25]
Carsten Sinz. System description: Ara - an automatic theorem prover for relation algebras. In Proc. CADE-17, 2000.
[26]
Matthieu Sozeau. Program-ing finger trees in coq. In Proc. ICFP, 2007.
[27]
Matthieu Sozeau and Nicolas Oury. First-class type classes. In Proc. TPHOLs, 2008.

Cited By

View all
  • (2025)Formal Verification of Just-in-Time CompilationundefinedOnline publication date: 28-Jan-2025
  • (2024)Validating Database System Isolation Level Implementations with Version Certificate RecoveryProceedings of the Nineteenth European Conference on Computer Systems10.1145/3627703.3650080(754-768)Online publication date: 22-Apr-2024
  • (2022)Translating canonical SQL to imperative code in CoqProceedings of the ACM on Programming Languages10.1145/35273276:OOPSLA1(1-27)Online publication date: 29-Apr-2022
  • Show More Cited By

Index Terms

  1. Toward a verified relational database management system

                        Recommendations

                        Comments

                        Information & Contributors

                        Information

                        Published In

                        cover image ACM Conferences
                        POPL '10: Proceedings of the 37th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages
                        January 2010
                        520 pages
                        ISBN:9781605584799
                        DOI:10.1145/1706299
                        • cover image ACM SIGPLAN Notices
                          ACM SIGPLAN Notices  Volume 45, Issue 1
                          POPL '10
                          January 2010
                          500 pages
                          ISSN:0362-1340
                          EISSN:1558-1160
                          DOI:10.1145/1707801
                          Issue’s Table of Contents
                        Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

                        Sponsors

                        In-Cooperation

                        Publisher

                        Association for Computing Machinery

                        New York, NY, United States

                        Publication History

                        Published: 17 January 2010

                        Permissions

                        Request permissions for this article.

                        Check for updates

                        Author Tags

                        1. b+ tree
                        2. dependent types
                        3. relational model
                        4. separation logic

                        Qualifiers

                        • Research-article

                        Conference

                        POPL '10
                        Sponsor:

                        Acceptance Rates

                        Overall Acceptance Rate 860 of 4,328 submissions, 20%

                        Upcoming Conference

                        POPL '26

                        Contributors

                        Other Metrics

                        Bibliometrics & Citations

                        Bibliometrics

                        Article Metrics

                        • Downloads (Last 12 months)66
                        • Downloads (Last 6 weeks)9
                        Reflects downloads up to 08 Mar 2025

                        Other Metrics

                        Citations

                        Cited By

                        View all
                        • (2025)Formal Verification of Just-in-Time CompilationundefinedOnline publication date: 28-Jan-2025
                        • (2024)Validating Database System Isolation Level Implementations with Version Certificate RecoveryProceedings of the Nineteenth European Conference on Computer Systems10.1145/3627703.3650080(754-768)Online publication date: 22-Apr-2024
                        • (2022)Translating canonical SQL to imperative code in CoqProceedings of the ACM on Programming Languages10.1145/35273276:OOPSLA1(1-27)Online publication date: 29-Apr-2022
                        • (2022)Resource Sharing for Verified High-Level Synthesis2022 IEEE 30th Annual International Symposium on Field-Programmable Custom Computing Machines (FCCM)10.1109/FCCM53951.2022.9786208(1-6)Online publication date: 15-May-2022
                        • (2022)A Verified Implementation of B$$^+$$-Trees in Isabelle/HOLTheoretical Aspects of Computing – ICTAC 202210.1007/978-3-031-17715-6_21(324-341)Online publication date: 3-Oct-2022
                        • (2021)A Coq formalization of data provenanceProceedings of the 10th ACM SIGPLAN International Conference on Certified Programs and Proofs10.1145/3437992.3439920(152-162)Online publication date: 17-Jan-2021
                        • (2020)Generating correctness proofs with neural networksProceedings of the 4th ACM SIGPLAN International Workshop on Machine Learning and Programming Languages10.1145/3394450.3397466(1-10)Online publication date: 15-Jun-2020
                        • (2020)Verifying concurrent search structure templatesProceedings of the 41st ACM SIGPLAN Conference on Programming Language Design and Implementation10.1145/3385412.3386029(181-196)Online publication date: 11-Jun-2020
                        • (2020)Verification supported refactoring of embedded sqlSoftware Quality Journal10.1007/s11219-020-09517-yOnline publication date: 18-Jun-2020
                        • (2020)Verified Textbook AlgorithmsAutomated Technology for Verification and Analysis10.1007/978-3-030-59152-6_2(25-53)Online publication date: 12-Oct-2020
                        • Show More Cited By

                        View Options

                        Login options

                        View options

                        PDF

                        View or Download as a PDF file.

                        PDF

                        eReader

                        View online with eReader.

                        eReader

                        Figures

                        Tables

                        Media

                        Share

                        Share

                        Share this Publication link

                        Share on social media