Abstract
Reasoning about pointer programs is difficult and challenging, while their safety is critical in software engineering. Storeless semantics pioneered by Jonkers provides a method to reason about pointer programs. However, the representation of memory states in Jonkers’ model is costly and redundant. This paper presents a new framework under a more efficient storeless model for automatically verifying properties of pointer programs related to the correct use of dynamically allocated memory such as absence of null dereferences, absence of dangling dereferences, absence of memory leaks, and preservation of structural invariants. The introduced logic-Pointer Logic, is developed to achieve such goals. To demonstrate that Pointer Logic is a useful storeless approach to verification, the Schorr-Waite tree-traversal algorithm which is always considered as a key test for pointer formalizations was verified via our analysis. Moreover, an experimental tool-plcc was implemented to automatically verify a number of non-trivial pointer programs.
Similar content being viewed by others
References
O’Hearn P, Reynolds J, Yang H. Local reasoning about programs that alter data structures. In: Proceedings of the 15th International Workshop on Computer Science Logic. London: Springer, 2001, 1–19
Reynolds J. Separation logic: a logic for shared mutable data structures. In: Proceedings of the 17th Annual IEEE Symposium on Logic in Computer Science. Washington: IEEE Computer Society, 2002, 55–74
Jonkers H B M. Abstract storage structures. In: de Bakker, van. Vllet, eds. Algorithmic Languages. 1981, 321–343
Deutsch A. A storeless model of aliasing and its abstractions using finite representations of right-regular equivalence relations. In: Proceedings of the 1992 International Conference on Computer Languages. California: IEEE Computer Society, 1992, 2–13
Venet A. Automatic analysis of pointer aliasing for untyped programs. Science of Computer Programming. 1999, 35(2):223–248
Bozga M, Iosif R, Laknech Y. Storeless semantics and alias logic. In: Proceedings of the 2003 ACM SIGPLAN workshop on Partial evaluation and semantics-based program manipulation. New York: ACM Press, 2003, 55–65
Rinetzky N, Bauer J, Reps T, et al. A semantics for procedure local heaps and its abstractions. In: Proceedings of the 32nd ACM SIGPLAN-SIGACT symposium on Principles of programming languages. New York: ACM Press, 2005, 296–309
Chen Y, Ge L, Hua B, et al. Design of a certifying compiler supporting proof of program safety. In: Proceedings of the 1st Joint IEEE/IFIP Symposium on Theoretical Aspects of Software Engineering. Washington: IEEE Computer Society, 2007, 117–126
Chen Y, Ge L, Hua B, et al. A pointer logic and certifying compiler. Frontiers of Computer Science in China. 2007, 1(3):297–312
Deutsch A. Interprocedural may-alias analysis for pointers: beyond k-limiting. In: Proceedings of the ACM SIGPLAN’94 Conference on Programing language Design and Implementation. New York: ACM Press, 1994, 230–241
Bornat R. Proving pointer programs in hoare logic. In: Proceedings of the 5th International Conference on Mathematics of Program Construction. London: Springer, 2000, 102–126
Topor R. The correctness of the Schorr-Waite list marking algorithm. Acta Informatica. 1979, 11: 211–221
Yang H. An example of local reasoning in BI pointer logic: the Schorr-Waite graph marking algorithm. In: Henglein F, Hughes J, Makholm H, et al. eds. SPACE 2001: Informal Proceedings of Workshop on Semantics, Program Analysis and Computing Environments for Memory Management. IT University of Copenhagen, 2001, 41–68
Mehta F, Nipkow T. Proving pointer programs in higherorder logic. Information and Computation. 2005, 199(1–2): 200–227
Hubert T, Marché C. A case study of C source code verification: the Schorr-Waite algorithm. In: Proceedings of the 3rd IEEE International Conference on Software Engineering and Formal Methods. Washington: IEEE Computer Society, 2005, 190–199
Nipkow T, Paulson L, Wenzel M. Isabelle/HOL: A proof assistant for higher-order logic. Computer Science. London: Springer, 2002, 259–278
Bornat R, Sufrin B. Animating formal proofs at the surface: the Jape proof calculator. The Computer Journal. 1999, 43: 177–192
Loginov A, Reps T, Sagiv M. Automated verification of the Deutsch-Schorr-Waite tree-traversal algorithm. In: Proceedings of the 13th International Static Analysis Symposium. London: Springer, 2006, 261–279
Cooper D C. Theorem proving in arithmetic without multiplication. In: Meltzer B, Michie D, eds, Machine Intelligence. 1972, 91–100
Hoare C A R. An axiomatic basis for computer programming. Communications of the ACM. 1969, 12(10): 576–583
Hoare C A R, He J. A trace model for pointers and objects. In: Proceedings of the 13th European Conference on Object-Oriented Programming. London: Springer-Verlag, 1999, 1–17
Lahiri S K, Qadeer S. Verifying properties of well-founded linked lists. In: Proceedings of the 33th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages. New York: ACM press, 2006, 115–126
Chatterjee S, Lahiri S K, Qadeer S, et al. A reachability predicate for analyzing low-level software. In: Proceedings of the 13th International Conference on Tools and Algorithms for the Construction and Analysis of Systems. London: Springer, 2007, 19–33
Lahiri S K, Qadeer S. Back to the future: revisiting precise program verification using SMT solvers. In: Proceedings of the 35th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages. New York: ACM press, 2008, 171–182
Møeller A, Schwartzbach M I. The pointer assertion logic engine. In: Proceedings of the ACM SIGPLAN 2001 conference on Programming language design and implementation. New York: ACM Press, 2001, 221–231
Sagiv M, Reps T, Wilhelm R. Parametric shape analysis via 3-valued logic. ACM Transactions on Programming Languages and Systems. 2002, 24(3): 217–298
Walker D, Morrisett G. Alias types for recursive data structures. In: Selected papers from the 3rd International Workshop on Types in Compilation. London: Springer-Verlag, 2001, 177–206
Xi H. Applied type system (extended abstract). In: the postworkshop proceedings of TYPES 2003. Berlin: Springer, 2004, 394–408
Chen C, Xi H. Combining programming with theorem proving. In: Proceedings of the 10thACM SIGPLAN international conference on Functional programming. New York: ACM press, 2005, 66–77
Berdine J, Calcagno C, O’Hearn P W. Smallfoot: modular automatic assertion checking with separation logic. In: Proceedings of the 4th International Symposium on Formal Methods for Components and Objects. London: Springer, 2005, 115–137
Ireland A. Towards Automatic Assertion Refinement for Separation Logic. In: Proceedings of the 21st IEEE/ACM International Conference on Automated Software Engineering. Washington: IEEE Computer Society, 2006, 309–312
Nguyen H H, David C, Qin S, et al. Automated verification of shape and size properties via separation logic. In: Proceedings of eighth International Conference on Verification, Model Checking and Abstract Interpretation. Berlin: Springer, 2007, 251–266
Berdine J, Calcagno C, O’Hearn P W. Symbolic execution with separation logic. In: Proceedings of the 3rd Asian Symposium on Programming Languages and Systems. London: Springer-Verlag, 2005, 52–68
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Wang, Z., Chen, Y., Wang, Z. et al. Automated verification of pointer programs in pointer logic. Front. Comput. Sci. China 2, 380–397 (2008). https://doi.org/10.1007/s11704-008-0033-8
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s11704-008-0033-8