Share on Facebook Tweet on Twitter Share on LinkedIn Share by email
Checking Compatibility of Bit Sizes in Floating Point Comparison Operations

Manuel Fahndrich and Francesco Logozzo

Abstract

We motivate, define and design a simple static analysis to check that comparisons of floating point values use compatible bit widths and thus compatible precision ranges. Precision mismatches arise due to the difference in bit widths of processor internal floating point registers (typically 80 or 64 bits) and their corresponding widths when stored in memory (64 or 32 bits). The analysis gurantees that floating point values from memory (i.e. array elements, instance and static fields) are not compared against floating point numbers in registers (i.e. arguments or locals).

Without such an analysis, static symbolic verification is unsound and hence may report false negatives.

The static analysis is fully implemented in Clousot, our static contract checker based on abstract interpretation.

Details

Publication typeInproceedings
Published inProceedings of the 3rd workshop on Numerical and Symbolic Abstract Domains
PublisherElectronic Proceedings in Theoretical Computer Science

Previous versions

Manuel Fahndrich and Francesco Logozzo. Static contract checking with Abstract Interpretation, Springer Verlag, October 2010.

> Publications > Checking Compatibility of Bit Sizes in Floating Point Comparison Operations