DeMorgan

trait DeMorgan[@specialized(Int, Long) A] extends Logic[A]

De Morgan algebras are bounded lattices that are also equipped with a De Morgan involution.

De Morgan algebras are bounded lattices that are also equipped with a De Morgan involution.

De Morgan involution obeys the following laws:

  • ¬¬a = a
  • ¬(x∧y) = ¬x∨¬y

However, in De Morgan algebras this involution does not necessarily provide the law of the excluded middle. This means that there is no guarantee that (a ∨ ¬a) = 1. De Morgan algebra do not not necessarily provide the law of non contradiction either. This means that there is no guarantee that (a ∧ ¬a) = 0.

De Morgan algebras are useful to model fuzzy logic. For a model of classical logic, see the boolean algebra type class implemented as Bool.

Companion
object
trait Logic[A]
trait Lattice[A]
trait Serializable
class Any

Value members

Concrete methods

def imp(a: A, b: A): A
def join(a: A, b: A): A
def meet(a: A, b: A): A

Inherited methods

def and(a: A, b: A): A
Inherited from
Logic

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.

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.

Inherited from
BoundedDistributiveLattice
def isOne(a: A)(ev: Eq[A]): Boolean
def isZero(a: A)(ev: Eq[A]): Boolean
def joinPartialOrder(ev: Eq[A]): PartialOrder[A]
Inherited from
JoinSemilattice
override def joinSemilattice: BoundedSemilattice[A]
def meetPartialOrder(ev: Eq[A]): PartialOrder[A]
Inherited from
MeetSemilattice
override def meetSemilattice: BoundedSemilattice[A]
def nand(a: A, b: A): A
Inherited from
Logic
def nor(a: A, b: A): A
Inherited from
Logic
def not(a: A): A
Inherited from
Logic
def nxor(a: A, b: A): A
Inherited from
Logic
def one: A
def or(a: A, b: A): A
Inherited from
Logic
def xor(a: A, b: A): A
Inherited from
Logic
def zero: A