An aXiomatic Tactical Theorem Prover for Hybrid Systems
Self-driving cars, autonomous robots, modern airplanes, or robotic surgery: we increasingly entrust our lives to computers and therefore should strive for nothing but the highest safety standards - mathematical correctness proof. Proofs for such cyber-physical systems can be constructed with the KeYmaera X prover. As a hybrid systems theorem prover, KeYmaera X analyzes the control program and the physical behavior of the controlled system together in differential dynamic logic.
KeYmaera X features a minimal core of just about 2000 lines of code that isolates all soundness-critical reasoning. Such a small and simple prover core makes it much easier to trust verification results. Pre-defined and custom tactics built on top of the core drive automated proof search. KeYmaera X comes with a web-based front-end that provides a clean interface for both interactive and automated proving, highlighting the most crucial parts of a verification activity. Besides hybrid systems, KeYmaera X also supports the verification of hybrid games in differential game logic.
More information and precompiled binaries are available at: https://keymaeraX.org/
The easiest way to run KeYmaera X is to download binaries keymaerax.jar and start from command line:
java -jar keymaerax.jar
For this to succeed, ensure that the following software is installed:
KeYmaera X requires a decision procedure for real arithmetic to finalize proofs. It is tested best with Mathematica and some features are only available when using Mathematica. After starting KeYmaera X you can configure arithmetic tools in the KeYmaera X->Preferences menu.
Depending on the operating system, Mathematica is installed in different locations.
Alternatively, you can also specify which arithmetic tools to use from command line with
-jlink. Example parameters that are appropriate when
Mathematica is installed in the default location are provided below.
macOS, 64bit, Mathematica 10.4+
Linux, 64bit, Mathematica 10.4+
Windows, 64bit, Mathematica 10.4+
-mathkernel "C:\Program Files\Wolfram Research\Mathematica\10.4\MathKernel.exe"
-jlink "C:\Program Files\Wolfram Research\Mathematica\10.4\SystemFiles\Links\JLink\SystemFiles\Libraries\Windows-x86-64"
To compile KeYmaera X from source code and learn about faster incremental compilation in IDEs, see Building Instructions. In a nutshell, install
and run the following to build
sbt clean assembly
or the following to build the KeYmaera X core
keymaerax-core.jar without UI:
sbt "project core" clean assembly
ScalaDoc API documentation for KeYmaera X can be generated locally with:
This will generate ScalaDoc into
A quick smoke test suite can be run by:
sbt "test-only -- -n edu.cmu.cs.ls.keymaerax.tags.SummaryTest -n edu.cmu.cs.ls.keymaerax.tags.CheckinTest"
A single test can be run as follows:
sbt "testOnly edu.cmu.cs.ls.keymaerax.btactics.BenchmarkTests"
KeYmaera X implements the uniform substitution calculus for differential dynamic logic in order to enable soundness assurance by way of a small trusted LCF-style kernel while still being amenable to automatic theorem proving.
André Platzer. A complete uniform substitution calculus for differential dynamic logic. Journal of Automated Reasoning 59(2), pp. 219-266, 2017. Extended version of CADE-25.
André Platzer. Logics of dynamical systems. ACM/IEEE Symposium on Logic in Computer Science, LICS 2012, June 25–28, 2012, Dubrovnik, Croatia, pages 13-24. IEEE 2012.
Nathan Fulton, Stefan Mitsch, Jan-David Quesel, Marcus Völp and André Platzer. KeYmaera X: An axiomatic tactical theorem prover for hybrid systems. In Amy P. Felty and Aart Middeldorp, editors, International Conference on Automated Deduction, CADE-25, Berlin, Germany, Proceedings, LNCS. Springer, 2015.
Nathan Fulton, Stefan Mitsch, Brandon Bohrer and André Platzer. Bellerophon: Tactical theorem proving for hybrid systems. In Mauricio Ayala-Rincón and César Muñoz, editors, Interactive Theorem Proving, International Conference, ITP 2017, volume 10499 of LNCS, pp. 207-224. Springer, 2017.
The soundness assurances provided by a small LCF-style kernel are further strengthened by a cross-verification of the soundness theorem for the uniform substitution calculus.
A secondary goal of KeYmaera X is to also make it possible to implement extensions of differential dynamic logic, such as differential game logic for hybrid games as well as quantified differential dynamic logic for distributed hybrid systems:
André Platzer. Differential game logic. ACM Trans. Comput. Log. 17(1), 2015.
André Platzer. Differential hybrid games. ACM Trans. Comput. Log. 18(3), 2017.
André Platzer. A complete axiomatization of quantified differential dynamic logic for distributed hybrid systems. Logical Methods in Computer Science 8(4), pages 1-44, 2012.
KeYmaera X implements fast generalized uniform substitution algorithms, also cross-verified:
André Platzer. Uniform substitution for differential game logic. In Didier Galmiche, Stephan Schulz and Roberto Sebastiani, editors, Automated Reasoning, 9th International Joint Conference, IJCAR 2018, volume 10900 of LNCS, pp. 211-227. Springer 2018.
André Platzer. Uniform substitution at one fell swoop. In Pascal Fontaine, editor, International Conference on Automated Deduction, CADE-27, volume 11716 of LNCS, pp. 425-441. Springer, 2019. Isabelle/HOL
Automatic proofs for differential equation invariants are based on:
Liveness proofs for differential equations are based on:
KeYmaera X uses the Pegasus tool for invariant generation (which gets better when additional software is installed):
KeYmaera X implements the ModelPlex method to ensure that verification results about models apply to cyber-physical system implementations. ModelPlex generates provably correct monitor conditions that, if checked to hold at runtime, are provably guaranteed to imply that the offline safety verification results about the CPS model apply to the present run of the actual CPS implementation.
Stefan Mitsch and André Platzer. ModelPlex: Verified runtime validation of verified cyber-physical system models. Formal Methods in System Design 49(1), pp. 33-74. 2016. Special issue for selected papers from RV'14.
Yong Kiam Tan, Stefan Mitsch and André Platzer. Verifying switched system stability with logic In Ezio Bartocci and Sylvie Putot, editors, Hybrid Systems: Computation and Control (part of CPS Week 2022), HSCC'22. Article No. 2, pp. 1-11. ACM, 2022.
The design principles for the user interface of KeYmaera X are described in:
Model and proof management techniques are described in:
A comparison of KeYmaera X with its predecessor provers is described in:
Copyright (C) 2014-2022 Carnegie Mellon University. See COPYRIGHT.txt for details. Developed by Andre Platzer, Stefan Mitsch, Nathan Fulton, Brandon Bohrer, Jan-David Quesel, Yong Kiam Tan, Andrew Sogokon, Fabian Immler, Marcus Voelp, Ran Ji.
See LICENSE.txt for the conditions of using this software.
The KeYmaera X distribution contains external tools. A list of tools and their licenses can be found in
KeYmaera X developers: keymaeraX@keymaeraX.org
A Helmholtz Pilot Program