Abstract
Program verification consists in finding a formal proof that the program satisfies a given specification. This specification can be described as assertions about the input and output a correct program must satisfy. Assertions and programs are traditionally specified in terms of classical first order logic (FOL). FOL reasoners (inference systems) automatically find the correspondent program correctness proof, if any. However, verification of programs with mutable data structures, such as pointers, is currently a major challenge for the FOL assertion based approach. Mutable data structures are often written in terms of syntactically unrelated expressions, whose specification represents a significant defiance for FOL. Separation logics are a family of formal languages with specially-purposed constructors designed to model mutable data structures. In this paper, we formally verify a database management system using separation logics. We focused on the verification of libraries containing programs about heap manipulation. Several detected bugs are described in detail, respective solutions are also provided.
Similar content being viewed by others
REFERENCES
Jetley, R.P., Jones, P.L., and Anderson, P., Static analysis of medical device software using CodeSonar, in Proc. Workshop on Static Analysis, Ser. SAW’08, New York: Association for Computing Machinery, 2008, pp. 22–29.
Lopes, R., Vicente, D., and Silva, N., Static analysis tools, a practical approach for safety-critical software verification, in European Space Agency, (Special Publication) ESA SP, 2009, vol. 669 SP.
O’Hearn, P., Separation logic, Commun. ACM, 2019, vol. 62, no. 2, pp. 86–95.
Burstall, R.M., Some techniques for proving correctness of programs which alter data structures, Mach. Intell., 1972, vol. 7, no. 3, pp. 23–50.
O’Hearn, P. and Pym, D., The logic of bunched implications, Bull. Symbolic Logic, 1999, vol. 5, no. 2, pp. 215–244.
Reynolds, J.C., Intuitionistic reasoning about shared mutable data structure, Millennial Perspect. Comput. Sci., 2000, vol. 2, no. 1, pp. 303–321.
Ishtiaq, S.S. and O’Hearn, P.W., BI as an assertion language for mutable data structures, SIGPLAN Not., 2001, vol. 36, no. 3, pp. 14–26.
Reynolds, J.C., Separation logic: a logic for shared mutable data structures, Proc. 17th Annu. IEEE Symp. on Logic in Computer Science, Copenhagen, 2002, pp. 55–74.
Distefano, D., Fähndrich, M., Logozzo, F., and O’Hearn, P.W., Scaling static analyses at facebook, Commun. ACM, 2019, vol. 62, no. 8, pp. 62–70.
Hinrichsen, J.K., Bengtson, J., and Krebbers, R., Actris: session-type based reasoning in separation logic, Proc. ACM Program. Lang., 2019, vol. 4, no. POPL.
Cousot, P., Cousot, R., Feret, J., Mauborgne, L., Miné, A., Monniaux, D., and Rival, X., The astreé analyzer, in Programming Languages and Systems, Sagiv, M., Ed., Berlin, Heidelberg: Springer, 2005, pp. 21–30.
Wilson, C. and Osterweil, L.J., Omega – a data flow analysis tool for the C programming language, IEEE Trans. Software Eng., 1985, vol. SE-11, no. 9, pp. 832–838.
Chen, T. and Poole, P., Dynamic dataflow analysis, Inf. Software Technol., 1988, vol. 30, no. 8, pp. 497–505.
de Moura, L. and Bjorner, N., Z3: an efficient SMT solver, in Tools and Algorithms for the Construction and Analysis of Systems, Ramakrishnan, C.R. and Rehof, J., Eds., Berlin, Heidelberg: Springer, 2008, pp. 337–340.
Hoare, C.A.R., An axiomatic basis for computer programming, Commun. ACM, 1969, vol. 12, no. 10, pp. 576–580.
O’Hearn, P., Reynolds, J., and Yang, H., Local Reasoning about Programs That Alter Data Structures, Springer Verlag, 2001, vol. 2142, pp. 1–19.
Calcagno, C., Distefano, D., O’Hearn, P.W., and Yang, H., Compositional shape analysis by means of bi-abduction, J. ACM, 2011, vol. 58, no. 6.
Demri, S., Lozes, É., and Mansutti, A., Internal calculi for separation logics, in Proc. 28th EACSL Annu. Conf. on Computer Science Logic, CSL 2020, Jan. 13–16, 2020, Barcelona, Spain, Fernández, M. and Muscholl, A., Eds., Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2020, vol. 152, pp. 19:1–19:18.
Demri, S. and Fervari, R., The power of modal separation logics, J. Log. Comput., 2019, vol. 29, no. 8, pp. 1139–1184.
Limón, Y., Bárcenas, E., Benítez-Guerrero, E., Molero-Castillo, G., and Velázquez-Mena, A., Mu-calculus satisfiability with arithmetic constraints, Program. Comput. Software, 2020, vol. 46, no. 8, pp. 503–510.
Riaño, D., Piñon, R., Molero-Castillo, G., Bárcenas, E., and Velázquez-Mena, A., Regular expressions for web advertising detection based on an automatic sliding algorithm, Program. Comput. Software, 2020, vol. 46, no. 8, pp. 652–660.
ACKNOWLEDGMENTS
This work was supported by project UNAM-PAPIIT IA105420.
Author information
Authors and Affiliations
Corresponding authors
Rights and permissions
About this article
Cite this article
Medina-Martínez, D., Bárcenas, E., Molero-Castillo, G. et al. Database Management System Verification with Separation Logics. Program Comput Soft 47, 654–672 (2021). https://doi.org/10.1134/S036176882108017X
Received:
Revised:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1134/S036176882108017X