[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

Linear expressions of level 1 (`ap_linexpr1.h')

We manipulate here expressions of the form

a_0.x_0 + ... + a_n.x_n + b
where the coefficients a_0, ..., a_n, b are of ap_coeff_t type (either scalars or intervals) and the variables x_0, ... , x_n are of type ap_var_t.

The semantics of linear expressions is exact, in the sense that the arithmetic operations are interpreted in the real (or rational) numbers. However, abstract domains are free to overapproximate this exact semantics (this may occur when converting rational scalars to double type for instance).

A special remark concerns integer variables. Abstract domains are assumed to perform the operations involving linear expressions using a real/rational semantics, and then possibly to reduce the result using the knowledge that integer variables may only take integer values.

This semantics coincides with the natural integer semantics of expressions involving only integer variables only if the involved coefficients are all integers.
A typical counter-example to this is an assignement y := 1/3 x where x and y are integer variables. If this assignement is applied to the BOX abstract domain value x in [1;1], it may lead to the bottom value, because one will first obtain y in [1/3;1/3] by real/rational computations, and this may be reduced to the empty interval because y is integer and the interval contains no integer values.

If you need expressions with a less simple semantics (mixing integer, real/rational and floating-point semantics with casts), you should use tree expressions (see section Tree expressions of level 1 (`ap_texpr1.h')).

datatype: ap_linexpr1_t
(Internal) type of interval linear expressions.

Linear expressions of level 1 are created as objects of type ap_linexpr1_t, not as pointers of type ap_linexpr1_t*.

For information:
 
typedef struct ap_linexpr1_t {
  ap_linexpr0_t* linexpr0;
  ap_environment_t* env;
} ap_linexpr1_t;

Allocating linear expressions of level 1  
Tests on linear expressions of level 1  
Access to linear expressions of level 1  
Change of dimensions and permutations of linear expressions of level 1  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated on September, 10 2009 using texi2html