Abstract
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.
Supplemental Material
- Don Batory, Vivek Singhal, Marty Sirkin, and Jeff Thomas. Scalable software libraries. In Proceedings of the 1st ACM SIGSOFT Symposium on Foundations of Software Engineering. ACM, 1993. Google Scholar
Digital Library
- Lee Blaine and Allen Goldberg. DTRE -- a semi-automatic transformation system. In Constructing Programs from Specifications, pages 165--204. Elsevier, 1991.Google Scholar
- Peter Buneman, Leonid Libkin, Dan Suciu, Val Tannen, and Limsoon Wong. Comprehension syntax. SIGMOD Rec., 23(1), March 1994. Google Scholar
Digital Library
- Swarat Chaudhuri, Martin Clochard, and Armando Solar-Lezama. Bridging boolean and quantitative synthesis using smoothed proof search. In Proceedings of the 41st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. ACM, 2014. Google Scholar
Digital Library
- Cyril Cohen, Maxime Dénès, and Anders Mörtberg. Refinements for free! In Certified Programs and Proofs. Springer International Publishing, 2013. Google Scholar
Digital Library
- http://coq.inria.fr/distrib/current/refman/Reference-Manual029.html.Google Scholar
- Edsger W. Dijkstra. A constructive approach to the problem of program correctness. Circulated privately, August 1967.Google Scholar
- Peter Hawkins, Alex Aiken, Kathleen Fisher, Martin Rinard, and Mooly Sagiv. Data representation synthesis. In Proceedings of the 32nd ACM SIGPLAN Conference on Programming Language Design and Implementation. ACM, 2011. Google Scholar
Digital Library
- J. He, C.A.R. Hoare, and J.W. Sanders. Data refinement refined. In Bernard Robinet and Reinhard Wilhelm, editors, ESOP 86, volume 213 of Lecture Notes in Computer Science, pages 187--196. Springer Berlin Heidelberg, 1986. Google Scholar
Digital Library
- C.A.R. Hoare. Proof of correctness of data representations. Acta Informatica, 1(4):271--281, 1972. Google Scholar
Digital Library
- Barbara Liskov and Stephen Zilles. Programming with abstract data types. In Symposium on Very High Level Languages, New York, NY, USA, 1974. ACM. Google Scholar
Digital Library
- Robert Paige and Fritz Henglein. Mechanical translation of set theoretic problem specifications into efficient RAM code -- a case study. J. Symb. Comput., 4(2):207--232, October 1987. Google Scholar
Digital Library
- Robert Paige and Shaye Koenig. Finite differencing of computable expressions. ACM Trans. Program. Lang. Syst., 4(3), July 1982. Google Scholar
Digital Library
- Dusko Pavlovic, Peter Pepper, and Douglas R. Smith. Formal derivation of concurrent garbage collectors. In Mathematics of Program Construction, pages 353--376. Springer Berlin Heidelberg, 2010. Google Scholar
Digital Library
- Rishabh Singh and Armando Solar-Lezama. Synthesizing data structure manipulations from storyboards. In Proceedings of the 19th ACM SIGSOFT Symposium and the 13th European Conference on Foundations of Software Engineering. ACM, 2011. Google Scholar
Digital Library
- Douglas R. Smith. KIDS: A semi-automatic program development system. In Client Resources on the Internet, IEEE Multimedia Systems'99, pages 302--307, 1990.Google Scholar
- Douglas R. Smith and Stephen J. Westfold. Synthesis of propositional satisfiability solvers, 2008.Google Scholar
- Armando Solar-Lezama. Program Synthesis by Sketching. PhD thesis, University of California, Berkeley, 2008. Google Scholar
Digital Library
- Armando Solar-Lezama, Christopher Grant Jones, and Rastislav Bodik. Sketching concurrent data structures. In Proceedings of the 2008 ACM SIGPLAN Conference on Programming Language Design and Implementation. ACM, 2008. Google Scholar
Digital Library
- http://www.kestrel.edu/home/prototypes/specware.html.Google Scholar
- Philip Wadler. Comprehending monads. In Mathematical Structures in Computer Science, pages 61--78, 1992. Google Scholar
Digital Library
Index Terms
(auto-classified)Fiat: Deductive Synthesis of Abstract Data Types in a Proof Assistant
Recommendations
A Deductive Approach to Program Synthesis
Program synthesis is the systematic derivation of a program from a given specification. A deductive approach to program synthesis is presented for the construction of recursive programs. This approach regards program synthesis as a theorem-proving task ...
Fiat: Deductive Synthesis of Abstract Data Types in a Proof Assistant
POPL '15: Proceedings of the 42nd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming LanguagesWe 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 ...
Reconciling enumerative and deductive program synthesis
PLDI 2020: Proceedings of the 41st ACM SIGPLAN Conference on Programming Language Design and ImplementationSyntax-guided synthesis (SyGuS) aims to find a program satisfying semantic specification as well as user-provided structural hypotheses. There are two main synthesis approaches: enumerative synthesis, which repeatedly enumerates possible candidate ...







Comments