Proving that your Java code has no undefined behavior
Memory safety and absence of runtime errors: no out-of-bounds access, use-after-free, overflow traps, panics or undefined behavior on any input allowed by the precondition.
Change the question
Ranked by: support for this property, stage, coverage of the features you pick, and trust. Tools that work on compiled code rank lower. Ranking as JSON.
-
Write JML specifications for sequential Java code; KeY's prover, mostly automatic with interactive steps when needed, proves the code meets them.
Supported.Java has no undefined behavior. A normal_behavior contract requires that the method does not end with an exception, so KeY proves that no runtime exceptions (such as null dereference or index errors) occur.
Source Supported — Java has no undefined behavior. A normal_behavior contract requires that the method does not end with an exception, so KeY proves that no runtime exceptions (such as null dereference or index errors) occur.- Effort
- Interactive
- Covers
- 7 of 14 Java features
- Relies on
- KeY's own rule-based prover decides; its large rule base is trusted, not a small kernel. Default integer rules ignore overflow, which KeY itself marks unsound; Java mode exists.
Stage 1 · Usable 0/5 strong
No option matches this effort level.
Or write new verified code that compiles to Java
You write the code in a verification language; its compiler produces the Java code.
- Dafny Stage 1 · Usable write in Dafny, then Dafny compiler (Java backend) (trusted)
Ask something else about Java
New to this? Start with the glossary: auto-activeAuto-active verification. You write specifications and hints in the code; an automatic solver does the proving., interactiveInteractive theorem prover. A proof assistant where you write proofs step by step and the system checks each step., trusted computing baseTrusted computing base (TCB). Everything that must be correct for a proof to mean what it says..