Class/Object

spire.math

Trilean

Related Docs: object Trilean | package math

Permalink

final class Trilean extends AnyVal

Implementation of three-valued logic.

This type resembles Boolean, but has three values instead of two:

Trilean supports the same operations that Boolean does, and as long as all values are True or False, the results will be the same. However, the truth tables have to be extended to work with unknown:

not: -+- T|F U|U F|T

and: |T U F -+----- T|T U F U|U U F F|F F F

or: |T U F -+----- T|T T T U|T U U F|T U F

Trilean is implemented as a value type, so in most cases it will only have the overhead of a single Int. However, in some situations it will be boxed.

Self Type
Trilean
Linear Supertypes
AnyVal, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Trilean
  2. AnyVal
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Trilean(value: Int)

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    Any
  3. def &(rhs: Trilean): Trilean

    Permalink
  4. def &&(rhs: ⇒ Trilean): Trilean

    Permalink
  5. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    Any
  6. def ^(rhs: Trilean): Trilean

    Permalink
  7. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  8. def assume(b: Boolean): Boolean

    Permalink
  9. def assumeFalse: Boolean

    Permalink
  10. def assumeTrue: Boolean

    Permalink
  11. def fold[A](f: (Boolean) ⇒ A)(unknown: ⇒ A): A

    Permalink
  12. def getClass(): Class[_ <: AnyVal]

    Permalink
    Definition Classes
    AnyVal → Any
  13. def imp(rhs: Trilean): Trilean

    Permalink
  14. def isFalse: Boolean

    Permalink
  15. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  16. def isKnown: Boolean

    Permalink
  17. def isNotFalse: Boolean

    Permalink
  18. def isNotTrue: Boolean

    Permalink
  19. def isTrue: Boolean

    Permalink
  20. def isUnknown: Boolean

    Permalink
  21. def nand(rhs: Trilean): Trilean

    Permalink
  22. def nor(rhs: Trilean): Trilean

    Permalink
  23. def nxor(rhs: Trilean): Trilean

    Permalink
  24. def toBoolean(b: ⇒ Boolean): Boolean

    Permalink
  25. def toOption: Option[Boolean]

    Permalink
  26. def toString(): String

    Permalink
    Definition Classes
    Trilean → Any
  27. def unary_!: Trilean

    Permalink
  28. val value: Int

    Permalink
  29. def |(rhs: Trilean): Trilean

    Permalink
  30. def ||(rhs: ⇒ Trilean): Trilean

    Permalink

Inherited from AnyVal

Inherited from Any

Ungrouped