Generation of correctness conditions for imperative programs
- 43 Downloads
Verification of imperative programs in the sense of Floyd-Hoare is an approach to proving correctness of programs annotated by preconditions, postconditions, and loop invariants. It is based on generation of correctness conditions. In the structured deterministic case, the problem of generation of correctness conditions seems trivial, since it is solved by a syntax-driven algorithm, the complexity of which linearly depends on the number of control constructs. Vice versa, in the unstructured nondeterministic case, it seems a priori clear that the complexity of generation of the correctness conditions exponentially depends on the number of statements in the program. In the paper, an efficient and complete algorithm for the generation of the correctness conditions is presented and justified. It can be used both in the structured deterministic and unstructured nondeterministic cases. The algorithm complexity linearly depends on the number of control constructs and/or program statements.
KeywordsControl Point Correctness Condition Assignment Statement Conditional Statement Predicate Symbol
Unable to display preview. Download preview PDF.
- 1.Hoare, C.A.R., The Verifying Compiler: A Grand Challenge for Computing Research, in Lecture Notes in Computer Science (Proc. of Conf. “Perspectives of System Informatics” (PSI 2003)), 2003, vol. 2890, pp. 103–111.Google Scholar
- 3.Hoare, C.A.R. and Wirth, N., An Axiomatic Definition of the Programming Language PASCAL, Acta Informatica, 1973, no. 2, pp. 335–355.Google Scholar
- 5.Flanagan, C. and Saxe, J.B., Avoiding Exponential Explosion: Generating Compact Verification Conditions, Proc. of the 28th ACM SIGPLAN-SIGACT Symp. on Principles of Programming Languages, 2001, pp. 193–205.Google Scholar
- 6.Barnett, M. and Leino, K.R.M., Weakest Precondition of Unstructured Programs, Proc. of Workshop on Program Analysis for Software Tools and Engineering (PASTE), 2005, pp. 82–87.Google Scholar
- 7.Bodin, E.V., Kalinina, N.A., and Shilov, N.V., Verifying Compiler F@BOOL@. Part I: General Description of the F@BOOL@ Project and Its Relation to Component Programming. Mini-NIL: Prototype of the Language of Virtual Machine of the F@BOOL@ Project, Preprint of Ershov Inst. of Information Systems, Siberian Division, Russ. Acad. Sci., Novosibirsk, 2005, no. 131.Google Scholar
- 8.Bodin, E.V., Kalinina, N.A., and Shilov, N.V., Verifying Compiler F@BOOL@. Part II: Logical Annotations in the Mini-NIL Language and Their Static and Dynamic Semantics, Preprint of Ershov Inst. of Information Systems, Siberian Division, Russ. Acad. Sci., Novosibirsk, 2006, no. 138.Google Scholar
- 9.Anureev, I.S., Bodin, E.V., and Shilov, N.V., Efficient Generation of Verification Conditions for Nondeterministic Unstructured Programs, Bulletin Novosibirsk Computing Center, 2007, vol. 26, pp. 39–63.Google Scholar
- 10.Nepomniaschy, V.A., Anureev, I.S., Dubranovskii, A.V., and Promsky, A.V., Towards Verification of C# Programs: A Three-Level Approach, Programmirovanie, 2006, no. 4, pp. 4–20 [Programming Comput. Software (Engl. Transl.), 2006, vol. 32, no. 4, pp. 190–202].Google Scholar