Every Boolean algebra is a BoolRing, with multiplication defined as
and
and addition defined as xor
.
Every Boolean algebra is a BoolRing, with multiplication defined as
and
and addition defined as xor
. Bool does not extend BoolRing
because, e.g. we might want a Bool[Int] and CommutativeRing[Int] to
refer to different structures, by default.
Note that the ring returned by this method is not an extension of
the Rig
returned from BoundedDistributiveLattice.asCommutativeRig
.
Return a CommutativeRig using join and meet.
Return a CommutativeRig using join and meet. Note this must obey the commutative rig laws since meet(a, one) = a, and meet and join are associative, commutative and distributive.
This is the lattice with meet and join swapped
This is the lattice with meet and join swapped
Tests if a
is one.
Tests if a
is one.
Tests if a
is zero.
Tests if a
is zero.
Given a sequence of as
, compute the product.
Given a sequence of as
, compute the product.
Given a sequence of as
, compute the sum.
Given a sequence of as
, compute the sum.
Given a sequence of as
, combine them and return the total.
Given a sequence of as
, combine them and return the total.
If the sequence is empty, returns None. Otherwise, returns Some(total).
Given a sequence of as
, combine them and return the total.
Given a sequence of as
, combine them and return the total.
If the sequence is empty, returns None. Otherwise, returns Some(total).
The operation of relative complement, symbolically often denoted
a\b
(the symbol for set-theoretic difference, which is the
meaning of relative complement in the lattice of sets).
Logical exclusive or, set-theoretic symmetric difference.
This commutative rig is different than the one obtained from GF(2).
It uses || for plus, and && for times.