 # Boost :

From: Herve Bronnimann (hbr_at_[hidden])
Date: 2002-09-03 15:52:32

On Tue, Sep 03, 2002 at 03:17:06PM -0400, Rozental, Gennadiy wrote:
> > 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].

Intervals would quickly be irrelevant, as you'd end up with the whole
line pretty fast. I suspect what you really want is a list of intervals,
or Bolean functions of intervals (intersection / union / difference).

> 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.

Thanks Gennadiy for confirming my suspicion. If you want half-open
intervals, though, a range library would be more suited than an interval
arithmetic library. We cannot (and will not) represent all kinds of
intervals. This would unnecessarily burden the library, and for most
users it would not represent a benefit.

> 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  +  + [2,3]

I suspect you are working with integer values? then [0,1) is the same as
, isn't it? And if not integer, how did [0,1) / 2 become ?
But anyway, this is not relevant to the overall formal review.

> And IMO interval library should support this.
```--