Abstract
This paper presents a memory model with nonoverlapping memory areas (regions) for the deductive verification of C programs. This memory model uses a core language that supports arbitrary nesting of structures, unions, and arrays into other structures and allows reducing the number of user-provided annotations as a result of region analysis. This paper also describes semantics of the core language and normalizing transformations for translating an input annotated C program into a program in the core language. In addition, an encoding is proposed for modeling the memory state of a core-language program with logical formulas as described by the model semantics of the core language. For the model semantics, the soundness and completeness theorems are proved. Additional constraints on the typing context of the core-language terms are described that determine the result of the region analysis enabling the complete modeling of a limited class of programs without using additional annotations. A proof sketch for the theorem stating completeness of the proposed region analysis for a limited class of programs is presented.
Similar content being viewed by others
References
Kroening, D. and Strichman, O., Decision Procedures: An Algorithmic Point of View, Springer, 2008.
Hoare, C.A.R., An axiomatic basis for computer programming, Commun. ACM, 1969, vol. 12, no. 10, pp. 576–580. doi 10.1145/363235.363259
Floyd, R.W., Assigning meaning to programs, Mathematical Aspects of Computer Science: Proc. American Mathematics Soc. Symposia, Schwartz, J.T., Ed., 1967, vol. 19, pp. 19–31.
Dijkstra, E.W., Guarded commands, non-determinacy, and formal derivation of programs, Commun. ACM, 1975, vol. 18, no. 8, pp. 453–457.
Reynolds, J.C., Separation logic: A logic for shared mutable data structures, Proc. 17th Annual IEEE Symp. on Logic in Computer Science (LICS), Washington, 2002, pp. 55–74. http://dl.acm.org/citation.cfm?id =645683.664578.
Piskac, R., Wies, T., and Zufferey, D., Automating separation logic using SMT, Computer Aided Verification, Sharygina, N. and Veith, H., Eds., Berlin: Springer, 2013, pp. 773–789. doi 10.1007/978-3-642-39799-8_54
Botincan, M., Parkinson, M., and Schulte, W., Separation logic verification of C programs with an SMT solver, Electron. Notes Theor. Comp. Sci., 2008. http://research.microsoft.com/apps/pubs/default.aspx?id= 77372.
Navarro, P.J.A. and Rybalchenko, A., Separation logic + superposition calculus = heap theorem prover, Proc. 32nd ACM SIGPLAN Conf. on Programming Language Design and Implementation (PLDI), New York, 2011, pp. 556–566. doi 10.1145/1993498.199356310.1145/1993498.1993563
Cuoq, P., Kirchner, F., Kosmatov, N., et al., Frama-C: A software analysis perspective, Proc. 10th Int. Conf. Software Engineering and Formal Methods (SEFM), Berlin: Springer, 2012, pp. 233–247. doi 10.1007/978-3-642-33826-7_1610.1007/978-3-642-33826-7_16
Moy, Y., Automatic modular static safety checking for C programs, Ph.D. thesis, Paris, 2009. http://www.lri.fr /~marche/moy09phd.pdf.
Cohen, E., Dahlweid, M., Hillebrand, M., et al., VCC: A practical system for verifying concurrent C, Proc. 22nd Int. Conf. Theorem Proving in Higher Order Logics (TPHOLs), Berlin: Springer, 2009, pp. 23–42. doi 10.1007/978-3-642-03359-9_210.1007/978-3-642-03359-9_2
Burstall, R.M., Some techniques for proving correctness of programs which alter data structures, Mach. Intell., 1972, vol. 7, nos. 23–50.
Bornat, R., Proving pointer programs in Hoare logic, Proc. 5th Int. Conf. Mathematics of Program Construction (MPC), London, 2000, pp. 102–126. http://dl.acm.org /citation.cfm?id=648085.747307.
Hubert, T. and Marche, C., Separation analysis for deductive verification, Proc. Heap Analysis and Verification (HAV), Braga, 2007, pp. 81–93. http://www.lri.fr /~marche/hubert07hav.pdf.
Milner, R., A theory of type polymorphism in programming, J. Comp. Syst. Sci., 1978, vol. 17, no. 3, pp. 348–375.
Moy, Y., Union and cast in deductive verification, Proc. C/C++ Verification Workshop, Nijmegen, 2007, pp. 1–16. http://www.lri.fr/~moy/Publis/moy07ccpp.pdf.
Mandrykin, M.U. and Khoroshilov, A.V., High-level memory model with low-level pointer cast support for Jessie intermediate language, Program. Comput. Software, 2015, vol. 41, no. 4, pp. 197–207.
Russian Linux Verification Center, Linux deductive verification. http://www.linuxtesting.ru/astraver.
Cohen, E., Moskal, M., Tobies, S., and Schulte, W., A precise yet efficient memory model for C, Electron. Notes Theor. Comput. Sci., 2009, vol. 254, pp. 85–103. doi 10.1016/j.entcs.2009.09.061
Pierce, B.C., Types and Programming Languages, MIT Press, 2002.
Dijkstra, E.W., A Discipline of Programming, Prentice Hall, 1976. https://books.google.ru/books?id=MsUmAAAAMAAJ.
Cohen, E., Moskal, M., Schulte, W., and Tobies, S., A practical verification methodology for concurrent programs. http://research.microsoft.com/apps/pubs/default.aspx?id=79554.
Author information
Authors and Affiliations
Corresponding author
Additional information
Original Russian Text © M.U. Mandrykin, A.V. Khoroshilov, 2016, published in Programmirovanie, 2016, Vol. 42, No. 5.
Rights and permissions
About this article
Cite this article
Mandrykin, M.U., Khoroshilov, A.V. Region analysis for deductive verification of C programs. Program Comput Soft 42, 257–278 (2016). https://doi.org/10.1134/S0361768816050042
Received:
Published:
Issue Date:
DOI: https://doi.org/10.1134/S0361768816050042