Fiat: Deductive Synthesis of Abstract Data Types in a Proof Assistant

We present Fiat, a library for the Coq proof assistant supporting refinement of declarative specifications into efficient functional programs with a high degree of automation. Each refinement process leaves a proof trail, checkable by the normal Coq kernel, justifying its soundness. We focus on the synthesis of abstract data types that package methods with private data. We demonstrate the utility of our framework by applying it to the synthesis of query structures -- abstract data types with SQL-like query and insert operations. Fiat includes a library for writing specifications of query structures in SQL-inspired notation, expressing operations over relations (tables) in terms of mathematical sets. This library includes a suite of tactics for automating the refinement of specifications into efficient, correct-by-construction OCaml code. Using these tactics, a programmer can generate such an implementation completely automatically by only specifying the equivalent of SQL indexes, data structures capturing useful views of the abstract data. Throughout we speculate on the new programming modularity possibilities enabled by an automated refinement system with proved-correct rules.

[1]  Stephen J. Westfold,et al.  Synthesis of Propositional Satisfiability Solvers , 2008 .

[2]  Dan Suciu,et al.  Comprehension syntax , 1994, SGMD.

[3]  Alexander Aiken,et al.  Data representation synthesis , 2011, PLDI '11.

[4]  Swarat Chaudhuri,et al.  Bridging boolean and quantitative synthesis using smoothed proof search , 2014, POPL.

[5]  Don S. Batory,et al.  Scalable software libraries , 1993, SIGSOFT '93.

[6]  C. A. R. Hoare,et al.  Data Refinement Refined , 1986, ESOP.

[7]  Stephen N. Zilles,et al.  Programming with abstract data types , 1974, SIGPLAN Symposium on Very High Level Languages.

[8]  Cyril Cohen,et al.  Refinements for Free! , 2013, CPP.

[9]  Fritz Henglein,et al.  Mechanical Translation of Set Theoretic Problem Specifications into Efficient RAM Code - A Case Study , 1985, European Conference on Computer Algebra.

[10]  Dusko Pavlovic,et al.  Formal Derivation of Concurrent Garbage Collectors , 2010, MPC.

[11]  Armando Solar-Lezama,et al.  Program synthesis by sketching , 2008 .

[12]  Rodney J. Douglas KIDS: A Semi-Automatic Program Development System , 1990 .

[13]  C. A. R. Hoare,et al.  Proof of correctness of data representations , 1972, Acta Informatica.

[14]  Rishabh Singh,et al.  Synthesizing data structure manipulations from storyboards , 2011, ESEC/FSE '11.

[15]  Philip Wadler,et al.  Comprehending monads , 1990, LISP and Functional Programming.

[16]  Allen Goldberg,et al.  DTRE - A Semi-Automatic Transformation System , 1991 .

[17]  Armando Solar-Lezama,et al.  Sketching concurrent data structures , 2008, PLDI '08.

[18]  Edsger W. Dijkstra,et al.  A constructive approach to the problem of program correctness , 1968 .

[19]  Robert Paige,et al.  Finite Differencing of Computable Expressions , 1982, TOPL.