Bool

trait Bool[@specialized(Int, Long) A] extends Heyting[A] with GenBool[A]

Boolean algebras are Heyting algebras with the additional constraint that the law of the excluded middle is true (equivalently, double-negation is true).

This means that in addition to the laws Heyting algebras obey, boolean algebras also obey the following:

  • (a ∨ ¬a) = 1
  • ¬¬a = a

Boolean algebras generalize classical logic: one is equivalent to "true" and zero is equivalent to "false". Boolean algebras provide additional logical operators such as xor, nand, nor, and nxor which are commonly used.

Every boolean algebras has a dual algebra, which involves reversing true/false as well as and/or.

Companion:
object
Bool[A]

Value members

Concrete methods

override def asBoolRing: BoolRing[A]

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.

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.

Definition Classes
override def dual: Bool[A]
def imp(a: A, b: A): A
def without(a: A, b: A): A
override def xor(a: A, b: A): A
Definition Classes

Inherited methods

def and(a: A, b: A): A
Inherited from:
GenBool
def complement(a: A): A
Inherited from:
Heyting
def isOne(a: A)(implicit ev: Eq[A]): Boolean
Inherited from:
BoundedMeetSemilattice
def isZero(a: A)(implicit ev: Eq[A]): Boolean
Inherited from:
BoundedJoinSemilattice
override def join(a: A, b: A): A
Definition Classes
Inherited from:
GenBool
def joinPartialOrder(implicit ev: Eq[A]): PartialOrder[A]
Inherited from:
JoinSemilattice
override def meet(a: A, b: A): A
Definition Classes
Inherited from:
GenBool
def meetPartialOrder(implicit ev: Eq[A]): PartialOrder[A]
Inherited from:
MeetSemilattice
def nand(a: A, b: A): A
Inherited from:
Heyting
def nor(a: A, b: A): A
Inherited from:
Heyting
def nxor(a: A, b: A): A
Inherited from:
Heyting
def one: A
Inherited from:
BoundedMeetSemilattice
def or(a: A, b: A): A
Inherited from:
GenBool
def zero: A
Inherited from:
BoundedJoinSemilattice