Abstract
Dafny is a verification-aware programming language used at Amazon Web Services to develop critical components of their access management, storage, and cryptography infrastructures. The Dafny toolchain provides a verifier that can prove an implementation of a method satisfies its specification. When the underlying SMT solver cannot establish a proof, it generates a counterexample. These counterexamples are hard to understand and their interpretation is often a bottleneck in the proof debugging process. In this paper, we introduce an open-source tool that transforms counterexamples generated by the SMT solver to a more user-friendly format that maps to the Dafny syntax and is suitable for further processing. This new tool allows the Dafny developers to quickly identify the root cause of a problem with their proof, thereby speeding up the development of Dafny projects.
Chapter PDF
Similar content being viewed by others
References
Barnett, M., Chang, B.Y.E., DeLine, R., Jacobs, B., Leino, K.R.M.: Boogie: A modular reusable verifier for object-oriented programs. In: International Symposium on Formal Methods for Components and Objects. pp. 364–387 (2005). https://doi.org/10.1007/11804192_17
Becker, B.F.H., Lourenço, C.B., Marché, C.: Explaining counterexamples with giant-step assertion checking. In: Workshop on Formal Integrated Development Environment. EPTCS, vol. 338, pp. 82–88 (2021). https://doi.org/10.4204/EPTCS.338.10
Chakarov, A., Fedchin, A., Rakamarić, Z., Rungta, N.: Better counterexamples for Dafny artifact (2021). https://doi.org/10.5281/zenodo.5571033
Cook, B.: Formal reasoning about the security of Amazon web services. In: International Conference on Computer Aided Verification. pp. 38–47 (2018). https://doi.org/10.1007/978-3-319-96145-3_3
Dailler, S., Hauzar, D., Marché, C., Moy, Y.: Instrumenting a weakest precondition calculus for counterexample generation. Journal of Logical and Algebraic Methods in Programming 99, 97–113 (2018). https://doi.org/10.1016/j.jlamp.2018.05.003
Hess, M., Kistler, T.: Dafny Language Server Redesign. Term project, HSR Hochschule für Technik Rapperswil (2019)
Krucker, R., Schaden, M.: Visual Studio Code Integration for the Dafny Language and Program Verifier. Bachelor’s thesis, HSR Hochschule für Technik Rapperswil (2017)
Le Goues, C., Leino, K.R.M., Moskal, M.: The Boogie verification debugger (tool paper). In: International Conference on Software Engineering and Formal Methods. pp. 407–414 (2011). https://doi.org/10.1007/978-3-642-24690-6_28
Leino, K.R.M.: Dafny: An automatic program verifier for functional correctness. In: International Conference on Logic for Programming Artificial Intelligence and Reasoning. pp. 348–370 (2010). https://doi.org/10.1007/978-3-642-17511-4_20
Leino, K.R.M.: Accessible software verification with Dafny. IEEE Software 34(6), 94–97 (2017). https://doi.org/10.1109/MS.2017.4121212
de Moura, L., Bjørner, N.: Z3: An efficient SMT solver. In: International Conference on Tools and Algorithms for the Construction and Analysis of Systems. pp. 337–340 (2008). https://doi.org/10.1007/978-3-540-78800-3_24
Nilizadeh, A., Calvo, M., Leavens, G.T., Le, X.B.D.: More reliable test suites for dynamic APR by using counterexamples. In: IEEE International Symposium on Software Reliability Engineering (2021), to appear
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Open Access This chapter is licensed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and indicate if changes were made.
The images or other third party material in this chapter are included in the chapter's Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the chapter's Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder.
Copyright information
© 2022 The Author(s)
About this paper
Cite this paper
Chakarov, A., Fedchin, A., Rakamarić, Z., Rungta, N. (2022). Better Counterexamples for Dafny. In: Fisman, D., Rosu, G. (eds) Tools and Algorithms for the Construction and Analysis of Systems. TACAS 2022. Lecture Notes in Computer Science, vol 13243. Springer, Cham. https://doi.org/10.1007/978-3-030-99524-9_23
Download citation
DOI: https://doi.org/10.1007/978-3-030-99524-9_23
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-99523-2
Online ISBN: 978-3-030-99524-9
eBook Packages: Computer ScienceComputer Science (R0)