Efficient interval representation
- From: Tim Frink <plfriko@xxxxxxxx>
- Date: Fri, 31 Aug 2007 10:11:40 +0200
Hi,
I've a basic question. Let's assume I want to statically
analyze a program using abstract interpretation. I want
to represent an unsigned char variable in its abstract
form using intervals. Further, let's assume that the variable
is represented by the interval <10..255> at some point
of the program (program under analysis is a C source, so the
data type unsigned char has a bit length of 8).
When I now add a constant to that value, let's say <5..5>,
I have a wrap-around. IMHO, there are not two ways how to
represent the result:
a) again <0..255>. However, here I have a loss of precision
since the values <5..14> are actually not possible in the
sum
b) the result is represented by two intervals:
<0..4> and <15..255>. This form fosters precision since just
feasible values are given
The first representation has the advantage that I keep the
number of intervals small (just one interval for each
variable) but loose precision so that I probably get high
overestimations the longer the analysis proceeds. On the
other hand, the second representation keeps the calculations
precise but the computation complexity increases and might
end up in a state explosion that becomes too complex to compute.
What is done in practice in such a case?
One idea to handle this trade-off between complexity and precision
that comes into my mind might be to define the number of maximal
intervals for each variable (if further intervals are required they
must be somehow merged with the present results to not exceed the
max. #intervals).
Or do you see any other solutions?
Best regards,
Tim
.
- Follow-Ups:
- Re: Efficient interval representation
- From: Ben Pfaff
- Re: Efficient interval representation
- From: Alf P. Steinbach
- Re: Efficient interval representation
- Prev by Date: Re: Any progress yet? (was Re: Fast pi program?)
- Next by Date: Re: Efficient interval representation
- Previous by thread: Re: May I have a example of design pattern of "composite", I still feel fuzzy after reading book of Addison-Wesley's"design pattern "
- Next by thread: Re: Efficient interval representation
- Index(es):
Relevant Pages
|