Implementation-level verification of algorithms with KeY

  • Daniel Bruns
  • Wojciech MostowskiEmail author
  • Mattias Ulbrich
VerifyThis 2012


We give an account on the authors’ experience and results from the software verification competition held at the Formal Methods 2012 conference. Competitions like this are meant to provide a benchmark for verification systems. It consisted of three algorithms which the authors have implemented in Java, specified with the Java Modeling Language, and verified using the KeY system. Building on our solutions, we argue that verification systems which target implementations in real-world programming languages better have powerful abstraction capabilities. Regarding the KeY tool, we explain features which, driven by the competition, have been freshly implemented to accommodate for these demands.


Formal verification Benchmark Java Modeling Language Theorem prover 



The work of Daniel Bruns is supported by the German National Science Foundation (DFG) under project “Program-level Specification and Deductive Verification of Security Properties” within priority programme 1496 “Reliably Secure Software Systems—RS3”. Wojciech Mostowski is supported by European Research Council (ERC) grant 258405 for the VerCors project.


  1. 1.
    Barnett, M., Leino, K.R.M., Schulte, W.: The Spec# programming system: an overview. In: Construction and Analysis of Safe, Secure, and Interoperable Smart Devices (CASSIS), International Workshop, 2004, Revised Selected Papers. LNCS, vol. 3362, pp. 49–69. Springer (2005)Google Scholar
  2. 2.
    Beckert, B., Grebing, S.: Evaluating the usability of interactive verification systems. In: Klebanov, V., Beckert, B., Biere, A., Sutcliffe, G. (eds.) 1st International Workshop on Comparative Empirical Evaluation of Reasoning Systems (COMPARE) 2012, CEUR Workshop Proceedings, vol. 873 (2012)Google Scholar
  3. 3.
    Beckert, B., Hähnle, R., Schmitt, P.H. (eds.): Verification of Object-Oriented Software: The KeY Approach. LNCS, vol. 4334. Springer (2007)Google Scholar
  4. 4.
    Blelloch, G.E.: Prefix sums and their applications. Tech. Rep. CMU-CS-90-190, School of Computer Science, Carnegie Mellon University (1990)Google Scholar
  5. 5.
    Bormer, T., Brockschmidt, M., Distefano, D., Ernst, G., Filliâtre, J.C., Grigore, R., Huisman, M., Klebanov, V., Marché, C., Monahan, R., Mostowski, W., Polikarpova, N., Scheben, C., Schellhorn, G., Tofan, B., Tschannen, J., Ulbrich, M.: The COST IC0701 verification competition 2011. In: Beckert, B., Damiani, F., Gurov, D. (eds.) Revised Selected Papers, International Conference on Formal Verification of Object-Oriented Software (FoVeOOS 2011). LNCS, vol. 7421, pp. 3–21. Springer (2012)Google Scholar
  6. 6.
    Burdy, L., Cheon, Y., Cok, D., Ernst, M., Kiniry, J., Leavens, G.T., Leino, K.R.M., Poll, E.: An overview of JML tools and applications. In: Arts, T., Fokkink, W. (eds.) Proceedings of the Eighth International Workshop on Formal Methods for Industrial Critical Systems (FMICS 03). ENTCS, vol. 80, pp. 73–89. Elsevier (2003) Google Scholar
  7. 7.
    Cheon, Y., Leavens, G.T., Sitaraman, M., Edwards, S.: Model variables: cleanly supporting abstraction in design by contract. Softw. Pract. Exp. 35(6), 583–599 (2005)CrossRefGoogle Scholar
  8. 8.
    De Moura, L., Bjørner, N.: Satisfiability modulo theories: introduction and applications. Commun. ACM 54(9), 69–77 (2011)CrossRefGoogle Scholar
  9. 9.
    Filliâtre, J.C., Marché, C.: The Why/Krakatoa/Caduceus platform for deductive program verification. In: Damm, W., Hermanns, H. (eds.) 19th International Conference on Computer Aided Verification. LNCS, vol. 4590. Springer (2007)Google Scholar
  10. 10.
    Filliâtre, J.C., Paskevich, A., Stump, A.: The 2nd verified software competition: experience report. In: Beckert, B., Biere, A., Klebanov, V., Sutcliffe, G. (eds.) 1st International Workshop on Comparative Empirical Evaluation of Reasoning Systems (COMPARE) 2012, CEUR Workshop Proceedings, vol. 873 (2012)Google Scholar
  11. 11.
    Harel, D.: Dynamic logic. In: Gabbay, D., Guenther, F. (eds.) Handbook of Philosophical Logic, Volume II: Extensions of Classical Logic, pp. 497–604. D. Reidel Publishing Co., Dordrecht (1984)CrossRefGoogle Scholar
  12. 12.
    Jacobs, B., Smans, J., Philippaerts, P., Vogels, F., Penninckx, W., Piessens, F.: VeriFast: a powerful, sound, predictable, fast verifier for C and Java. In: Bobaru, M.G., Havelund, K., Holzmann, G.J., Joshi, R. (eds.) NASA Formal Methods—Third International Symposium, 2011. LNCS, vol. 6617, pp. 41–55. Springer (2011)Google Scholar
  13. 13.
    Kassios, I.T.: The dynamic frames theory. Form. Asp. Comput. 23(3), 267–288 (2011)zbMATHMathSciNetCrossRefGoogle Scholar
  14. 14.
    Kassios, I.T., Müller, P., Schwerhoff, M.: Comparing verification condition generation with symbolic execution: an experience report. In: Joshi, R., Müller, P., Podelski, A. (eds.) Verified Software Theories Tools Experiments (VSTTE) 2012. LNCS, vol. 7152, pp. 196–208. Springer (2012)Google Scholar
  15. 15.
    Klebanov, V., Müller, P., Shankar, N., Leavens, G.T., Wüstholz, V., Alkassar, E., Arthan, R., Bronish, D., Chapman, R., Cohen, E., Hillebrand, M., Jacobs, B., Leino, K.R.M., Monahan, R., Piessens, F., Polikarpova, N., Ridge, T., Smans, J., Tobies, S., Tuerk, T., Ulbrich, M., Weiß, B.: The 1st verified software competition: experience report. In: Butler, M., Schulte, W. (eds.) Proceedings, 17th International Symposium on Formal Methods (FM) 2011. LNCS, vol. 6664, pp. 154–168. Springer (2011)Google Scholar
  16. 16.
    Leavens, G.T., Baker, A.L., Ruby, C.: Preliminary design of JML: a behavioral interface specification language for Java. SIGSOFT 31(3), 1–38 (2006)CrossRefGoogle Scholar
  17. 17.
    Mostowski, W.: Formal reasoning about non-atomic Java Card methods in dynamic logic. In: Misra, J., Nipkow, T., Sekerinski, E. (eds.) Proceedings, Formal Methods (FM) 2006. LNCS, vol. 4085, pp. 444–459. Springer (2006)Google Scholar
  18. 18.
    Mostowski, W.: Fully verified Java Card API reference implementation. In: Beckert, B. (ed.) 4th International Verification Workshop, CEUR WS, vol. 259 (2007)Google Scholar
  19. 19.
    The on-line encyclopedia of integer sequences. Retrieved 30/07/2013
  20. 20.
    Parkinson, M., Bierman, G.: Separation logic and abstraction. SIGPLAN Notes 40(1), 247–258 (2005)Google Scholar
  21. 21.
    Scheben, C., Schmitt, P.H.: Verification of information flow properties of Java programs without approximations. In: Formal Verification of Object-Oriented Software. LNCS, vol. 7421, pp. 232–249. Springer (2012)Google Scholar
  22. 22.
    Schmitt, P.H., Tonin, I.: Verifying the Mondex case study. In: Hinchey, M., Margaria, T. (eds.) Proceedings of the 5th IEEE International Conference on Software Engineeging and Formal Methods (SEFM), pp. 47–56. IEEE Press (2007)Google Scholar
  23. 23.
    Schulte, W., Songtao, X., Smans, J., Piessens, F.: A glimpse of a verifying C compiler. In: C/C++ Verification Workshop (2007).
  24. 24.
    Sedgewick, R., Wayne, K.: Algorithms, 4th edn. Addison-Wesley, Reading (2011)Google Scholar
  25. 25.
    Stenzel, K.: A formally verified calculus for full Java Card. In: Rattray, C., Maharaj, S., Shankland, C. (eds.) Algebraic Methodology and Software Technology, 10th International Conference, AMAST 2004. LNCS, vol. 3116, pp. 491–505. Springer (2004) Google Scholar
  26. 26.
    Weiß, B.: Deductive verification of object-oriented software: dynamic frames, dynamic logic and predicate abstraction. Ph.D. thesis, Karlsruhe Institute of Technology (2011)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2013

Authors and Affiliations

  • Daniel Bruns
    • 1
  • Wojciech Mostowski
    • 2
    Email author
  • Mattias Ulbrich
    • 1
  1. 1.Karlsruhe Institute of TechnologyKarlsruheGermany
  2. 2.University of TwenteEnschedeThe Netherlands

Personalised recommendations