final class Trilean extends AnyVal
Implementation of three-valued logic.
This type resembles Boolean, but has three values instead of two:
- Trilean.True (equivalent to true)
- Trilean.False (equivalent to false)
- Trilean.Unknown
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
- Alphabetic
- By Inheritance
- Trilean
- AnyVal
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new Trilean(value: Int)
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- Any
- final def ##: Int
- Definition Classes
- Any
- def &(rhs: Trilean): Trilean
- def &&(rhs: => Trilean): Trilean
- final def ==(arg0: Any): Boolean
- Definition Classes
- Any
- def ^(rhs: Trilean): Trilean
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def assume(b: Boolean): Boolean
- def assumeFalse: Boolean
- def assumeTrue: Boolean
- def fold[A](f: (Boolean) => A)(unknown: => A): A
- def getClass(): Class[_ <: AnyVal]
- Definition Classes
- AnyVal → Any
- def imp(rhs: Trilean): Trilean
- def isFalse: Boolean
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isKnown: Boolean
- def isNotFalse: Boolean
- def isNotTrue: Boolean
- def isTrue: Boolean
- def isUnknown: Boolean
- def nand(rhs: Trilean): Trilean
- def nor(rhs: Trilean): Trilean
- def nxor(rhs: Trilean): Trilean
- def toBoolean(b: => Boolean): Boolean
- def toOption: Option[Boolean]
- def toString(): String
- Definition Classes
- Trilean → Any
- def unary_!: Trilean
- val value: Int
- def |(rhs: Trilean): Trilean
- def ||(rhs: => Trilean): Trilean