Boost logo

Boost :

From: Daryle Walker (darylew_at_[hidden])
Date: 2002-09-02 17:47:28


On Monday, September 2, 2002, at 08:12 AM, cpdaniel_at_[hidden] wrote:

> I'm just starting to review the library, but one idea which popped
> into my
> head, based on something I did years ago, is that of including some
> extended
> logical operations to compliment interval comparisons.
>
> If one orders the internal comparision results as
> {false,indeterminate,true}, then there is a sensible definition for
> all of
> the common logic operations (assume false -> true correspond to values
> 0, 1,
> 2):
>
> a AND B = min(a,b)
> a OR b = max(a,b)
> NOT a = 2-a
>
> XOR can be implemented via table, or by it's basic definition:
>
> a XOR b = (a AND NOT b) OR (b AND NOT a)
>
> Would that be a useful addition to the library? I suppose it would
> require
> that the relational operators return a UDT to allow overloading
> (perhaps
> they do already? I haven't even looked yet).
>

I implemented similar multi-valued logic operations in a modulo library
I wrote a while back. Maybe I should try re-releasing it?...

Daryle Walker


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