This library contains several formalizations of floating-point numbers.
- float_bounded_axiomatic: An axiomatic formalization that complies with the IEEE 754 standard
- float_ieee854: A low-level foundational formalization following the IEEE 854 Standard
- float_bounded: A high-level foundational specification which can be instantiated to provide IEEE 754 floating-points.
- float_unbounded: A high-level foundational formalization representing floating-points without upper nor lower bounds. It is also proven that a reduced version of this specification is equivalent to the one for IEEE 854 floating-point numbers.
Author: Mariano Moscato
This library presents an axiomatic formalization of the floating-point numbers defined in the 754 standard by IEEE. The formalization is parametric in the values that define a specific format according to the standard: radix (b
), precision(p
), and maximum exponent(emax
). It accepts the values defined by the standard.
binary32 | binary64 | binary128 | decimal64 | decimal128 | |
---|---|---|---|---|---|
b |
2 | 2 | 2 | 10 | 10 |
p |
24 | 53 | 113 | 16 | 34 |
emax |
127 | 1023 | 16383 | 384 | 6144 |
These parameters are present in every theory defining general aspects of the floating-point values. Some example instantiations for specific formats are provided in the theories:
ieee754_single
for binary32, andieee754_double
for binary64.
There, definitions for the specifically instantiated floating-point datatype as well as for the operations are provided for convenience of the user.
Several operations on floating-point data are specified according to the standard. At the moment, support for the following operations is provided:
ieee754_qlt
: quiet less thanieee754_qle
: quiet less or equal thanieee754_qgt
: quiet greater thanieee754_qgt
: quiet greater or equal thanieee754_qeq
: quiet equal toieee754_qun
: quiet unorderedieee754_add
: additionieee754_sub
: subtractionieee754_div
: divisionieee754_mul
: multiplicationieee754_max
: maximum (of two numbers)ieee754_min
: minimum (of two numbers)ieee754_abs
: absolute valueieee754_sqt
: square root
Nevertheless, flags and exceptions are not currently supported.
The theory ieee754_data
contains fundamental declarations and properties, such as the datatype denoting floating-point data and its special values (NaN, infinites, zeros). Properties of the fragment of the real numbers being represented by floating-point numbers are provided in the theory ieee754_domain
. The connection between both theories is established in ieee754_semantics
where notions such as rounding and projection are specified.
The theory hierarchy is shown below. The arrows depict dependencies among theories.
where op
= add
| sub
| mul
| div
| max
| min
| abs
| sqt
| qlt
| qle
| qgt
| qge
| qeq
| qun
.
- Library level
- Theory level
Author: Paul Miner
This is a hardware level model of floating-point numbers as described by the IEEE 854 Standard. See [5] for details.
- Library level
- Theory level
Author: Sylvie Boldo, Cesar Muñoz, Mariano Moscato
This formalization was initiated by Sylvie Boldo [1,2] while visiting the National Institute of Aerospace (NIA) in late 2005. It was augmented by Mariano Moscato (NIA, 2016) in order to provide support for round-off error calculations, serving as the formal support for the certificates generated by PRECiSA [3].
In mid 2019, Mariano Moscato introduced an extension of this formalization incorporating special values to the representation, namely infinities, not-a-number values, and signed zeros. This extension is parametric on the following values, which determine an specific representation format (see [2] for details).
radix
integer greater than 0precision
integer greater than 0dExp
integer greater than2*(precision-1) - 1
Note that formats equivalent to the ones defined by the IEEE 754 standard can be set by using the values shown in the table below.
single precision | double precision | |
---|---|---|
radix |
2 | 2 |
precision |
24 | 53 |
dExp |
149 | 1074 |
Instantiations for these formats are provided in the theories single
and double
. These theories should serve as the entry point to users
needing to manipulate a particular format.
The basic declarations such as the datatype denoting floating-point
numbers, the set of reals being exactly represented by them, and the
projection and rounding functions are defined in the theories:
extended_float
, extended_float_exactly_representable_reals
, and
extended_float_rounding
.
Each supported operation is defined in a separate theory:
extended_float_qlt
: quiet less-than comparisonextended_float_qgt
: quiet greater-than comparisonextended_float_qle
: quiet less-or-equal-than comparisonextended_float_qge
: quiet greater-or-equal-than comparisonextended_float_qeq
: quiet equal-to comparisonextended_float_qun
: quiet unordered comparisonextended_float_add
: additionextended_float_sub
: subtractionextended_float_mul
: multiplicationextended_float_div
: divisionextended_float_max
: maximum of two valuesextended_float_min
: minimum of two valuesextended_float_sqt
: square rootextended_float_abs
: absolute value
These theories depends on ieee754_operation_scheme__binary
,
ieee754_operation_scheme__unary
, and
ieee754_predicate_scheme__binary
, which defines how an arbitrary
function or predicate on floating-points should be defined according
to the IEEE754 standard.
- Library level
- Theory level (float_bounded)
- Theory level (float_unbounded)
- Mariano Moscato, NASA Langley Formal Methods Team, USA
- Paul Miner, NASA Langley Formal Methods Team, USA
- Sylvie Boldo, INRIA, France
- César Muñoz, NASA Langley Formal Methods Team, USA
- Laura Titolo, NASA Langley Formal Methods Team, USA
- Sam Owre, SRI, USA
- Mariano Moscato, NIA & NASA, USA
[1] S. Boldo, Preuves formelles en arithmétiques a virgule flottante, PhD. Thesis, Ecole Normale Supérieure de Lyon, 2004.
[2] Sylvie Boldo and César Muñoz. (2006). A High-Level Formalization of Floating-Point Numbers in PVS. Contractor Report NASA/CR-2006-214298. NASA Langley Research Center, Hampton VA 23681-2199, USA.
[3] Moscato, M., Titolo, L., Dutle, A., & Munoz, C. A. (2017). Automatic estimation of verified floating-point round-off errors via static analysis. In International Conference on Computer Safety, Reliability, and Security (pp. 213-229). Springer, Cham.
[4] Owre, Sam, Natarajan Shankar, and Ricky W. Butler. (2001). Theory interpretations in PVS. ContractorReport NASA/CR-2001-211024. NASA Langley Research Center, Hampton VA23681-2199, USA.
[5] P. Miner, Defining the IEEE-854 floating-point standard in PVS, NASA/TM-95-110167, NASA Langley Research Center, 1995.
[*] This work has been partially funded by NASA LaRC under the Research Cooperative Agreement No. NCC-1-02043 awarded to the National Institute of Aerospace, and the French CNRS under PICS 2533 awarded to the Laboratoire de l'Informatique du Parallélisme.