Verifying Floating-Point Programs in Stainless

πŸ“… 2026-01-20
πŸ“ˆ Citations: 0
✨ Influential: 0
πŸ“„ PDF

career value

141K/year
πŸ€– AI Summary
This work addresses the challenge of automated formal verification for higher-order, recursive, and polymorphic Scala programs involving floating-point arithmeticβ€”a task that existing tools struggle to support. We present the first comprehensive integration of floating-point reasoning into the Stainless deductive verifier for Scala. Our approach axiomatically models all standard math library functions and incorporates built-in mechanisms to validate the consistency between these axioms and their actual implementations. The framework fully supports polymorphism, recursion, and higher-order functions, combining formal specifications with counterexample generation. Evaluated on real-world GitHub codebases, it successfully verifies critical properties such as output range bounds and the absence of NaN or infinity values, or automatically produces counterexamples when violations occur, thereby substantially advancing the verifiability of floating-point functional programs.

Technology Category

Application Category

πŸ“ Abstract
We extend the Stainless deductive verifier with floating-point support, providing the first automated verification support for floating-point numbers for a subset of Scala that includes polymorphism, recursion and higher-order functions. We follow the recent approach in the KeY verifier to axiomatise reasoning about mathematical functions, but go further by supporting all functions from Scala's math API, and by verifying the correctness of the axioms against the actual implementation in Stainless itself. We validate Stainless'floating-point support on a new set of benchmarks sampled from real-world code from GitHub, showing that it can verify specifications about, e.g., ranges of output or absence of special values for most supported functions, or produce counter-examples when the specifications do not hold.
Problem

Research questions and friction points this paper is trying to address.

floating-point verification
automated verification
formal methods
program correctness
Scala
Innovation

Methods, ideas, or system contributions that make the work stand out.

floating-point verification
deductive verification
axiomatization
Scala
formal methods
πŸ”Ž Similar Papers