Class TernaryBooleanLogicsTest


  • public class TernaryBooleanLogicsTest
    extends AbstractGremlinProcessTest
    Author:
    Mike Personick (http://github.com/mikepersonick)
    • Constructor Detail

      • TernaryBooleanLogicsTest

        public TernaryBooleanLogicsTest()
    • Method Detail

      • testCompareNaN

        public void testCompareNaN()
        NaN comparisons always produce UNDEF comparison, reducing to FALSE in ternary->binary reduction.
      • testCompareNull

        public void testCompareNull()
        Null comparisons. Null is considered to be a distinct type, thus will produce ERROR for comparison against non-null, just like any cross-type comparison. Null is == null and is != to any non-null (except for NaN, which is always UNDEF/ERROR).
      • testCompareAcrossTypes

        public void testCompareAcrossTypes()
        Comparisons across type families. FALSE for P.eq, TRUE for P.neq, and UNDEF with binary reduction to FALSE for P.lt/lte/gt/gte.
      • testAnd

        public void testAnd()
        Over a ternary binary semantics, the AND predicate evaluates to TRUE only if both arguments are TRUE. AND will propogate ERROR values unless the other argument evalutes to FALSE, since FALSE && X => FALSE.
      • testOr

        public void testOr()
        Being symetrically defined to AND, OR only returns FALSE in the case that both arguments evalute to FALSE. In cases where one argument is FALSE and the other ERROR, OR propogates the ERROR. Whenever one argument is TRUE, OR returns TRUE since TRUE || X => TRUE.
      • testNot

        public void testNot()
        The NOT predicate inverts TRUE and FALSE but maintains ERROR values. For ERROR, we can neither prove nor disprove the value expression and hence stick with ERROR.
      • testXor

        public void testXor()
        Ternary XOR semantics.