×

A shape graph logic and a shape system. (English) Zbl 1296.68100

Summary: Analysis and verification of pointer programs are still difficult problems so far. This paper uses a shape graph logic and a shape system to solve these problems in two stages. First, shape graphs at every program point are constructed using an analysis tool. Then, they are used to support the verification of other properties (e.g., orderedness). Our prototype supports automatic verification of programs manipulating complex data structures such as splay trees, treaps, AVL trees and AA trees, etc. The proposed shape graph logic, as an extension to Hoare logic, uses shape graphs directly as assertions. It can be used in the analysis and verification of programs manipulating mutable data structures. The benefit using shape graphs as assertions is that it is convenient for acquiring the relations between pointers in the verification stage. The proposed shape system requires programmers to provide lightweight shape declarations in recursive structure type declarations. It can help rule out programs that construct shapes deviating from what programmers expect (reflected in shape declarations) in the analysis stage. As a benefit, programmers need not provide specifications (e.g., pre-/post-conditions, loop invariants) about pointers. Moreover, we present a method doing verification in the second stage using traditional Hoare logic rules directly by eliminating aliasing with the aid of shape graphs. Thus, verification conditions could be discharged by general theorem provers.

MSC:

68Q60 Specification and verification (program logics, model checking, etc.)
68N30 Mathematical aspects of software engineering (specification, verification, metrics, requirements, etc.)
68P05 Data structures
68T15 Theorem proving (deduction, resolution, etc.) (MSC2010)
PDF BibTeX XML Cite
Full Text: DOI

References:

