Functionalities of the interface at level 0
Representation of an abstract value
At the level 0 of the interface, an abstract value is a structure
@verbatim
struct ap_abstract0_t {
ap_manager_t *manager; /* Explicit context */
void *value; /* Abstract value representation
(only known by the underlying library) */
}
The context is allocated by the underlying library, and contains an
array of function pointers pointing to the function of the underlying
library. Hence, it indicates the effective type of an abstract value.
The validity of the arguments of the functions called through the
interface is checked before the call to effective functions. In case
of problem, an invalid_argument
exception is raised.
Semantics of an abstract value
The semantics of an abstract value is a subset
X of N^p x R^q
Abstract values are typed according to their dimensionality
(p,q).
Dimensions
Dimensions are numbered from 0 to p+q-1 and are typed either as
integer or real, depending on their rank w.r.t. the dimensionality of
the abstract value.
Taking into account or not the fact that some dimensions are integers
is left to underlying libraries. Treating them as real is still a
correct approximation. The behaviour of the libraries in this regard
may also depend on some options.
Other datatypes
In addition to abstract values, the interface also manipulates the
following main datatypes:
- scalar (number)
- Either GMP multiprecision rationals or C
double
.
- interval
- composed of 2 scalar numbers. With rationals, plus (resp minus) infinity is represented by 1/0 (resp -1/0). With
double
, the IEEE754 is assumed and the corresponding standard representation is used.
- coefficient
- which is either a scalar or an interval.
- (interval) linear expression
- The term linear is used even if the proper term should rather be
affine. A linear expression is a linear expression in the common
sense, using only scalar numbers. A quasi-linear expression is a
linear expression where the constant coefficient is an interval. An
interval linear expression is a linear expression where any
coefficient may be an interval. In order to have a unique datatype for
these variations, we introduced the notion of coefficient described
above.
- "linear" constraints
- "Linear" constraints includes proper linear constraints, linear
constraints in which the expression can be possibly an interval linear
expression, linear equalities modulo a number, and linear disequalities.
- generators
Control of internal representation
We identified several notions:
-
Canonical form
-
Minimal form (in term of space)
-
Approximation notion left to the underlying library (taking into
account integers or not, ...).
Printing
There are two printing operations:
-
Printing of an abstract value;
-
Printing the difference between two abstract values.
The printing format is library dependent. However, the conversion of
abstract values to constraints (see below) allows a form of
standardized printing for abstract values.
Serializaton/Deserialization
Serialization and deserialization of abstract values to a memory
buffer is offered. It is entirely managed by the underlying
library. In particular, it is up to it to check that a value read from
the memory buffer has the right format and has not been written by a
different library.
Serialization is done to a memory buffer instead of to a file
descriptor because this mechanism is more general and is needed for
interfacing with languages like OCAML.
Constructors
Four basic constructors are offered:
-
bottom (empty) and top (universe) values (with a specified dimensionality);
-
abstraction of a bounding box;
-
abstraction of conjunction of linear constraints (in the broad sense).
Tests
Predicates are offered for testing
-
emptiness and universality of an abstract value:
-
inclusion and equality of two abstract values;
-
inclusion of a dimension into an interval given an abstract value;
-
satisfaction of a linear constraint by the abstract value.
Property extraction
Some properties may be inferred given an abstract values:
- Interval of variation of a dimension in an abstract value;
- Interval of variation of a linear expression in an abstract value;
- Conversion to a bounding box
- Conversion to a set of linear constraints (in the broad sense).
Notice that the second operation implements linear programming if it
is exact. The third operation is not minimal, as it can be implemented
using the first one, but it was convenient to include it. But the
fourth operation is minimal and cannot be implemented using the second
one, as the number of linear expression is infinite.
Lattice operations
-
Least upper bound and greatest lower bound of two abstract values, and of arrays of abstract values;
-
Intersection with one or several linear constraints;
-
Addition of rays (for instance for implement generalized time elapse
operator in linear hybrid systems).
Assignement and Substitutions
-
of a dimension by a (interval) linear expression
-
in parallel of several dimensions by several (interval) linear expressions
Parallel assignement and substitution ar enot minimal operations, but
for some abstract domains implementing them directly results in more
efficient or more precise operations.
Operations on dimensions
-
Projection/Elimination of one or several dimensions with constant
dimensionality;
-
Addition/Removal/Permutation of dimensions with corresponding change
of dimensionality (with the exception of permutation). These
operations allows to resize abstract values, and reorganize
dimensions.
-
Expansion and folding of dimensions. This is useful for the
abstraction of arrays, where a dimension may represent several
variables.
Other operations
Widening, either simple or with threshold, is offered. A generic
widening with threshold function is offered in the interface.
Topological closure (i.e., relaxation of strict inequalities) is
offered.
This document was generated
on August, 27 2007
using texi2html