Boost logo

Boost :

From: Rozental, Gennadiy (Gennadiy_at_[hidden])
Date: 2002-09-03 14:17:06


> My particular application is in the area of static analysis.
> Given this
> system, we might try to analyze the code:
>
> int x;
> // ...
> if (x > 0) {
> // do something...
> }
> else {
> // do something else
> }
>
> We might use interval comparison to determine if x > 0
> (indeterminate) and
> then intersection to compute the values of x within the 'if'
> and 'else'
> branches based on the condition. Within the 'if' branch, the
> value of x is
> the intersection of x with [1, +Infinity] and within the
> "else" branch the
> value of x is the intersection of x with [-Infinity, 0].
>
> Doug

I was wroking in the same domain for some time. Interval arithmetic does is
very useful here. Note though that in most cases we need more generic
anstraction - ordered list of intervals possibly open or half open. IOW
after several steps in your analisys you may end up that value of x belongs
to
[0,1) + (1,2] + [5,6]. Now I want to operate with this "area of definition"
as with one value. for example if next statement is x /=2; new value is [0]
+ [1] + [2,3]

And IMO interval library should support this.

Gennadiy.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk