Affiliation:
1. CMU Silicon Valley
2. SRI International
3. CMU Silicon Valley / NASA Ames
Abstract
Writing specifications about program behavior is hard. Writing specifications about non-functional effects such as resource usage is often even harder. If manually instrumenting the program is not an option, programmers have to rely on comment-based specification languages like JML to introduce ghost variables and other fairly abstract concepts that are complicated and hard to maintain. Even worse, most static analysis tools nowadays operate on bit- or bytecode and cannot process those type of specifications
To address this problem, we propose a library-based specification formalism for time complexity in Java. The approach is inspired by the success of assertion libraries like CodeContracts and Guava. Our library provides a set of methods and enumerated types that allow the user to write complexity assertions in a 'human' readable form and without instrumenting the code. On the backend, we provide a bytecode rewriting tool that uses these assertions to automatically instrument the program with counter variables. The transformed program can then be checked via testing or off-the-shelf automated static analyzers
Publisher
Association for Computing Machinery (ACM)
Reference29 articles.
1. Verified resource guarantees using COSTA and KeY
2. P. Baudin P. Cuoq J.-C. Filliâtre C. Marché B. Monate Y. Moy and V. Prevosto. ACSL: ANSI/ISO C Specification Language ver. 1.5 2010. P. Baudin P. Cuoq J.-C. Filliâtre C. Marché B. Monate Y. Moy and V. Prevosto. ACSL: ANSI/ISO C Specification Language ver. 1.5 2010.
3. Linear Ranking with Reachability
4. Synthesis of Linear Ranking Functions