Bool

algebra.lattice.Bool
See theBool companion object
trait Bool[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.

Attributes

Companion:
object
Source:
Bool.scala
Graph
Supertypes
Known subtypes
Self type
Bool[A]

Members list

Concise view

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.

Attributes

Definition Classes
Source:
Bool.scala
override def dual: Bool[A]

This is the lattice with meet and join swapped

This is the lattice with meet and join swapped

Attributes

Definition Classes
Source:
Bool.scala
def imp(a: A, b: A): A

Attributes

Source:
Bool.scala
def without(a: A, b: A): A

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).

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).

Attributes

Source:
Bool.scala
override def xor(a: A, b: A): A

Logical exclusive or, set-theoretic symmetric difference. Defined as a\b ∨ b\a.

Logical exclusive or, set-theoretic symmetric difference. Defined as a\b ∨ b\a.

Attributes

Definition Classes
Source:
Bool.scala

Inherited methods

def and(a: A, b: A): A

Attributes

Inherited from:
GenBool
Source:
GenBool.scala
def complement(a: A): A

Attributes

Inherited from:
Heyting
Source:
Heyting.scala
def isOne(a: A)(implicit ev: Eq[A]): Boolean
def isZero(a: A)(implicit ev: Eq[A]): Boolean
override def join(a: A, b: A): A

Attributes

Definition Classes
Inherited from:
GenBool
Source:
GenBool.scala
def joinPartialOrder(implicit ev: Eq[A]): PartialOrder[A]

Attributes

Inherited from:
JoinSemilattice
Source:
JoinSemilattice.scala
override def meet(a: A, b: A): A

Attributes

Definition Classes
Inherited from:
GenBool
Source:
GenBool.scala
def meetPartialOrder(implicit ev: Eq[A]): PartialOrder[A]

Attributes

Inherited from:
MeetSemilattice
Source:
MeetSemilattice.scala
def nand(a: A, b: A): A

Attributes

Inherited from:
Heyting
Source:
Heyting.scala
def nor(a: A, b: A): A

Attributes

Inherited from:
Heyting
Source:
Heyting.scala
def nxor(a: A, b: A): A

Attributes

Inherited from:
Heyting
Source:
Heyting.scala
def one: A
def or(a: A, b: A): A

Attributes

Inherited from:
GenBool
Source:
GenBool.scala
def zero: A