[std-interval] Interval comparison operators
Guillaume Melquiond
guillaume.melquiond at ens-lyon.fr
Thu Apr 27 12:06:27 PDT 2006
Le mercredi 26 avril 2006 à 18:29 -0500, George Corliss a écrit :
> Friends,
>
> My thoughts on this thread:
>
> #1 In my own interval programming work, I don't think I have ever used
> certainly/possibly operators or tri-valued logic, mostly because I have to
> think too hard. Instead, I use <double> tests on interval endpoints, e.g.,
> lo(A) <= hi(B), and similar. I must think carefully through all cases, but
> boolean tests work as I am familiar. I think I am not alone in that
> practice. I believe it leads to code that is more easily maintained by
> people with only intermediate expertise.
I agree, but only partly. Handling bounds directly makes it look
simpler, but only as long as you are sure your intervals are not empty.
For example, "A.lower() <= B.upper()" will be undefined if one of the
intervals is empty, while "possibly(A <= B)" will return false. With
possibly empty intervals, it becomes necessary to add new tests and this
may decrease both performance and readability.
I suppose it's only a matter of habits though. People who are used to
handling bounds directly will keep handling bounds directly, while
people who are used to multi-valued logics will keep using them, and so
on. So, in a sense, the question could become: into which habits do we
want people who are new to interval arithmetic to get? Personally, I
wouldn't mind students using possibly / certainly so that they have to
think about what they really want to express rather than directly going
to lower level manipulation of bounds :-).
Best regards,
Guillaume
More information about the Std-interval
mailing list