[1] Paulson L C. Isabelle: A Generic Theorem Prover. Springer-Verlag Berlin, 1994. · Zbl 0825.68059
[2] Nanevski A, Morrisett G, Shinnar A, Govereau P, Birkedal L. Ynot: Dependent types for imperative programs. In Proc. the 13th ACM SIGPLAN Int. Conf. Functional Programming, September 2008, pp.229-240. · Zbl 1323.68142
[3] Barnett M, M. Leino K R, Schulte W. The spec# programming system: An overview. In Proc. Int. Conf. Construction and Analysis of Safe, Secure and Interoperable Smart Devices (CASSIS), March 2004, pp.49-69.
[4] Flanagan C, Rustan K, Lillibridge M et al. Extended static checking for Java. In Proc. the ACM SIGPLAN 2002 Conf. Programming Language Design and Implementation, June 2002, pp.234-245.
[5] Berdine J, Calcagno C, O’Hearn P W. Smallfoot: Modular automatic assertion checking with separation logic. In Proc. the 4th Int. Symp. Formal Methods for Components and Objects, Nov. 2005, pp.115-137.
[6] Distefano D, Parkinson M. jStar: Towards practical verification for Java. In Proc. the 23rd ACM SIGPLAN Int. Conf. Object-Oriented Programming, Systems, Languages, and Applications, Oct. 2008, pp.213-226.
[7] Li Z P, Zhang Y, Chen Y Y, Meng J C. Automated theorem proving for theory of shape graphs and its application in program verification. Technical Report, USTC-Yale Joint Research Center for High-Confidence Software, http://kyhcs.ustcsz.edu.cn/SGL, Nov. 2012.
[8] Chen Y Y, Li Z P, Wang Z F, Hua B J. A pointer logic for pointer program verification. Chinese Journal of Software, 2010, 21(3): 124–137. (Chinese, English Version at http://kyhcs.ustcsz.edu.cn/pli/pl.pdf) · Zbl 1224.68017
[9] Fradet P, Metayer D L. Shape types. In Proc. the ACM SIGPLAN-SIGACT Symp. Principles of Programming Languages, Jan. 1997, pp.27-39.
[10] de Moura L D, Bjørner N. Z3: An efficient SMT solver. In Proc. the 14th Int. Conf. Tools and Algorithms for the Construction and Analysis of Systems, Mar. 29-Apr. 6, 2008, pp.337-340.
[11] Lahiri S, Qadeer S. Verifying properties of well-founded linked lists. In Proc. the 33rd ACM SIGPLAN-SIGACT Symp. Principles of Programming Languages, Jan. 2006, pp.115-126. · Zbl 1369.68143
[12] Chin W N, David C, Nguyen H H, Qin S. Automated verification of shape, size and bag properties. In Proc. the 12th Int. Conf. Engineering of Complex Computer Systems, July 2007, pp.307-320.
[13] Lahiri S, Qadeer S. Back to the future: Revisiting precise program verification using SMT solvers. In Proc. the 35th ACM SIGPLAN-SIGACT Symp. Principles of Programming Languages, Jan. 2008, pp.171-182. · Zbl 1295.68087
[14] Bouajjani A, Dragoi C, Enea C, Sighireanu M. A logic-based framework for reasoning about composite data structures. In Proc. the 20th Int. Conf. Concurrency Theory, Sept. 2009, pp.178-195. · Zbl 1254.68146
[15] Madhusudan P, Parlato G, Qiu X K. Decidable logics combining heap structures and data. In Proc. the 38th ACM SIGPLAN-SIGACT Symp. Principles of Programming Languages, Jan. 2011, pp.611-622. · Zbl 1284.68411
[16] Reynolds J C. Separation logic: A logic for shared mutable data structures. In Proc. the 17th IEEE Symp. Logic in Computer Science, July 2002, pp.55-74.
[17] O’Hearn P W, Yang H, Reynolds J C. Separation and information hiding. In Proc. the 31st ACM SIGPLAN-SIGACT Symp. Principles of Programming Languages, Jan. 2004, pp.268-280. · Zbl 1325.68069
[18] Pérez J A N, Rybalchenko A. Separation logic + superposition calculus = Heap theorem prover. In Proc. ACM SIGPLAn Conf. Programming Language Design and Implementation, Jun. 2011, pp.556-566.
[19] Berdine J, Calcagno C, O’Hearn P W. A decidable fragment of separation logic. In Proc. the 24th Int. Conf. Foundations of Software Technology and Theoretical Computer Science, Dec. 2004, pp.97-109. · Zbl 1117.03337
[20] Sagiv M, Reps T, Wilhelm R. Solving shape-analysis problems in languages with destructive updating. ACM Transactions on Programming Languages and Systems, 1998, 20(1): 1–50. · Zbl 01935724
[21] 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. · Zbl 05459332
[22] Lee O, Yang H, Yi K. Automatic verification of pointer programs using grammar-based shape analysis. In Proc. the 19th European Conf. Programming Languages and Systems, Apr. 2005, pp.124-140. · Zbl 1108.68396
[23] Chang B E, Rival X, Necula G C. Shape analysis with structural invariant checkers. In Proc. the 14th Int. Static Analysis Symp., Aug. 2007, pp.384-401.
[24] Chang B E, Rival X. Relational inductive shape analysis. In Proc. the 35th ACM SIGPLAN-SIGACT Symp. Principles of Programming Languages, Jan. 2008, pp.247-260. · Zbl 1295.68081
[25] Laviron V, Chang B E, Rival X. Separating shape graphs. In Proc. the 19th European Conf. Programming Languages and Systems, Mar. 2010, pp.387-406. · Zbl 1260.68103
[26] Lev-Ami T, Reps T, Sagiv M, Wilhelm R. Putting static analysis to work for verification: A case study. In Proc. the Int. Symp. Software Testing and Analysis, Aug. 2000, pp.26-38.
[27] Clarke E M, Grumberg O, Jha S, Lu Y, Veith H. Counterexample-guided abstraction refinement. In Proc. the 12th Int. Conf. Computer Aided Verification, July 2000, pp.154-169. · Zbl 0974.68517
[28] Podelski A, Wies T. Counterexample-guided focus. In Proc. the 27th ACM SIGPLAN-SIGACT Symp. Principles of Programming Languages, Jan. 2010, pp.249-260. · Zbl 1312.68067
[29] Madhusudan P, Qiu X K, Stefanescu A. Recursive proofs for inductive tree data-structures. In Proc. the 39th ACM SIGPLAN-SIGACT Symp. Principles of Programming Languages, Jan. 2012, pp.123-135. · Zbl 1321.68226
[30] Calcagno C, Distefano D, O’Hearn P W, Yang H. Compositional shape analysis by means of bi-abduction. In Proc. the 36th ACM SIGPLAN-SIGACT Symp. Principles of Programming Languages, Jan. 2009, pp.289-300. · Zbl 1315.68085
This reference list is based on information provided by the publisher or from digital mathematics libraries. Its items are heuristically matched to zbMATH identifiers and may contain data conversion errors. It attempts to reflect the references listed in the original paper as accurately as possible without claiming the completeness or perfect precision of the matching.