<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Real Behavior of Floating Point Numbers *</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Bruno Marre</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Francois Bobot</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Zakaria Chihani</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>CEA LIST, Software Security Lab</institution>
          ,
          <addr-line>Gif-sur-Yvette</addr-line>
          ,
          <country country="FR">France (</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>We present an e cient constraint programming (CP) approach to the SMTLIB theory of quanti er-free oating-point arithmetic (QF FP). We rely on dense interreduction between many domain representations to greatly reduce the search space. We compare our tool to current state-of-the-art SMT solvers and show that it is consistently better on large problems involving non-linear arithmetic operations (for which bit-blasting techniques tend to scale badly). Our results emphasize the importance of the conservation of the high-level structure of the original problems.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>Context. A few decades ago, formal program veri cation was born amidst vivid criticism
and mitigated support. Even brilliant minds deemed it \bound to fail" [23], concluding their
controversial paper saying that if, despite all their reasons, \veri cation still seems an avenue
worth exploring, so be it". And so it was. Today, software veri cation is a well established eld
of research, and industrial adoption has been achieved in some key areas, such as safety-critical
and embedded systems.</p>
      <p>Software veri cation o ers a means to ensure correctness of a program with respect to some
formal speci cation by delegating proof obligations to solvers and theorem provers. The main
challenge of this method is to give to the solvers the ability to reason about basic datatypes
encountered in everyday programs such as strings, integers, bit-vectors, oating-point numbers,
etc.</p>
      <p>
        Floating-point arithmetic. Machine memory being nite, oating-point numbers tackle a
di cult problem: representing real numbers. It is an old invention that predates computers
(used in 1914), standardized in early 1980 as the IEEE-754 [
        <xref ref-type="bibr" rid="ref16">18</xref>
        ]. Despite their ubiquity,
reasoning about oating-point numbers (FPNums) is tricky due to the regular approximations usually
involved with oating-point operations (FPOp).
      </p>
      <p>Consider, for example, that 1: +: 2100 = 2100, indeed in double precision format the
oatingpoint representation (FPRep) of 2100 absorbs all values between −246 and 247. Furthermore,
10
we have the following counter-intuitive truth: ³0¹:¹¹1¹¹¹¹¹¹+¹¹¹¹¹¹¹¹¹¹·¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹¹µ
: : : : +: 0:1 =~ 0:1 ×: 10: = 1: because 0:1 is
not representable as a binary FPNum. However the semantics of FPOp, given by IEEE-754,
are clear: the result of a FPOp is the result of the rounding o of the real operator result, i.e.,
x +: y = o(x + y) [24, Section 2.2.1]. Unless otherwise speci ed, all the results presented in
this paper are valid for each individual rounding mode, therefore we omit them as a parameter
of the o symbol. For concision, we also write the oating-points (FP) operators with their
mathematical notation subscripted with f (i.e., &lt;f for fp:leq, ≥f for fp:geq, etc.).</p>
      <p>*Work partially funded by ANR-14-CE28-0020 grant. The CP solver COLIBRI is generously sponsored by
IRSN, the French Institute for Radioprotection and Nuclear Safety.
Methodology. Several approaches, discussed in the following related work section, are used
to deal with oating-point numbers and arithmetic, ranging from satis ability modulo
theory (SMT) to constraint programming (CP) e orts, and include interactive theorem provers.
This paper, through comparison with state-of-the-art solvers, will show the advantages of our
approach, speci cally in terms of scalability and theory combination.</p>
      <p>
        Proposal and contributions. We tackle the problem of solving quanti er-free oating-point
arithmetic problems, also called QF FPA or QF FP [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. Henceforth, we use the latter. In
particular, we now list the novelties of our approach before detailing them in the following
sections:
      </p>
      <p>The CP approach allows attributing to a variable several domain representations
(integer intervals, known bits, FPNums interval). The domain of a variable is an
overapproximation of the set of values the variable could take. We use union of intervals,
presented below, to maintain a more extensive disjunctive knowledge and additional ways
to restrict the search for solution.</p>
      <p>A relational attribute is associated to our variables through di erence logic [16] (also
known as Di erence-Bound Matrices, or DBM in the SMT community), where a FP
tailor-made distance between variables is recorded.</p>
      <p>The monotonicity property of rounding allows to propagate information from one edge to
another of then the di erence logic global constraints.</p>
      <p>
        A link with a bit-vector domain (see our previous work on CP(BV) [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] allows us to
treat type casts and reinterpretation between FP and BV. Furthermore we handle casts
between FP and Real (cf. g. 1a).
      </p>
      <p>Preserving the original high-level structure (no blasting of FP variable), we intertwine
constraint propagation with simpli cations and factorizations that rely on identi ed
algebraic properties of FPNums. This is in contrast to most SMT solvers where these
simpli cations are limited to a preprocessing step.</p>
      <p>Finally, we implement all these novelties in the solver COLIBRI1. Note that the above
reasonings are implemented mainly for nearest even rounding, the other roundings currently
feature only domain propagations. Moreover only simple and double precision FPNums
format are supported.</p>
      <p>After looking at the related work and background, the paper presents the di erent domains
used in COLIBRI to handle QF FP, then the propagations applied on each of them, follows
the communications between domains, and nally discusses some aspects of the search.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Related Work</title>
      <p>
        Several approaches are explored when it comes to FP. In the SMT community, few solvers [
        <xref ref-type="bibr" rid="ref11 ref15">15,
11</xref>
        ] can handle QF FP. A common approach in the SMT solvers is to use a attening called
bit-blasting [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. This Boolean encoding allows to delegate to powerful SAT solvers but looses
high-level structure of the original problems and scales extremely poorly for some common
1freely available for test, evaluation, educational purposes or internal research purposes only at http://
soprano-project.fr/software.html
problems involving non-linear operators over 64-bits FP. Our experimentation section shows
interesting results compared to bit-blasting approaches on QF FP.
      </p>
      <p>We also mention the interactive prover Gappa, which is able to verify preservation of
numerical properties, relating FP and real numbers. The Gappa tool reasons on real numbers
operations then explicitly applies rounding (i.e., FP operators are interpreted as the rounding
of real number operators). However, NaN and In nities are not supported by Gappa. They are
supported in our tool.</p>
      <p>
        Alt-Ergo, a non-bit-blasting SMT solver, is based on Congruence Closure parametrized by
a Shostak theory X. For FP it uses built-in support for rounding operators on constants and
axioms with semantic triggers for the general case [
        <xref ref-type="bibr" rid="ref12 ref13">13, 12</xref>
        ]. This tool combines the force of
the Gappa tool (saturation of consequences of the axioms) and a constraint solver for linear
arithmetic. Like Gappa, this tool lacks built-in support for NaN and In nities, which prevents
it from treating most of the SMT competition benchmarks.
      </p>
      <p>
        But perhaps the closest e ort to our paper is the CP solver FPCS based on exact projection
functions for FP constraints [22]. It performs powerful linearization techniques[
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. The FPCS
solver is a strict subset of ours: it does not perform simpli cation and factorization, it has only
one domain (FP) whereas our solver relies on interreduction between BV, Real, Int, congruence
and global di erence constraints.
      </p>
      <p>The di erence between propagation in the CP community and learning in the SMT
community is known. Although our experimentations seem to cautiously indicate that, in the case of
QF FP, propagation and interreduction on high-level FP domain is more e cient than learning
on low-level bit-blasted FP, the disparity, in our opinion, is due more to the high/low level
opposition than to the propagation/learning opposition. Several CP related e orts are investigating
learning possibilities, though not in FP, to our knowledge. We cite the encouraging e orts of
Lazy Clause Generation [25] and Learning General Constraints in CSP [27]. We also believe
that the abstract CDCL learning, on the SMT side[9], can spawn possible similarly inspired
methods on the CP side.
3</p>
    </sec>
    <sec id="sec-3">
      <title>Background</title>
      <p>This section exhibits the ground on which we carried out the research we discuss in this paper,
and introduces QF FP.</p>
      <p>
        COLIBRI Initially developed, in ECLiPSe Prolog2, to assist CEA3 veri cation tools [
        <xref ref-type="bibr" rid="ref2 ref20 ref5">5, 28,
2, 14</xref>
        ], the COLIBRI CP solver [
        <xref ref-type="bibr" rid="ref18">20</xref>
        ] supports bounded integers (both standard and modular
arithmetic [17]), reals, global di erence constraints [16], and more recently bit-vectors [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ].
Since its inception, it enjoyed some measure of treatment for FP [
        <xref ref-type="bibr" rid="ref19">21</xref>
        ]. COLIBRI handles
communications between all these theories: Real, Int, BV, FP. This paper focuses on the novel
improvements, both theoretical and practical, that allowed this tool to surpass many
state-ofthe-art solvers.
      </p>
      <p>
        QF FP theory. We consider in this paper the semantics of oating-point arithmetic as
dened by the IEEE754-2008 standard and as supported by the SMT-LIB2.5 standard [
        <xref ref-type="bibr" rid="ref22 ref8">26, 8</xref>
        ]. In
addition to FPOps, the standard also de nes type casts, rounding, and unde ned behaviours.
The set of FPNums without NaN is denoted by F .
      </p>
      <p>2http://eclipseclp.org/
3French Atomic Energy Commission
4
4.1</p>
    </sec>
    <sec id="sec-4">
      <title>CP for FP arithmetic</title>
      <sec id="sec-4-1">
        <title>Domain representation</title>
        <p>
          Handling NaNs. One of the many de nitions xed by the IEEE 754 standard [
          <xref ref-type="bibr" rid="ref16">18</xref>
          ] is the
constant NaN, indicating an unrepresentable value (a division of zero by zero, square roots of
negative numbers, etc.). It is generally not desirable to generate these values, especially in
the context of critical systems. A solver must, as COLIBRI does, not only propagate NaNs
throughout any arithmetic or comparison operator but also manage the contexts where a NaN
could be generated. In the particular case of fp:max and fp:min if an argument is known to be
NaN the result is uni ed with the other argument. In particular, a NaN falsi es any comparison
operator (a consequence is that FP equality is not re exive, because not (fp.eq NaN NaN)).
Conversely, if a comparison is known to hold, its operands cannot be NaNs.
        </p>
        <p>A FP variable is associated with a Boolean ag that is set if the variable is considered NaN.
Until NaN is an impossible value for all the arguments and the result of a constraint, no other
propagation is done on it; it is blocked.</p>
        <p>Handling partial functions The cast functions from FPNums to integers and reals have no
meaning for {NaN; +∞; −∞}. Since the logic used only handles total functions, the SMT-LIB
accepts any interpretation for these unde ned terms that are considered as uninterpreted. This
does not mean that each prover can choose a di erent value for fp.to_ubv NaN, but that the
problem is satis able if it is true for some valuation of the variable and a choice of interpretation
for these unde ned terms. In COLIBRI the possibility of these unde ned terms are handled by
rst waiting for the argument to be in the domain of de nition through propagation, labelling
or domain splitting of the argument before doing any propagation of the constraint. During
this period, functions applied to the same arguments are factorized, i.e., congruence closure is
applied.</p>
        <p>In all the remainder of the paper, we suppose that no NaN could appear since we discuss the
propagation only on unblocked constraints.</p>
        <p>Integral status. For concision let rti be a shorthand for fp roundToIntegral. A FP
number f is integral when f is nite and it satis es rti(RT N; f ) = rti(RT P; f ), i.e., it can be
interpreted as an integer. Let isintegral be a predicate that checks if a FPNum is
integral. Constraints involving only FPNums with integral status can sometimes rely on all the
integer-related machinery involved in the solving process of COLIBRI, and their result is also
integral. This delegation is made possible by the open-box dense communication o ered by the
CP framework. A FP variable is thus associated with a ag that is set if the variable is known
to be integral. If casts are not available, then it would still be useful for program speci cations
to let users specify that a FPNum is integral.</p>
        <p>Union of intervals. The classical representation of the domain of FP variable f is through
a pair of two FPNums a, b s.t. a ≤ f ≤ b. Since the FP domain is discrete, only closed intervals
are needed. However, FP programs often use tests of the form abs(f) &gt; instead of comparing
f to 0:0. This is because a test that is true using greater than the computation error would
also be true for the real comparison. Moreover many FP program speci cations are expressed
as a bound between the computation with FP and the computation with real.</p>
        <p>Considering the above cases, one understands the importance of allowing gaps in the
intervals, or equivalently, to use a disjoint union ⊎ of intervals. This domain can represent
−∞,+∞,−0:,+0: (unless, of course, the NaN ag is set). The backward and forward
propagations on simple intervals naturally extend to unions of intervals by propagating pairwise on the
intervals. For example with x ∈ [1:; 4:] ⊎ [5:; 7:], y ∈ [2:; 3:] ⊎ [10:; 11:], x + y = z the
propagation computes that z ∈ [3:; 7:] ∪ [7:; 10:] ∪ [11:; 15:] ∪ [15:; 18:] = [3:; 10:] ⊎ [11:; 18:]. If one
knows an order on the variable, for example x ≤ y, some pairs of intervals can be ltered
or re ned. For example when x ≤ y, it is impossible to have x ∈ [5:; 7:] and y ∈ [2:; 3:]
simultaneously. The same goes for x ∈ [3:+; 4:] and y ∈ [2:; 3:] (3:+ is the successor of 3:). So
z ∈ [3:; 6:] ∪ [11:; 15:] ∪ [15:; 18:] = [3:; 6:] ⊎ [11:; 18:].</p>
        <p>Di erence constraints The di erence constraints keep for each variable the distance with
other variables using an interval. We call them deltas henceforth. The distance could be
expressed as the distance in rationals but usual representation of rationals are not e cient
(big integers for numerator and denominator, for example the FPNum 21024 contains lot of
zero words). Contrary to rationals there are a nite number of FPNums. In fact for positive
FPNums they can be associated with integer using the reinterpretation (not cast) of FPNum
to bitvectors. For negative FPNum it is not direct because they are not 2's complement and
we identify −0 and +0 with a distance of 0.</p>
        <p>Formally for x ∈ F , num(x) is de ned by
⎪⎪⎧−S {z ∈ F Sx ≤f z &lt;f 0} S
⎪
⎪
num(x) = ⎨ S {z ∈ F S0 &lt;f z ≤f x} S
⎪
⎪⎪⎪0
⎩
when x &lt; −0
when + 0 &lt; x
when x ∈ {−0; +0}
where S ⋅ S is the cardinality function. The oating-point distance dF is then de ned simply by
dF (x; y) = num(y) − num(x):</p>
        <p>This distance is a good representation of multiplication by two of a normal number without
over ow, this is just an increment of the exponent. In that case the distance is exactly the size
of a binade (a set of FPNums with the same exponent). Note the linear approximation used
by COLIBRI (section 4.2.3) uses the other distance in rational, which is better for representing
additions with constants. Thus the deltas and the linear approximation will bene t from each
other.</p>
        <p>A distance graph is also used for reals and bitvectors.
4.2</p>
      </sec>
      <sec id="sec-4-2">
        <title>Propagations</title>
        <p>We rst focus on the propagation inside each domain. Starting with direct propagation in the
interval domain, then a speci c handling of di erence logic for FPNums, nally a relaxation
method to use a rational simplex for FPNums constraints.
4.2.1</p>
        <sec id="sec-4-2-1">
          <title>Domain propagation</title>
          <p>Our AdaCore partner provided numerous oating-point examples coming from problems found
by their customers. These examples are code fragments that they were unable to prove with
their current automatic provers, which compelled them to add those fragments as user de ned
axioms. We show here the mathematical version of these Ada programs.</p>
          <p>(−0 ≤f x ≤f 16777216:0) ∧ (−0 ≤f y ≤f 16777216:0) ∧ (−0 ≤f z) ⇒ −fp:mul(x; y) ≤f z</p>
          <p>Domain propagation is at the heart of constraint programming, on which COLIBRI is based.
It consists in associating domains to each term, here a disjoint union of oating-point intervals
and a Boolean domain, and to each function f a design function that continuously improves
domains of x, y, and f (x; y) using the domain of the other terms.</p>
          <p>In this example, initially, the domains of Boolean terms are in {; ⊺} and the domains of
all the oating-point terms are [−∞; +∞], COLIBRI handles in nite and nite FPNums (32
bits and 64 bits with all rounding modes. With the exception of nearest-to-even rounding,
reasoning with other roundings is rather minimal in COLIBRI). The domain of the conclusion
−fp:mul(x; y) ≤f z is set to {} and COLIBRI looks for a counter-example. If none exists, then
the property is valid.</p>
          <p>The hypothesis restrains the domains of the variables to x; y ∈ [−0; 16777216:0], z ∈ [−0; +∞].
The propagators then improve successively the following domains:</p>
          <p>fp:mul(x; y) ∈[+0; 281474976710656:]
−fp:mul(x; y) ∈[−281474976710656:; −0]
(−fp:mul(x; y) ≤f z) ∈{⊺}:</p>
          <p>The last line contradicts the initial setting to  of the relation, so the domain of the relation
is empty. An empty domain means a con ict, which excludes the existence of a counter-example:
the property is proved.</p>
          <p>The propagators used in this example are called forward propagators since they improve
the knowledge on the result using the knowledge on the arguments. These propagators use the
property of part-wise monotonicity of the functions.</p>
          <p>If the propagators are executed in another order (mostly non-deterministic), backward
propagators will be used. Let s be the next FPNum after +0, i.e., the smallest positive subnormal
number:
(−fp:mul(x; y) ≤f z) ∈{}
−fp:mul(x; y) ∈[s; +∞]
fp:mul(x; y) ∈[−∞ − ]</p>
          <p>; s
fp:mul(x; y) ∈([−∞; −s] ∩ [+0; 281474976710656:]):
This also leads to an empty domain.</p>
          <p>Albeit simple, these propagators make it possible to prove an important part of the proof
obligations that were not provable with an axiomatic approach, because they require the ability
to compute operators on oating-point constants.</p>
          <p>
            COLIBRI uses other propagators [
            <xref ref-type="bibr" rid="ref1 ref19">21, 1</xref>
            ] that rely on properties other than monotonicity.
Contrary to rationals, the result of a oating-point subtraction strongly limits the ranges of
its arguments. For example, starting with x; y ∈ [+0; 1000] and the constraint fp:sub(x; y) =
o(0:1) ≃ 0:10000000149 (in simple format), the above propagators applied once do not reduce
the domains signi cantly. The intervals would become x ∈ [o(0:1); 1000], y ∈ [0; 1000]. With
the new propagations [
            <xref ref-type="bibr" rid="ref1 ref19">21, 1</xref>
            ] however, the intervals get restricted to x ∈ [o(0:1); o(0:225)] and
y ∈ [+0; o(0:12499999)].
          </p>
          <p>COLIBRI has also other, more relational, propagators. For example, from the knowledge
that an argument is equal to the result, if x; y ∈ [0; 1024] and y = x + y, then it can infer
x ∈ [0; 2−14] because x must be small enough in order to be absorbed by y.</p>
          <p>These propagations are local in that they involve only one constraint.
4.2.2</p>
        </sec>
        <sec id="sec-4-2-2">
          <title>Di erence constraints</title>
          <p>Populating the deltas often exhibits early on unsatis abilities that would be otherwise detected
late, loosing e ciency. Such detections can take place through monotonicity, type cast and
rounding. We discuss this in the following.</p>
          <p>Through monotonicity. There are multiple lemmas that are widely known to computer
arithmeticians, but strangely scarcely used in automated oating-point reasoning. We rely on
the following such lemmas.</p>
          <p>Lemma 4.1.</p>
          <p>∀x; y; z ∈ F ; 0 &lt;f y ⇒ fp:div(x; y) &lt;f z ⇒ x ≤f fp:mul(z; y)
Thus we can use the following implications:
fp:add(A; B) &gt;f C ⇒ A ≥f fp:sub(C; B)
fp:sqrt(A) &gt;f C ⇒ A ≥f fp:mul(C; C)
fp:add(A; B) &lt;f C ⇒ A ≤f fp:sub(C; B)
fp:sqrt(A) &lt;f C ⇒ A ≤f fp:mul(C; C)
which we justify as follows in the nite case (the non nite case where NaN cannot appear is
trivial). Consider that, according to the IEEE standard, fp:add(A; B) = o(A + B). Further
consider that through monotonicity of the rounding o, o(A + B) &gt; C implies, A + B &gt; C, leading
us to conclude A &gt; C − B which, by rounding, gives A ≥ o(C − B). The latter corresponds to the
non-strict inequality A ≥f fp:sub(C; B). For example, COLIBRI uses this results if the deltas
also know that A &lt;f fp:sub(C; B), it can immediately detect unsatis ability, and if it knows
that A ≤f fp:sub(C; B), it can deduce that A = fp:sub(C; B).</p>
          <p>By exploiting monotonicity, other inequalities can be deduced:
⎧⎪fp:add(A; X) ≥f fp:add(A; Y )
⎪
⎪
X &gt;f Y ⇒ ⎨⎪fp:sub(A; X) ≤f fp:sub(A; Y )
⎪
⎪⎪⎪fp:sqrt(X) ≥f fp:sqrt(Y )
⎩</p>
          <p>Similar implications can be valid for the operators fp:mul and fp:div depending on the sign
of their operands and whether they are decreasing or increasing (absolute value is greater or
less than 1) to orient the resulting non-strict equality.</p>
          <p>Notice that when the operations are exact strictness of inequalities is preserved. For example,
proving the unsatis ability of X ≤f Y ∧ Y &gt;f 0:0 ∧ fp:div(X; Y ) &gt;f 1:0 when X, Y and
fp:div(X; Y ) are nite can be reached through the following steps: deduce o( XY ) &gt; o(1:0)
since 1:0 ∈ F , then XY &gt; 1:0 and X &gt; Y since Y &gt; 0, which contradicts X ≤ Y .
Lemma 4.2. Let D; E ⊂ R, f ∶ D ↦ E and f −1 ∶ E ↦ D such that:
∀x ∶ D; f −1(f (x)) = x and f is monotonically increasing. Then we have
∀x ∈ D; o(y) ∈ E; o(f (x)) &lt; o(y) ⇒ o(x) ≤ o(f −1(o(y))),
∀x ∈ D; y ∈ E; o(f (x)) &lt; o(f (y)) ⇒ x &lt; y.</p>
          <p>
            Lemma 4.3. Let x; y; z ∈ R and n a natural number, if 0 &lt; y, and 2n &lt; o  oo((xy))  we have
o(2n × y) &lt; o(x)
For example, through lemma 4.3 then lemma 4.2 with the function t ↦ x − t, we can prove :
o(x − y)
(z ≥ 0:0) ∧ (x ≥ y) ∧ (y ≥ z) ∧ (x &gt; z) ∧ (a ≥ 1:0) ⇒ o  o(x − z)  ≤ a
Lemma 4.4. Let x ∈ F , such that fp:mul(x; x) is a normal number, then the oating-point
square root is the inverse of the square function: fp:sqrt (fp:mul(x; x)) = fp:abs(x) [
            <xref ref-type="bibr" rid="ref7">7</xref>
            ].
          </p>
          <p>The next example of AdaCore (User_Rule_16) is interesting because it is false and involves
the square root function. The formula to prove unsatis able is
»
(x ∈ [−7800; +7800]) ∧ (y ∈ [−7800; +7800]) ∧ (x &gt; SyS) ∧ o  o (o(x2) − o(y2)) &gt; x
Using lemma 4.2, we have the relation o o(x2) − o(y2) ≥ o(x2), since 0 ≤ o(y2) we get that
»
it is an equality. So o  o (o(x2)) &gt; x, which implies by interval domain propagation that
x ∈ [2−537:5; 7800−], and by deciding on the bounds (section 4.4) we nd that x = 2−537:5 is a
counter-example. If the formula contained the additional hypothesis that x &gt;= 0:000001, then
o(x2) is a normal number and lemma 4.4 implies that x &gt; x, unsatis able.</p>
          <p>
            Other examples of applications of the lemmas above can be found in the tech report[
            <xref ref-type="bibr" rid="ref6">6</xref>
            ].
Through rounding. Let F be a non-NaN oating-point number, the following properties are
true for all rounding mode r ∈ {RNE; RNA; RTP; RTN; RTZ} :
          </p>
          <p>F ≥ 0:0 ⇒rti(RTZ; F ) ≤ F</p>
          <p>rti(RTN; F ) ≤ F</p>
          <p>F ≤ 0:0 ⇒rti(RTZ; F ) ≥ F
rti(r; F ) = F ⇐⇒(fp:isInfinite(F ) ∨ isintegral(F ))
rti(RTN; F ) = rti(RTP; F ) ⇒(fp:isInfinite(F ) ∨ isintegral(F ))
rti(RTP; F ) ≥ F
Through type cast. The integral status used above is xed by the casting operators from
integer to FPNums. This status is propagated through operators uop ∈ {fp:neg; fp:abs} and
op ∈ {fp:add; fp:sub; fp:mul}:
fp:isFinite(fp:to fp(r; I)) ⇒isintegral(fp:to fp(r; I))</p>
          <p>isintegral(F ) ⇒isintegral(uop(F ))
isintegral(F1) ∧ isintegral(F2) ∧ fp:isFinite(op(F1; F2) ⇒isintegral(op(F1; F2))
If the FP arguments and result of an operation op ∈ {fp:add; fp:sub; fp:mul} are of an integral
status and if they are representable exactly (e.g., fp:abs(F ) ≤f 2m where m is the size of
the mantissa), then the treatment of op can be delegated to the integer domain machinery,
opi ∈ {bv add; bv sub; bv mul}, r a rounding mode.</p>
          <p>isintegral(F1)⎫⎪
⎪
⎪
⎪
isintegral(F2)⎪⎪⎪</p>
          <p>⎪
fp:abs(F1) ≤f 2m⎪⎪⎪</p>
          <p>⎪
m⎪⎬ op(r; F1; F2) = fp:to fp(r; opi(fp:to sbv(r; F1); fp:to sbv(r; F2)))
fp:abs(F2) ≤f 2 ⎪</p>
          <p>⎪
fp:abs(op(r; F1; F2)) ≤f 2m⎪⎪⎪⎪
⎪
⎪
⎪
⎪
⎪
¬fp:isZero(op(r; F1; F2))⎪⎭⎪
À
Δ
Ã
D</p>
          <p>Int/BV
Δ
D
Å
Â
Ä
D
Á
Δ
FP</p>
          <p>Real
(a) Interreductions</p>
          <p>
            60
Linearization of oating-point arithmetic formulas has been presented in [
            <xref ref-type="bibr" rid="ref3">3</xref>
            ]. The goal is to
transform relations on oating-point formulas to relations on linear rational formulas by
relaxation, and so to be able to use a simplex. The idea is to use already known techniques on
linearization of rational arithmetic formulas to linear one and to add the linearization of the
rounding operator o.
          </p>
          <p>The main idea for the linearization of o is that if x ∈ R is in the range of normal positive
FPNum with double precision:</p>
          <p>For each operation with nite argument we add a constraint that bound the relative error
between the oating-point operation and the operation on reals using the current domain of
the arguments.</p>
          <p>The addition of this technique makes immediate the proof of the following example:
(0: ≤f x ≤f 10:0) ∧ (0: ≤f y ≤f 10:0) ⇒</p>
          <p>fp:sub(RNE; fp:sub(RNE; fp:add(RNE; x; y); x); y) ≤f 0:0001</p>
          <p>The simplex is costly so the distance graph is used in COLIBRI to know when it is interesting
to use the linearization and on which part of the problem. On the Griggio Benchmark it shows
a signi cant gain.
4.3</p>
        </sec>
      </sec>
      <sec id="sec-4-3">
        <title>Interreduction, Simpli cations</title>
        <p>
          The available interreductions are pervasive as shown in g. 1a. The simplest Ã, Ä, Å are
forward and backward propagators of cast constraints (rounding, truncation, ...) on the interval
domains. More particular is the setting of the integral status for casts from Int to FP Ã and the
propagation between the bit-vector domain [
          <xref ref-type="bibr" rid="ref10">10</xref>
          ] and the IEEE representation of oats. These
propagations are able to share information between the intervals of FPNums, the integral status
and the bit-vector domain which tells which bits are known.
        </p>
        <p>The di erent delta domains also communicate À, Á, Â by propagating the distance of one
edge (e.g., dF (x; x′)) to the corresponding casted edge (e.g., Sfp:to sbv(x) − fp:to sbv(x′)S).
Currently the propagation is coarse by only propagating if the distance is positive,
positive-ornull, negative, negative-or-null. The other casts fp:to real; to fp; ::: are treated the same way
and not only by using the same cast in both ways but also by coming back using the cast in
the other way.</p>
        <p>COLIBRI does congruence closure, which is not common in CP, for the operators taking
into account speci c algebraic properties (commutativity, (a + (−b)) = a − b, ...). Simpli cations
corresponds to replacing a constraint by another. Simpli cations are more numerous and use
domains information: replacing a constraint by its argument that absorbs the other, replacing
composition of cast to and from integer by identity when the FPNum is known to be integral,
replacing a constraint on FPNums known to be integral into the equivalent integer constraint
(delegation).
4.4</p>
      </sec>
      <sec id="sec-4-4">
        <title>Decisions</title>
        <p>COLIBRI uses classical heuristics of the CP community, for both the variable choice and the
domain splitting. We brie y highlight some of the procedures for the latter to give an insight:
if a FP union of intervals contains more than one interval, pick the interval containing the
smallest absolute value. If the union of intervals contains a single interval, then split on the
zero value, if it is in that interval (thus creating two intervals, one positive and one negative).
If the zero is not contained in that interval, pick one of the bounds (upper or lower). Then try
a random value.</p>
        <p>Note that COLIBRI does not do any con ict analysis or learning.
5</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>Conclusion and future work</title>
      <p>unsat/sat
COLIBRI
no simplex
no delta
MathSAT
ACDCL</p>
      <p>Z3</p>
      <p>COLIBRI</p>
      <p>2 / 8
4 /11
1 / 7
0 / 2
1 / 4
no simplex
18/ 0</p>
      <p>9 / 4
17/ 6
0 / 2
18/ 3
no delta
15/ 2
4 / 3</p>
      <p>12/ 7
0 / 2
14/ 5</p>
      <p>MathSAT
21/21
21/28
21/30</p>
      <p>1 / 5
7 / 7</p>
      <p>ACDCL
81/49
65/57
70/58
62/38</p>
      <p>66/24</p>
      <p>Z3
19/33
20/40
21/43
5 /22
3 / 6</p>
      <p>In this paper we described an e cient CP-based approach for solving QF FP problems,
bringing forth an accessible tool, COLIBRI, and improving the capabilities of veri cation of
programs that use oating-point data types. This work exhibits, in particular, the advantage
of the natural interreduction machinery o ered by Constraint Programming. While the
verication community generally relies on the SMT framework, we explore and demonstrate the
feasibility of an e cient alternative CP approach. Theory combination is also obtained through
communications with bit-vectors, integers and reals.</p>
      <p>
        We made a comparison4 of FP solvers on SMTLIB 2017 Griggio and Schanda's benchmarks
in g. 1b and g. 2; "no simplex" is COLIBRI without the simplex and linearization, "no delta"
4available at https://www.starexec.org/starexec/secure/details/job.jsp?id=21872
is COLIBRI no simplex without the domain of deltas and ACDCL is MathSAT with option
-theory.fp.mode=2. It shows a clear advantage of COLIBRI techniques with 196 problems
solved against 162 for MathSAT with a timeout of 1min. In our practice for program veri cation
a timeout of more than 10s is rare. Results with a greater timeout will be available at the SMT
competition 2017 where COLIBRI participates. On Schanda's benchmarks deltas help solve 10
problems. In [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] benchmarks showed that COLIBRI solved all the QF_BVFP examples of 2016
except one in 0.26s (around its start-up time).
      </p>
      <p>Surprisingly COLIBRI no delta proves nearly as many goals as COLIBRI, g. 2 shows
that COLIBRI no delta is better at proving satis ability and COLIBRI is better at proving
unsatis ability, a possible reason is that taking time to remove values for proving unsatis ability
is an overhead when the solution is just to nd one value. We will look at improving the
performance of the deltas.</p>
      <p>The immediate next step seems to be investigating the benchmarks that reached timeout
and understand how to solve them. We also plan on increasing the precision of our projections.
Furthermore, COLIBRI currently propagates only from oating-point interval domains to deltas
but not the converse, we would like to remove these restrictions. Following ideas in Gappa,
we can extend the integral status with the @FIX(f; p) predicate, indicating when f veri es
∃ z ∈ Z: f = z:2p, which can also be seen as rational congruence in the reals. We would like also
to extend COLIBRI to other parts of the SMTLIB, uninterpreted functions and quanti ers.</p>
      <p>The techniques described in this paper are of course not limited to the CP world. They could
be put inside a black box inside an SMT solver using any combination techniques, however the
combination with other theories like bitvectors or reals is going to be restricted. Perhaps using
new frameworks like MC-sat [19], it will be possible to overcome these di culties and share the
advantage of both worlds.
C. Michel. \Exact Projection Functions for Floating-Point Number Constraints". In:
International Symposium on Arti cial Intelligence and Mathematics, AI&amp;M 2002, Fort
Lauderdale, Florida, USA, January 2-4, 2002. 2002.</p>
      <p>R. A. D. Millo, R. J. Lipton, and A. J. Perlis. \Social Processes and Proofs of Theorems
and Programs". In: 1979.</p>
      <p>T. Feydy, A. Schutt, and P. J. Stuckey. \Global Di erence Constraint Propagation for
Finite Domain Solvers". In: PPDP. 2008.</p>
      <p>A. Gotlieb, M. Leconte, and B. Marre. \Constraint Solving on Modular Integers". In: 2010.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>R.</given-names>
            <surname>Bagnara</surname>
          </string-name>
          et al. \
          <article-title>Filtering Floating-Point Constraints by Maximum ULP"</article-title>
          . In: vol.
          <source>abs/1308.3847</source>
          .
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>S.</given-names>
            <surname>Bardin</surname>
          </string-name>
          and
          <string-name>
            <given-names>P.</given-names>
            <surname>Herrmann</surname>
          </string-name>
          . \OSMOSE:
          <article-title>Automatic Structural Testing of Executables"</article-title>
          .
          <source>In: Softw. Test. Verif. Reliab. 21.1</source>
          (
          <year>2011</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>M. S.</given-names>
            <surname>Belaid</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Michel</surname>
          </string-name>
          , and
          <string-name>
            <given-names>M.</given-names>
            <surname>Rueher</surname>
          </string-name>
          . \
          <article-title>Boosting Local Consistency Algorithms over Floating-point Numbers"</article-title>
          .
          <source>In: Proceedings of the 18th International Conference on Principles and Practice of Constraint Programming</source>
          .
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>A.</given-names>
            <surname>Biere</surname>
          </string-name>
          et al. \
          <article-title>Symbolic Model Checking without BDDs"</article-title>
          .
          <source>In: Tools and Algorithms for the Construction and Analysis of Systems</source>
          .
          <year>1999</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>B.</given-names>
            <surname>Blanc</surname>
          </string-name>
          et al. \
          <article-title>Handling State-Machines Speci cations with GATeL"</article-title>
          .
          <source>In: Electr. Notes Theor. Comput. Sci. 264</source>
          .3 (
          <year>2010</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>F.</given-names>
            <surname>Bobot</surname>
          </string-name>
          et al.
          <source>FPA Solver. Tech. rep</source>
          . http://soprano-project.fr/downloads/D3_1. pdf.
          <source>ANR SOPRANO, ANR-14-CE28-0020</source>
          ,
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>S.</given-names>
            <surname>Boldo</surname>
          </string-name>
          . \
          <article-title>Stupid is as Stupid Does: Taking the Square Root of the Square of a FloatingPoint Number"</article-title>
          .
          <source>In: Proceedings of the 7th and 8th International Workshop on Numerical Software Veri cation</source>
          . Vol.
          <volume>317</volume>
          .
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>M.</given-names>
            <surname>Brain</surname>
          </string-name>
          et al. \
          <article-title>An Automatable Formal Semantics for IEEE-</article-title>
          754
          <string-name>
            <surname>Floating-Point Arithmetic</surname>
          </string-name>
          <article-title>"</article-title>
          .
          <source>In: 22nd IEEE Symposium on Computer Arithmetic, ARITH</source>
          <year>2015</year>
          , Lyon, France, June 22-24,
          <year>2015</year>
          .
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          <string-name>
            <surname>M. Brain</surname>
          </string-name>
          et al. \
          <article-title>Deciding oating-point logic with abstract con ict driven clause learning"</article-title>
          .
          <source>In: Formal Methods in System Design 45.2</source>
          (
          <year>2014</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>Z.</given-names>
            <surname>Chihani</surname>
          </string-name>
          et al. \
          <article-title>Sharpening Constraint Programming approaches for Bit-Vector Theory"</article-title>
          .
          <source>In: CPAIOR</source>
          .
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>A.</given-names>
            <surname>Cimatti</surname>
          </string-name>
          et al. \
          <article-title>The MathSAT5 SMT Solver"</article-title>
          .
          <source>In: TACAS</source>
          .
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>S.</given-names>
            <surname>Conchon</surname>
          </string-name>
          et al. \
          <article-title>A three-tier strategy for reasoning about oating-point numbers in SMT"</article-title>
          . In: Computer Aided Veri cation.
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <given-names>S.</given-names>
            <surname>Conchon</surname>
          </string-name>
          et al. \
          <article-title>Built-in Treatment of an Axiomatic Floating-Point Theory for SMT Solvers"</article-title>
          .
          <source>In: SMT workshop</source>
          .
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          <string-name>
            <given-names>R.</given-names>
            <surname>David</surname>
          </string-name>
          et al. \
          <article-title>BINSEC/SE: A Dynamic Symbolic Execution Toolkit for Binary-Level Analysis"</article-title>
          .
          <source>In: SANER</source>
          <year>2016</year>
          .
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15]
          <string-name>
            <surname>L. De Moura</surname>
            and
            <given-names>N.</given-names>
          </string-name>
          <string-name>
            <surname>Bjorner</surname>
          </string-name>
          . \
          <article-title>Z3: An e cient SMT solver"</article-title>
          .
          <source>In: International conference on Tools and Algorithms for the Construction and Analysis of Systems</source>
          . Springer.
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          [18]
          <article-title>IEEE standard for binary oating-point arithmetic</article-title>
          .
          <source>Note: Standard</source>
          <volume>754</volume>
          {
          <year>1985</year>
          . Institute of Electrical and Electronics Engineers,
          <year>1985</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          <string-name>
            <given-names>D.</given-names>
            <surname>Jovanovic</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Barrett</surname>
          </string-name>
          , and L. de Moura. \
          <article-title>The Design and Implementation of the Model Constructing Satis ability Calculus"</article-title>
          .
          <source>In: Proceedings of 13th International Conference on Formal Methods in Computer-Aided Design</source>
          ,
          <string-name>
            <surname>FMCAD</surname>
          </string-name>
          <year>2013</year>
          .
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          [20]
          <string-name>
            <given-names>B.</given-names>
            <surname>Marre</surname>
          </string-name>
          and
          <string-name>
            <given-names>B.</given-names>
            <surname>Blanc</surname>
          </string-name>
          . \
          <article-title>Test Selection Strategies for Lustre Descriptions in GaTeL"</article-title>
          .
          <source>In: ENTCS</source>
          . Vol.
          <volume>111</volume>
          .
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          [21]
          <string-name>
            <given-names>B.</given-names>
            <surname>Marre</surname>
          </string-name>
          and
          <string-name>
            <given-names>C.</given-names>
            <surname>Michel</surname>
          </string-name>
          . \
          <article-title>Improving the Floating Point Addition and Subtraction Constraints"</article-title>
          .
          <source>In: Principles and Practice of Constraint Programming - CP</source>
          <year>2010</year>
          .
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          <source>[14] [16] [17] [19] [22] [23] [25] [27] [28]</source>
          [24]
          <string-name>
            <surname>J.-M. Muller</surname>
          </string-name>
          et al.
          <article-title>Handbook of Floating-Point Arithmetic</article-title>
          . ACM G.
          <volume>1</volume>
          .0;
          <string-name>
            <surname>G.</surname>
          </string-name>
          <year>1</year>
          .2; G.4;
          <string-name>
            <surname>B.</surname>
          </string-name>
          <year>2</year>
          .0;
          <string-name>
            <surname>B.</surname>
          </string-name>
          <year>2</year>
          .4;
          <string-name>
            <surname>F.</surname>
          </string-name>
          <year>2</year>
          .1.,
          <source>ISBN 978-0-8176-4704-9</source>
          . Birkhauser Boston,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          <string-name>
            <given-names>O.</given-names>
            <surname>Ohrimenko</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P. J.</given-names>
            <surname>Stuckey</surname>
          </string-name>
          , and
          <string-name>
            <given-names>M.</given-names>
            <surname>Codish</surname>
          </string-name>
          . \
          <article-title>Propagation via lazy clause generation"</article-title>
          .
          <source>In: Constraints 14.3</source>
          (
          <year>2009</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref22">
        <mixed-citation>
          [26]
          <string-name>
            <given-names>P.</given-names>
            <surname>Ru</surname>
          </string-name>
          <article-title>mmer and T. Wahl. \An SMT-LIB theory of binary oating-point arithmetic"</article-title>
          .
          <source>In: International Workshop on Satis ability Modulo Theories (SMT)</source>
          .
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref23">
        <mixed-citation>
          <string-name>
            <given-names>M.</given-names>
            <surname>Veksler</surname>
          </string-name>
          and
          <string-name>
            <given-names>O.</given-names>
            <surname>Strichman</surname>
          </string-name>
          . \
          <article-title>Learning general constraints in CSP"</article-title>
          .
          <source>In: Arti cial Intelligence</source>
          <volume>238</volume>
          (
          <year>2016</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref24">
        <mixed-citation>
          <string-name>
            <given-names>N.</given-names>
            <surname>Williams</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Marre</surname>
          </string-name>
          , and
          <string-name>
            <given-names>P.</given-names>
            <surname>Mouy</surname>
          </string-name>
          . \
          <article-title>On-the-Fly Generation of K-Path Tests for C Functions"</article-title>
          .
          <source>In: ASE</source>
          <year>2004</year>
          .
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>