Logic

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

Logic models a logic generally. It is a bounded distributive lattice with an extra negation operator.

Logic models a logic generally. It is a bounded distributive lattice with an extra negation operator.

The negation operator obeys the weak De Morgan laws:

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

For intuitionistic logic see Heyting For fuzzy logic see DeMorgan

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

Value members

Abstract methods

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

Concrete methods

def nand(a: A, b: A): A
def nor(a: A, b: A): A
def nxor(a: A, b: A): A
def xor(a: A, b: A): A

Inherited methods

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 join(lhs: A, rhs: A): A
Inherited from
JoinSemilattice
def joinPartialOrder(ev: Eq[A]): PartialOrder[A]
Inherited from
JoinSemilattice
override def joinSemilattice: BoundedSemilattice[A]
def meet(lhs: A, rhs: A): A
Inherited from
MeetSemilattice
def meetPartialOrder(ev: Eq[A]): PartialOrder[A]
Inherited from
MeetSemilattice
override def meetSemilattice: BoundedSemilattice[A]
def one: A
def zero: A