Martin D Kealey wrote:
George Boole also worked in several areas of mathematics. One of those was
what he termed "algebra of logic", hence "Boolean algebra" as mathematicians
know it now.
But what we (programmers) call "Boolean", although in line with his original
concept, is a pale shadow of where Boolean Algebra has developed since. In
particular there are things call power sets, and a field using set
intersection and union over those has the same algebraic properties as the
original "algebra of logic", but not with just two "true" and "false"
values.
So mathematically a "Boolean" value doesn't necessarily behave the same way
as a bit, rather it behaves like a structured collection of bits. Treating
an integer value as a vector of bits is certainly one such structure.
Things like primes over Z(2) are not very interesting, but a field or ring
over Z(2)^n does have interesting behaviour that depends on n.
So I'm in favour of a "Boolean" role including things such as a vector of
bits.
I suggest "Predicate" as the name of the role which implements a single
true-or-false value (as distinct from a bit, which implements a 0-or-1
value).
What you're talking about now reminds me of the relational model of data, which
may be (I'm not sure) derived from that "algebra of logic" you mention (it is at
least based on predicate logic and set theory), where a relation value's heading
represents a predicate and the relation's body represents a set of true
propositions that can be formed from that predicate. So it may be worth
considering, when deciding on Boolean-related role names that are meant be as
feature-rich as you say, as to whether any choices would be appropriate for a
relation type to compose. Of course, we also come back to the question as to
whether what boolean algebra has evolved into is something that would be fitting
in the Perl core or be best left to modules. -- Darren Duncan