Wikipedia / KeY
Wikipedia / KeY
KeY is a formal verification tool for Java programs. It accepts specifications written in the Java Modeling Language to Java source files. These are transformed into theorems of dynamic logic and then compared against program semantics that are likewise defined in terms of dynamic logic. KeY is significantly powerful in that it supports both interactive (i.e. by hand) and fully automated correctness proofs. Failed proof attempts can be used for a more efficient debugging or verification-based testing. There have been several extensions to KeY in order to apply it to the verification of C programs or hybrid systems. KeY is jointly developed by Karlsruhe Institute of Technology, Germany; Technische Universität Darmstadt, Germany; and Chalmers University of Technology in Gothenburg, Sweden and is licensed under the GPL.
Overview
The usual user input to KeY consists of a Java source file with annotations in JML. Both are translated to KeY's internal representation, dynamic logic. From the given specifications, several proof obligations arise which are to be discharged, i.e. a proof has to be found. To this ends, the program is symbolically executed with the resulting changes to program variables stored in so-called updates. Once the program has been processed completely, there remains a first-order logic proof obligation. At the heart of the KeY system lies a first-order theorem prover based on sequent calculus, which is used to close the proof. Interference rules are captured in so called taclets which consist of an own simple language to describe changes to a sequent.
Java Card DL
The theoretical foundation of KeY is a formal logic called Java Card DL. DL stands for Dynamic Logic. It is a version of a first-order dynamic logic in Hoare calculus, or that quantification over formulas which contain modalities is possible. There is also a dual which includes termination.
Deduction component
At the heart of the KeY system lies a first-order theorem prover based on a sequent calculus holds true. By means of deduction).
Symbolic execution of Java code
During that, program modalities are eliminated by symbolic execution. As this example shows, symbolic execution in dynamic logic is very similar to calculating weakest preconditions essentially denote the same thing really is a formula of the given calculus. Secondly, symbolic execution runs through the program forward just as an actual execution would. To save intermediate results of assignments, KeY introduces a concept called updates could take any value.
Example
. . Note that tableaux of sequent calculi are usually written "upside-down", i.e., the starting sequent appears at the bottom and deduction steps go upwards. The proof can be seen in the figure on the right.
Additional features
Symbolic Execution Debugger
The Symbolic Execution Debugger visualizes the control flow of a program as a symbolic execution tree that contains all feasible execution paths through the program up to a certain point. It is provided as a plugin to the Eclipse development platform.
Test Case Generator
KeY is usable as a model-based testing tool that can generate unit tests for Java programs. The model from which test data and the test case are derived consists of a formal specification (provided in JML) and a symbolic execution tree of the implementation under test which is computed by the KeY system.
Distribution and Variants of the KeY System
KeY is free software written in Java and licensed under the GNU General Public License, version 2. It can be downloaded from the project website in source or as pre-compiled JAR.
KeY-Hoare
KeY-Hoare is built on top of KeY and features a Hoare calculus with state updates. State updates are a means of describing state transitions in a Kripke structure. This calculus can be seen as a subset to the one that is used in the main branch of KeY. Due to the simplicity of the Hoare calculus, this implementation is essentially meant to exemplify formal methods in undergraduate classes.
KeYmaera/KeYmaeraX
KeYmaera http://symbolaris.com/info/KeYmaera.html (previously called HyKeY) is a deductive verification tool for hybrid systems based on a calculus for the differential dynamic logic dL http://symbolaris.com/logic/dL.html. It extends the KeY tool with computer algebra systems like Mathematica and corresponding algorithms and proof strategies such that it can be used for practical verification of hybrid systems.
KeYmaera has been developed at the University of Oldenburg and the Carnegie Mellon University. The name of the tool was chosen as a homophone to Chimera, the hybrid animal from ancient Greek mythology.
KeYmaeraX http://www.ls.cs.cmu.edu/KeYmaeraX/ developed at the Carnegie Mellon University is the successor of KeYmaera. It has been completely rewritten.
KeY for C
KeY for C is an adaption of the KeY System to MISRA C, a subset of the C programming language. This variant is no longer supported.
ASMKeY
There is also an adaptation to use KeY for the symbolic execution of Abstract State Machines, that was developed at ETH Zürich. This variant is no longer supported.
References
Sources
Verification of Object-Oriented Software: The KeY Approach. Bernhard Beckert, Reiner Hähnle, Peter H. Schmitt (Eds.). Springer, 2007. .
Deductive Software Verification – The KeY Book: From Theory to Practice. Wolfgang Ahrendt, Bernhard Beckert, Richard Bubel, Reiner Hähnle, Peter H. Schmitt, Mattias Ulbrich (Eds.). Springer, 2016.
A comparison of tools for teaching formal software verification. Ingo Feinerer and Gernot Salzer. Springer, 2008
Programming With Proofs: Language Based Approaches To Totally Correct Software. Aaron Stump. Verified Software: Theories, Tools, and Experiments, 2005.
High Assurance (for Security or Safety) and Free-Libre / Open Source Software (FLOSS). David Wheeler, 2009
External links