Skip to main content
Log in

Towards verification of C# programs: A three-level approach

  • Published:
Programming and Computer Software Aims and scope Submit manuscript

Abstract

In the paper, a new three-level approach to the verification of sequential object-oriented programs is presented. It is applied to an expressive subset C#-light of the C# language, which includes all basic sequential constructs of the latter. At the first stage, the C#-light language is translated into the intermediate C#-kernel language. At the second stage, lazy correctness conditions are generated by means of the axiomatic semantics developed for C#-kernel. These conditions are lazy because they may include special functional symbols representing postponed extraction of invariants of labeled statements, as well as postponed invocations of methods and delegates. At the third stage, these conditions are refined with the use of operational semantics algorithms. Such an approach simplifies the axiomatic semantics and makes it possible to uniquely derive correctness conditions. An example of verification of a C#-light program is presented.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Institutional subscriptions

Similar content being viewed by others

References

  1. Börger, E., Fruja, N.G., Gervasi, V., and Stärk, R., A High-Level Modular Definition of Semantics of C#, Theoretical Comput. Sci., 2004, no. 336 (2/3).

  2. von Oheimb, D., Hoare Logic for Java in Isabelle/HOL, Concurrency Computation, 2001, vol. 13.

  3. von Oheimb, D. and Nipkow, T., Hoare Logic for Nano-Java: Auxiliary Variables, Side Effects, and Virtual Methods Revisited, Lecture Notes in Computer Science (Proc. of FME 2002), 2002, vol. 2391, pp. 89–105.

    Google Scholar 

  4. Poetzsch-Heffter, A. and Muller, P., A Programming Logic for Sequential Java, Lecture Notes in Computer Science (Proc. ESOP’99), 1999, vol. 1576, pp. 162–176.

    Article  Google Scholar 

  5. Reus, B., Wirsing, M., and Hennicker, R., A Hoare Calculus for Verifying Java Realizations of OCL-constrained Design Models, Lecture Notes in Computer Science (Proc. FASE 2001), 2001, vol. 2029, pp. 300–317.

    Google Scholar 

  6. Apt, K.R. and Olderog, E.R., Verification of Sequential and Concurrent Programs, Springer, 1991.

  7. Pierik, C. and de Boer, F.S., A Syntax-Directed Hoare Logic for Object-oriented Programming Concepts, Lecture Notes in Computer Science, 2003, vol. 2884, pp. 64–78.

    Google Scholar 

  8. C# Language Specification. Standard ECMA-334, 2001. http://www.ecma-international.org/.

  9. Dubranovskii, I.V., Verification of C# Programs: Translation from the C#-light Language to the C#-kernel Language, Preprint of ISI SO RAN, Novosibirsk, 2004, no. 120.

  10. Jacobs, B., Kiniry, J.L., and Warnier, M., Java Program Verification Challenges, Lecture Notes in Computer Science (Proc. FMCO 2002), 2003, vol. 2852, pp. 202–219.

    Article  Google Scholar 

  11. Nepomniaschy, V.A., Anureev, I.S., and Promsky, A.V., Verification-Oriented Language C-light and its Structural Operational Semantics, Lecture Notes in Computer Science (Proc. PSI 2003), 2003, vol. 2890, pp. 103–111.

    Google Scholar 

  12. Nepomniaschy, V.A., Anureev, I.S., Mikhailov, I.N., and Promsky, A.V., Towards Verification of C Programs: C-Light Language and Its Formal Semantics, Programmirovanie, 2002, no. 6, pp. 19–30 [Programming Comput. Software (Engl. Transl.), 2002, vol. 28, no. 6, pp. 314–323].

  13. Nepomniaschy, V.A., Anureev, I.S., and Promsky, A.V., Towards Verification of C Programs: Axiomatic Semantics of the C-kernel Language, Programmirovanie, 2003, no. 6, pp. 65–80 [Programming Comput. Software (Engl. Transl.), 2003, vol. 29, no. 6, pp. 338–350].

  14. Müller, P., Modular Specification and Verification of Object-Oriented Programs, Lecture Notes in Computer Science, 2002, vol. 2262.

  15. Leino, K.R.M., Extended Static Checking: A Ten-Year Perspective, Lecture Notes in Computer Science, 2001, vol. 2000, pp. 157–175.

    Article  MathSciNet  Google Scholar 

  16. Huisman, M. and Jacobs, B., Java Program Verification via a Hoare Logic with Abrupt Termination, Lecture Notes in Computer Science (Proc. FASE 2000), 2000, vol. 1783, pp. 284–303.

    Google Scholar 

  17. Huisman, M. and Jacobs, B., Inheritance in Higher Order Logic: Modeling and Reasoning, Lecture Notes in Computer Science (Proc. TPHOLs 2000), 2000, vol. 1869, pp. 301–319.

    Google Scholar 

  18. Jacobs, B. and Poll, E., Java Program Verification at Nijmegen: Development and Perspective, Lecture Notes in Computer Science, 2004, vol. 3233, pp. 134–153.

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Additional information

Original Russian Text © V.A. Nepomniaschy, I.S. Anureev, I.V. Dubranovskii, A.V. Promsky, 2006, published in Programmirovanie, 2006, Vol. 32, No. 4.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Nepomniaschy, V.A., Anureev, I.S., Dubranovskii, I.V. et al. Towards verification of C# programs: A three-level approach. Program Comput Soft 32, 190–202 (2006). https://doi.org/10.1134/S0361768806040025

Download citation

  • Received:

  • Issue Date:

  • DOI: https://doi.org/10.1134/S0361768806040025

Keywords

Navigation