This chapter describes boolean lists. A boolean list is a list that
has no holes and contains only boolean values, i.e.,
In function names we call boolean lists blist for brevity.
Boolean lists can be used in various ways, but maybe the most important
application is their use for the description of subsets of finite sets.
Suppose set is a finite set, represented as a list. Then a subset
sub of set is represented by a boolean list blist of the same
length as set such that
set[i] is in
This package contains functions to switch between the representations of
subsets of a finite set either as sets or as boolean lists (see
BlistList, ListBlist), to test if a list is a boolean list (see
IsBlist), and to count the number of
true entries in a boolean list
Next there are functions for the standard set operations for the subsets
represented by boolean lists (see IsSubsetBlist, UnionBlist,
IntersectionBlist, and DifferenceBlist). There are also the
corresponding destructive procedures that change their first argument
(see UniteBlist, IntersectBlist, and SubtractBlist). Note that
there is no function to add or delete a single element to a subset
represented by a boolean list, because this can be achieved by assigning
false to the corresponding position in the boolean list (see
Since boolean lists are just a special case of lists, all the operations
and functions for lists, can be used for boolean lists just as well (see
Lists). For example
Position (see Position) can be used to find
true entries in a boolean list, allowing you to loop over the
elements of the subset represented by the boolean list.
More about Boolean Lists).