Synthesizing Iterators from Abstraction Functions
Name
Jackson_Synthesizing iterators.pdf
Size
324.28 KB
Format
Adobe PDF
Checksum (MD5)
7a508e59432114c643a8d6b737e20b71
Author(s) • • • • •
Rayside, Derek
Motaghami, Vajihollah
Leung, Francesca
Yuen, Albert
Xu, Kevin
Jackson, Daniel
Date Issued
September 2012
Journal
Proceedings of the 11th International Conference on Generative Programming and Component Engineering (GPCE '12)
Publisher
Association for Computing Machinery (ACM)
Citation
Derek Rayside, Vajihollah Montaghami, Francesca Leung, Albert Yuen, Kevin Xu, and Daniel Jackson. 2012. Synthesizing iterators from abstraction functions. In Proceedings of the 11th International Conference on Generative Programming and Component Engineering (GPCE '12). ACM, New York, NY, USA, 31-40.
Version
Author's final manuscript
Abstract
A technique for synthesizing iterators from declarative abstraction functions written in a relational logic specification language is described. The logic includes a transitive closure operator that makes it convenient for expressing reachability queries on linked data structures. Some optimizations, including tuple elimination, iterator flattening, and traversal state reduction, are used to improve performance of the generated iterators.
A case study demonstrates that most of the iterators in the widely used JDK Collections classes can be replaced with code synthesized from declarative abstraction functions. These synthesized iterators perform competitively with the hand-written originals.
In a user study the synthesized iterators always passed more test cases than the hand-written ones, were almost always as efficient, usually took less programmer effort, and were the qualitative preference of all participants who provided free-form comments.
MIT Department
Massachusetts Institute of Technology. Computer Science and Artificial Intelligence Laboratory
Massachusetts Institute of Technology. Department of Electrical Engineering and Computer Science
Terms of Use
Creative Commons Attribution-Noncommercial-Share Alike
Persistent DSpace Link
DOI of Published Version
https://doi.org/10.1145/2371401.2371407