Abstract
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.
Similar content being viewed by others
Explore related subjects
Discover the latest articles, news and stories from top researchers in related subjects.References
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.
Floyd, R.W., Assigning Meanings to Programs, in Mathematical Aspects of Computer Science (Proc. of Symp. in Applied Mathematics), 1967, vol. 19, pp. 19–32.
Hoare, C.A.R. and Wirth, N., An Axiomatic Definition of the Programming Language PASCAL, Acta Informatica, 1973, no. 2, pp. 335–355.
Dijkstra, E.W., A Discipline of Programming, Englewood Cliffs (USA): Prentice-Hall, 1976. Translated under the title Distsiplina programmirovaniya, Moscow: Mir, 1978.
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.
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.
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.
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.
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.
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].
Author information
Authors and Affiliations
Corresponding author
Additional information
Original Russian Text © N.V. Shilov, I.S. Anureev, E.V. Bodin, 2008, published in Programmirovanie, 2008, Vol. 34, No. 6.
Rights and permissions
About this article
Cite this article
Shilov, N.V., Anureev, I.S. & Bodin, E.V. Generation of correctness conditions for imperative programs. Program Comput Soft 34, 307–321 (2008). https://doi.org/10.1134/S0361768808060029
Received:
Published:
Issue Date:
DOI: https://doi.org/10.1134/S0361768808060029