Abstract: Definition packages in theorem provers provide users with means of defining and organizing concepts of interest. This system description presents a new definition package for the hybrid systems theorem prover KeYmaera X based on differential dynamic logic (dL). The package adds KeYmaera X support for user-defined smooth functions whose graphs can be implicitly characterized by dL formulas. Notably, this makes it possible to implicitly characterize functions, such as the exponential and trigonometric functions, as solutions of differential equations and then prove properties of those functions using dL’s differential equation reasoning principles. Trustworthiness of the package is achieved by minimally extending KeYmaera X’s soundness-critical kernel with a single axiom scheme that expands function occurrences with their implicit characterization. Users are provided with a high-level interface for defining functions and non-soundness-critical tactics that automate low-level reasoning over implicit characterizations in hybrid system proofs.
Introduction
Presented at IJCAR 2022, this research describes a significant upgrade to the KeYmaera X theorem prover. KeYmaera X is a specialized tool used to verify the safety of "hybrid systems"—technologies like self-driving cars or surgical robots that combine discrete computer logic with continuous physical motion. Ensuring the safety of these systems requires rigorous mathematical modeling of their continuous dynamics, typically expressed as differential equations.
The Challenge of Transcendental Functions
A significant hurdle in previous versions of KeYmaera X was the lack of direct support for transcendental functions like $\sin(\theta)$, $e^t$, or $\tanh(x)$. Because the underlying logic, Differential Dynamic Logic (dL), primarily handled polynomial expressions, users were forced to "track" these values manually.
For instance, to model a pendulum, a user would have to introduce auxiliary variables $s$ and $c$ to represent $\sin(\theta)$ and $\cos(\theta)$, and then manually append the corresponding Ordinary Differential Equations (ODEs) $s' = \omega c$ and $c' = -\omega s$ to the system model. This manual process was not only cumbersome but also error-prone; a single mistake in the auxiliary ODEs could compromise the entire safety proof.
Implementation via Implicit Characterization
To address this, the authors introduced a new definition package that allows smooth functions to be defined implicitly as unique solutions to ODEs. This mechanism is built upon the core syntax of dL.
The package's architecture relies on a minimal extension to the KeYmaera X kernel, totaling approximately 170 lines of code. The core logic involves:
- Implicit Characterization: Functions are defined by their graphs using dL formulas.
- The FI Axiom: A single new axiom scheme, the Function Interpretation (FI) axiom, allows the prover to "unfold" a function into its defining ODE during a proof.
- Automation Tactics: High-level scripts automate the verification of existence and uniqueness (leveraging the Picard-Lindelöf theorem) and derive necessary differential properties like the chain rule.
Comparative Results: The Pendulum Example
The impact of this package is most visible when comparing system models. In the pendulum example, the new package allows the safety specification to use $\sin$ and $\cos$ directly, significantly simplifying the model and reducing the risk of manual error.
Beyond the pendulum, the system was successfully applied to several complex domains:
- Biological Models: Verifying asymptotic bounds for interacting neurons using the hyperbolic tangent ($\tanh$) function.
- Aerospace Engineering: Handling a 6th-order longitudinal flight model for an aircraft, which involved complex algebraic invariants that would be nearly impossible to manage manually.
- Efficiency Gains: The package enables "untrusted abstraction," where complex functions are temporarily replaced by variables to simplify arithmetic for external solvers, improving proof performance.
Conclusion and Future Work
By allowing implicit definitions of smooth functions, KeYmaera X now supports more natural and rigorous modeling of real-world physical systems. This eliminates manual workarounds and expands the prover's ability to verify systems with high mathematical rigor. Future work aims to formally verify the kernel extension in a meta-prover and expand support to multivariate functions defined by partial differential equations.
Summary updated