Affiliation:
1. University of Waterloo
2. MIT CSAIL
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.
Publisher
Association for Computing Machinery (ACM)
Subject
Computer Graphics and Computer-Aided Design,Software
Reference44 articles.
1. An overview of JML tools and applications
2. Efficient specification-assisted error localization
3. A. Gesar H. Hussmann and A. Muck. A compiler for a class of conditional term rewriting systems. In Kaplan and Jouannaud {19}. A. Gesar H. Hussmann and A. Muck. A compiler for a class of conditional term rewriting systems. In Kaplan and Jouannaud {19}.
Cited by
1 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Compilation of dynamic sparse tensor algebra;Proceedings of the ACM on Programming Languages;2022-10-31