Find a tool · Dafny

Proving that your Dafny 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

I have code and want to prove

Effort
My code uses

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.

  1. Write programs in Dafny with specifications; the verifier proves them through Boogie and Z3, then Dafny compiles the code to C#, Java, Go, JavaScript or Python.

    Supported.The verifier proves the absence of runtime errors such as out-of-bounds indexing, null dereference and division by zero.
    Source
    Supported — The verifier proves the absence of runtime errors such as out-of-bounds indexing, null dereference and division by zero.

    Effort
    Auto-active
    Covers
    6 of 10 Dafny features
    Relies on
    Boogie and the Z3 SMT solver decide; no proof certificates. Dafny's meaning is defined by its translation to Boogie; no published validation of it.
    Stage 1 · Usable Trust: Checker partial, Semantics partial, Frontend strong, Binary gap weak, Escape hatches partial 1/5 strong
  2. KeY on compiled code: Java

    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
    5 of 10 common 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 Trust: Checker partial, Semantics weak, Frontend partial, Binary gap weak, Escape hatches partial 0/5 strong
  3. Gobra on compiled code: Go

    Add specifications as comments to Go code; Gobra translates it to the Viper verifier, which proves memory safety, race freedom and your contracts.

    Partial.Proves memory safety (through permissions) and absence of runtime errors such as nil dereference and out-of-bounds access. Integer overflow is only checked with --overflow, which is off by default.
    Source
    Partial — Proves memory safety (through permissions) and absence of runtime errors such as nil dereference and out-of-bounds access. Integer overflow is only checked with --overflow, which is off by default.

    Effort
    Auto-active
    Covers
    6 of 10 common features
    Relies on
    Viper's symbolic execution engine and the Z3 SMT solver decide; no proof certificates. Go model built into Gobra; ignores integer overflow unless --overflow is set.
    Stage 1 · Usable Trust: Checker partial, Semantics weak, Frontend partial, Binary gap weak, Escape hatches partial 0/5 strong
  4. s2n-bignum on compiled code: x86-64

    Prove hand-written x86-64 or Arm64 assembly correct in HOL Light, on the exact bytes of the built object file; used for AWS's cryptography code.

    Partial.Memory-safety proofs (all accesses inside the declared buffers) exist for the functions AWS-LC uses, not yet for the whole library. They do not check accesses below the stack pointer, and the memory model has no unmapped pages, so the caller must pass mapped memory.
    Source
    Partial — Memory-safety proofs (all accesses inside the declared buffers) exist for the functions AWS-LC uses, not yet for the whole library. They do not check accesses below the stack pointer, and the memory model has no unmapped pages, so the caller must pass mapped memory.

    Effort
    Interactive
    Covers
    0 of 0 common features
    Relies on
    Hand-written instruction models; random co-simulation against real CPUs in CI.
    Stage 1 · Usable Trust: Checker strong, Semantics partial, Frontend strong, Binary gap strong, Escape hatches strong 4/5 strong
  5. Islaris on compiled code: AArch64

    Prove Arm or RISC-V machine code correct in Rocq, against the full official Sail ISA models, using Isla symbolic execution and an Iris separation logic.

    Supported.Proofs show execution never reaches a failure state and only touches memory the specification owns or allows (MMIO).
    Source
    Supported — Proofs show execution never reaches a failure state and only touches memory the specification owns or allows (MMIO).

    Effort
    Interactive
    Covers
    0 of 0 common features
    Relies on
    Isla and its SMT solver are trusted; Rocq checks the separation-logic proofs. Opcodes come from objdump output that the user trims and annotates by hand.
    Stage 0 · Research Trust: Checker partial, Semantics strong, Frontend partial, Binary gap strong, Escape hatches partial 2/5 strong
  6. LNSym on compiled code: AArch64

    Prove Armv8 (AArch64) machine code correct in Lean 4 by symbolic simulation over a hand-written model; aimed at AWS-LC cryptographic routines.

    Unknown.Proofs show no decoding error or unmodeled instruction is reached. The memory-safety part of the GCM init specification is commented out; we found no finished memory-safety proofs.
    Source
    Unknown — Proofs show no decoding error or unmodeled instruction is reached. The memory-safety part of the GCM init specification is commented out; we found no finished memory-safety proofs.

    Effort
    Interactive
    Covers
    0 of 0 common features
    Relies on
    Hand-written AArch64 subset; random co-simulation against real Arm CPUs in CI. Opcodes are pasted from objdump into Lean; not linked to the binary by a proof.
    Stage 0 · Research Trust: Checker strong, Semantics partial, Frontend partial, Binary gap strong, Escape hatches partial 2/5 strong

Ask something else about Dafny

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..

esc