Skip to content

The Quicktour

⚠ not yet verified
This article gives an introduction to the KeY system.

Introduction

When we started writing this document, we aimed at providing a short tutorial accompanying the reader at their first steps with the KeY system. The KeY tool is designed as an integrated environment for creating, analyzing, and verifying software models and their implementation. The reader shall learn how to install and use the basic functionality of the KeY tool. Besides practical advises how to install and get KeY started, we show along a small project how to use the KeY tool to verify programs.

Verification means proving that a program complies with its specification in a mathematically rigorous way. In order to fulfill this task, the specification needs to be given in a formal language with a precisely defined meaning. In the current version of the document, we focus on the popular Java Modeling Language (JML) Leavens et al. 2011; Leavens et al. 2004 as specification language.

In the next sections, we show how to verify a JML-annotated (specified) JavaCard program. For this purpose, KeY features a calculus for the complete JavaCard language including advanced features like transactions.

Besides JML, the KeY tool supports JavaCardDL as a specification language.

For a longer discussion on the architecture, design philosophy, and theoretical underpinnings of the KeY tool  please refer to Ahrendt et al. 2016. In case of questions or comments, don’t hesitate to contact the KeYsupport team at support@key-project.org.

Version Information
This tutorial was tested for KeY version 2.10.

Contents

  1. Installation: This chapter explains how to install and run the KeY system.
  2. Loading JML Contracts: This chapter explains how to load JML specifications into KeY and gives an introduction to the logical calculus behind KeY.
  3. ProvingJML Contracts: This chapter explains how to apply your knowledge from the previous chapter, showing how KeY generates proof obligations and how to prove them.
  4. Appendix

Bibliography

Bernhard Beckert. A Dynamic Logic for the Formal Verification of Java Card Programs. In Java on Smart Cards: Programming and Security. Revised Papers, Java Card 2000, International Workshop, Cannes, France, LNCS 2041, pp. 6–24, Springer-Verlag, 2001.

Bernhard Beckert and Christoph Gladisch. White-box Testing by Combining Deduction-based Specification Extraction and Black-box Testing. In Proceedings, International Conference on Tests and Proofs (TAP), Zurich, Switzerland, LNCS 4454, Springer, 2007.

ESC/Java (Extended Static Checking for Java). http://research.compaq.com/SRC/esc/

Christian Engel. A translation from JML to Java Dynamic Logic. Studienarbeit, Fakultät für Informatik, Universität Karlsruhe 2005.

Christian Engel and Reiner Hähnle. Generating Unit Tests from Formal Proofs. In Proc. Tests and Proofs (TAP), Zürich, Switzerland, LNCS, vol. 4454, Springer-Verlag, 2007.

Wolfgang Ahrendt and Thomas Baar and Bernhard Beckert and Martin Giese and Elmar Habermalz and Reiner Hähnle and Wolfram Menzel and Peter H. Schmitt. The KeY Approach: Integrating Object Oriented Design and Formal Verification. In Proc. 8th European Workshop on Logics in AI (JELIA), Malaga, Spain, LNCS, vol. 1919, pp. 21–36, Springer-Verlag, 2000.

http://www.icansolve.com

Gary T. Leavens and Erik Poll and Curtis Clifton and Yoonsik Cheon and Clyde Ruby and David Cok and Peter Müller and Joseph Kiniry and Patrice Chalin and Daniel M. Zimmerman. JML Reference Manual. Department of Computer Science, Iowa State University. Available from http://www.jmlspecs.org 2011.

JavaRedux - API. API documentation of a restricted subset of the Java Standard Library Classes. URL

Wolfgang Ahrendt and Thomas Baar and Bernhard Beckert and Richard Bubel and Martin Giese and Reiner Hähnle and Wolfram Menzel and Wojciech Mostowski and Andreas Roth and Steffen Schlager and Peter H. Schmitt. The KeY Tool. Available at: http://i12www.ira.uka.de/~beckert/pub/key03.pdf 2003.

Wolfgang Ahrendt and Thomas Baar and Bernhard Beckert and Richard Bubel and Martin Giese and Reiner Hähnle and Wolfram Menzel and Wojciech Mostowski and Andreas Roth and Steffen Schlager and Peter H. Schmitt. The KeY Tool. Software and System Modeling, vol. 4, pp. 32-54, Springer-Verlag, 2005. http://springerlink.metapress.com/openurl.asp?genre=article&id=doi:10.1007/s10270-004-0058-x

Bernhard Beckert and Reiner Hähnle and Peter H. Schmitt (eds.). Verification of Object-Oriented Software: The KeY Approach. LNCS 4334, Springer-Verlag, 2007.

Wolfgang Ahrendt and Bernhard Beckert and Richard Bubel and Reiner Hähnle and Peter H. Schmitt and Mattias Ulbrich (eds.). Deductive Software Verification - The KeY Book - From Theory to Practice. In Deductive Software Verification - The KeY Book - From Theory to Practice, Lecture Notes in Computer Science, vol. 10001, Springer, 2016. doi:10.1007/978-3-319-49812-6

Gary T. Leavens and Albert L. Baker and Clyde Ruby. Preliminary Design of JML: A Behavioral Interface Specification Language for Java. See http://www.jmlspecs.org. 2004. URL

Meyer, Bertrand. Object-Oriented Software Construction (Second Edition). Prentice-Hall, 1997.

Clark Barrett and Silvio Ranise and Aaron Stump and Cesare Tinelli. The Satisfiability Modulo Theories Library (SMT-LIB). www.SMT-LIB.org 2008.

Andreas Roth. Specification and Verification of Object-oriented Components. 2006.

Steffen Schlager. Handling of Integer Arithmetic in the Verification of Java Programs. Available at: http://i12www.ira.uka.de/~key/doc/2002/DA-Schlager.ps.gz 2002.

Steffen Schlager. Symbolic Execution as a Framework for Deductive Verification of Object-Oriented Programs. Sierke-Verlag, 2007.

http://secure.ucd.ie/products/opensource/ESCJava2/

Dominic Steinhöfel and Reiner Hähnle. Abstract Execution. In Formal Methods - The Next 30 Years - Third World Congress, FM 2019, Porto, Portugal, October 7-11, 2019, Proceedings, pp. 319–336, Springer, 2019. doi:10.1007/978-3-030-30942-8_20 URL

Benjamin Weiß. Deductive Verification of Object-Oriented Software: Dynamic Frames, Dynamic Logic and Predicate Abstraction. 2011.

Thomas Baar and Reiner Hähnle and Steffen Schlager. KeY Quicktour. See http://www.key-project.org/download/