Maintaining Database Integrity with Refinement Types

Ioannis G. Baltopoulos, Johannes Borgström, Andrew D. Gordon

Research output: Chapter in Book/Report/Conference proceedingConference contribution

Abstract / Description of output

Taking advantage of recent advances in automated theorem proving, we present a new method for determining whether database transactions preserve integrity constraints. We consider check constraints and referential-integrity constraints—extracted from SQL table declarations—and application-level invariants expressed as formulas of first-order logic. Our motivation is to use static analysis of database transactions at development time, to catch bugs early, or during deployment, to allow only integrity-preserving stored procedures to be accepted. We work in the setting of a functional multi-tier language, where functional code is compiled to SQL that queries and updates a relational database. We use refinement types to track constraints on data and the underlying database. Our analysis uses a refinement-type checker, which relies on recent highly efficient SMT algorithms to check proof obligations. Our method is based on a list-processing semantics for an SQL fragment within the functional language, and is illustrated by a series of examples.
Original languageEnglish
Title of host publicationECOOP 2011 - Object-Oriented Programming
Subtitle of host publication 25th European Conference, Lancaster, UK, July 25-29, 2011 Proceedings
PublisherSpringer
Pages484-509
Number of pages26
Volume6813
ISBN (Electronic)978-3-642-22655-7
ISBN (Print)978-3-642-22654-0
DOIs
Publication statusPublished - 2011

Fingerprint

Dive into the research topics of 'Maintaining Database Integrity with Refinement Types'. Together they form a unique fingerprint.

Cite this