Theorems of Gappa¶
Predicates¶
Gappa works on sets of facts about real-valued expressions. The following predicates are handled internally:
BND(x,I)The value of expression
xis included in intervalI.ABS(x,I)The absolute value of expression
xis included in intervalI.REL(x,y,I)The values of expressions
xandysatisfy \(x = y \times (1 + \varepsilon)\) with \(\varepsilon\in I\).LIN(x,y,I)The values of expressions
xandysatisfy \(x = y \times \varepsilon\) with \(\varepsilon\in I\).FIX(x,k)The value of expression
xis such that \(\exists m \in \mathbb{Z},~x = m \cdot 2^k\).FLT(x,k)The value of expression
xis such that \(\exists m,e \in \mathbb{Z},~x = m \cdot 2^e \land |m| < 2^k\).NZR(x)The value of expression
xis not zero.EQL(x,y)Expressions
xandyhave equal values.
In the definitions above, I denotes an interval whose bounds have
known numerical values, while k is a known integer. In the
description of the theorems, these parameters will usually be ignored.
For instance, BND(x) just means that an enclosure of x is known.
In addition, EQL properties are also used to express rewriting hints
provided by the user.
Theorems¶
There are three categories of theorems in Gappa: theorems about real arithmetic, theorems about rounding operators, and rewriting rules.
In the following, variables a, b, c, and d, represent
arbitrary expressions. Gappa is using backward reasoning, so they are
filled by matching the goal of a theorem against the property Gappa wants
to compute. If some theorem mentions both a and b in the hypotheses
but only one of them appears on in the goal, then Gappa infers the other one so
that b is an approximate value of a. See Approximated expressions for
more details. There may be additional constraints on the expressions that
require some of them to be syntactically different (denoted a ≠ b),
or to be syntactically constant (denoted a=), or to be syntactically
variable (denoted a~). A constraint written using USR means that
the theorem will be applied only if a matching expression appears in the
input file.
Theorems about real arithmetic¶
Theorem name |
Goal |
Hypotheses |
Constraints |
|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Theorems about rounding operators¶
The following table describes the kind of theorems that can be applied to rounding operators. These theorems have no specific names, as each rounding operator comes with its dedicated set of theorems. When a specific theorem is not available for a given rounding operator, its effect can usually be obtained through an available one combined with a rewriting rule.
Goal |
Hypothesis |
Rounding kind |
|---|---|---|
|
|
fixed, float |
|
|
float |
|
fixed |
|
|
|
fixed (zr, aw), float (zr, aw, up, dn, nu, nd) |
|
|
float (od, ne, nz, na, no) |
|
|
fixed (zr, aw), float (up, dn, nu, nd) |
|
|
float (zr, aw, od, ne, nz, na, no) |
|
||
|
|
|
|
|
float |
|
|
|
|
|
float |
|
|
float |
|
fixed, float |
|
|
|
fixed, float |
|
float |
|
|
|
fixed, float |
|
|
fixed |
|
|
float |
Rewriting rules¶
The following theorems are used to propagate properties about a term to some provably equal term.
Theorem name |
Goal |
Hypotheses |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
For the sake of readability, the following theorems are not written with
BND predicates but rather with expressions only. When trying to
obtain some enclosure of the target expression (goal), Gappa will first
consider the source one (hypothesis). As a consequence of this layout
and contrarily to previous tables, constraints will also list additional
hypotheses needed to apply the rules. Whenever an operator is put
between square brackets, it means that only theorems that perform basic
interval arithmetic will be able to match it.
Theorem name |
Target |
Source |
Constraints |
|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
There are also some rewriting rules dealing with predicates REL and LIN.
Theorem name |
Target |
Source |
Constraints |
|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Finally, there are theorems performing basic congruence.
Theorem name |
Target |
Source |
Constraints |
|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|