Generalized Typestate Checking for Data Structure Consistency

We present an analysis to verify abstract set specifications for programs that use object field values to determine the membership of objects in abstract sets. In our approach, each module may encapsulate several data structures and use membership in abstract sets to characterize how objects participate in its data structures. Each module's specification uses set algebra formulas to characterize the effects of its operations on the abstract sets. The program may define abstract set membership in a variety of ways; arbitrary analyses (potentially with multiple analyses applied to different modules in the same program) may verify the corresponding set specifications. The analysis we present in this paper verifies set specifications by constructing and verifying set algebra formulas whose validity implies the validity of the set specifications. We have implemented our analysis and annotated several programs (75-2500 lines of code) with set specifications. We found that our original analysis algorithm did not scale; this paper describes several optimizations that improve the scalability of our analysis. It also presents experimental data comparing the original and optimized versions of our analysis.

[1]  Reinhard Wilhelm,et al.  Parametric shape analysis via 3-valued logic , 2002, TOPL.

[2]  Andreas Podelski,et al.  Relative Completeness of Abstraction Refinement for Software Model Checking , 2002, TACAS.

[3]  Robert DeLine,et al.  Enforcing high-level protocols in low-level software , 2001, PLDI '01.

[4]  Robert DeLine,et al.  Adoption and focus: practical linear types for imperative programming , 2002, PLDI '02.

[5]  Nils Klarlund,et al.  MONA Implementation Secrets , 2000, Int. J. Found. Comput. Sci..

[6]  Martin Rinard,et al.  Combining Theorem proving with Static Analysis for Data Structure Consistency , 2004 .

[7]  Christopher G. Lasater,et al.  Design Patterns , 2008, Wiley Encyclopedia of Computer Science and Engineering.

[8]  Reinhard Wilhelm,et al.  Parametric shape analysis via 3-valued logic , 1999, POPL '99.

[9]  Robert E. Strom,et al.  Typestate: A programming language concept for enhancing software reliability , 1986, IEEE Transactions on Software Engineering.

[10]  Nicolas Halbwachs,et al.  Automatic discovery of linear restraints among variables of a program , 1978, POPL.

[11]  Thomas A. Henzinger,et al.  Abstractions from proofs , 2004, POPL.

[12]  Sophia Drossopoulou,et al.  Fickle : Dynamic Object Re-classification , 2001, ECOOP.

[13]  Michael I. Schwartzbach,et al.  The pointer assertion logic engine , 2000, PLDI '01.

[14]  Nils Klarlund,et al.  MONA Version 1.4 - User Manual , 2001 .

[15]  Bertrand Jeannet,et al.  A Relational Approach to Interprocedural Shape Analysis , 2004, SAS.

[16]  Cormac Flanagan,et al.  Avoiding exponential explosion: generating compact verification conditions , 2001, POPL '01.

[17]  Viktor Kuncak,et al.  Role analysis , 2002, POPL '02.

[18]  Patrick Cousot,et al.  Systematic design of program analysis frameworks , 1979, POPL.

[19]  Neil D. Jones,et al.  Program Flow Analysis: Theory and Application , 1981 .

[20]  Rudolf Eigenmann,et al.  Performance Analysis of Parallelizing Compilers on the Perfect Benchmarks Programs , 1992, IEEE Trans. Parallel Distributed Syst..

[21]  Viktor Kuncak,et al.  The First-Order Theory of Sets with Cardinality Constraints is Decidable , 2004, ArXiv.

[22]  Eran Yahav,et al.  Typestate Verification: Abstraction Techniques and Complexity Results , 2003, SAS.

[23]  Ralph Johnson,et al.  design patterns elements of reusable object oriented software , 2019 .

[24]  K. Rustan M. Leino,et al.  Heap Monotonic Typestate , 2003 .

[25]  K. Rustan M. Leino,et al.  Efficient weakest preconditions , 2005, Inf. Process. Lett..

[26]  Martin Rinard,et al.  On Our Experience with Modular Pluggable Analyses , 2004 .

[27]  Rajeev Alur,et al.  A Temporal Logic of Nested Calls and Returns , 2004, TACAS.

[28]  Dexter Kozen,et al.  Complexity of Boolean Algebras , 1980, Theor. Comput. Sci..

[29]  Eran Yahav,et al.  Typestate verification: Abstraction techniques and complexity results , 2005, Sci. Comput. Program..

[30]  K. Rustan M. Leino,et al.  Declaring and checking non-null types in an object-oriented language , 2003, OOPSLA.

[31]  Jørgen Lindskov Knudsen ECOOP 2001 — Object-Oriented Programming , 2001, Lecture Notes in Computer Science.

[32]  Leopold Löwenheim Über Möglichkeiten im Relativkalkül , 1915 .

[33]  Robert DeLine,et al.  Typestates for Objects , 2004, ECOOP.

[34]  K. Rustan M. Leino,et al.  Declaring and checking non-null types in an object-oriented language , 2003, OOPSLA 2003.