Class BooleanAlgebra

Buy me a cup of coffee via donation

Did you find the software useful? Please consider donation

or support me purchasing the license via ORDER Page , or INFIMA online store


INFIMA online store
java.lang.Object
org.mariuszgromada.math.mxparser.mathcollection.BooleanAlgebra

public final class BooleanAlgebra extends Object
BooleanAlgebra - class for boolean operators.
Version:
5.0.0
Author:
Mariusz Gromada
MathParser.org - mXparser project page
mXparser on GitHub
INFIMA place to purchase a commercial MathParser.org-mXparser software license
info@mathparser.org
ScalarMath.org - a powerful math engine and math scripting language
Scalar Lite
Scalar Pro
MathSpace.pl

Buy me a cup of coffee via donation

Did you find the software useful? Please consider donation

or support me purchasing the license via ORDER Page , or INFIMA online store


INFIMA online store
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final double[][]
    AND truth table
    static final double[][]
    CIMP truth table
    static final double[][]
    CNIMP truth table
    static final double[][]
    EQV truth table
    static final double
    False as double
    static final int
    False as integer
    static final double[][]
    IMP truth table
    static final double
    Null as double
    static final double[][]
    NAND truth table
    static final double[][]
    NIMP truth table
    static final double[][]
    NOR truth table
    static final double[]
    NOT truth table
    static final int
    Null as integer
    static final double[][]
    OR truth table
    static final double
    True as double
    static final int
    True as integer
    static final double[][]
    XNOR truth table
    static final double[][]
    XOR truth table
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static double
    and(double a, double b)
    Boolean AND
    static double
    andVariadic(double[] values)
    Boolean AND variadic
    static double
    cimp(double a, double b)
    Boolean CIMP
    static double
    cnimp(double a, double b)
    Boolean CNIMP
    static int
    Double to integer boolean translation
    static double
    eqv(double a, double b)
    Boolean EQV
    static double
    imp(double a, double b)
    Boolean IMP
    static double
    nand(double a, double b)
    Boolean NAND
    static double
    nimp(double a, double b)
    Boolean NIMP
    static double
    nor(double a, double b)
    Boolean NOR
    static double
    not(double a)
    Boolean NOT
    static double
    or(double a, double b)
    Boolean OR
    static double
    orVariadic(double[] values)
    Boolean OR variadic
    static double
    xnor(double a, double b)
    Boolean XNOR
    static double
    xor(double a, double b)
    Boolean XOR
    static double
    xorVariadic(double[] values)
    Boolean XOR variadic

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • FALSE

      public static final int FALSE
      False as integer
      See Also:
    • TRUE

      public static final int TRUE
      True as integer
      See Also:
    • NULL

      public static final int NULL
      Null as integer
      See Also:
    • F

      public static final double F
      False as double
      See Also:
    • T

      public static final double T
      True as double
      See Also:
    • N

      public static final double N
      Null as double
      See Also:
    • AND_TRUTH_TABLE

      public static final double[][] AND_TRUTH_TABLE
      AND truth table
    • NAND_TRUTH_TABLE

      public static final double[][] NAND_TRUTH_TABLE
      NAND truth table
    • OR_TRUTH_TABLE

      public static final double[][] OR_TRUTH_TABLE
      OR truth table
    • NOR_TRUTH_TABLE

      public static final double[][] NOR_TRUTH_TABLE
      NOR truth table
    • XOR_TRUTH_TABLE

      public static final double[][] XOR_TRUTH_TABLE
      XOR truth table
    • XNOR_TRUTH_TABLE

      public static final double[][] XNOR_TRUTH_TABLE
      XNOR truth table
    • IMP_TRUTH_TABLE

      public static final double[][] IMP_TRUTH_TABLE
      IMP truth table
    • CIMP_TRUTH_TABLE

      public static final double[][] CIMP_TRUTH_TABLE
      CIMP truth table
    • EQV_TRUTH_TABLE

      public static final double[][] EQV_TRUTH_TABLE
      EQV truth table
    • NIMP_TRUTH_TABLE

      public static final double[][] NIMP_TRUTH_TABLE
      NIMP truth table
    • CNIMP_TRUTH_TABLE

      public static final double[][] CNIMP_TRUTH_TABLE
      CNIMP truth table
    • NOT_TRUTH_TABLE

      public static final double[] NOT_TRUTH_TABLE
      NOT truth table
  • Constructor Details

    • BooleanAlgebra

      public BooleanAlgebra()
  • Method Details

    • double2IntBoolean

      public static int double2IntBoolean(double a)
      Double to integer boolean translation
      Parameters:
      a - the double number
      Returns:
      If a = Double.NaN return NULL, else if a <> 0 return TRUE, else return FALSE.
    • and

      public static double and(double a, double b)
      Boolean AND
      Parameters:
      a - the a number (a AND b)
      b - the b number (a AND b)
      Returns:
      Truth table element AND[A][B] where A = double2IntBoolean(a), B = double2IntBoolean(b)
    • or

      public static double or(double a, double b)
      Boolean OR
      Parameters:
      a - the a number (a OR b)
      b - the b number (a OR b)
      Returns:
      Truth table element OR[A][B] where A = double2IntBoolean(a), B = double2IntBoolean(b)
    • xor

      public static double xor(double a, double b)
      Boolean XOR
      Parameters:
      a - the a number (a XOR b)
      b - the b number (a XOR b)
      Returns:
      Truth table element XOR[A][B] where A = double2IntBoolean(a), B = double2IntBoolean(b)
    • nand

      public static double nand(double a, double b)
      Boolean NAND
      Parameters:
      a - the a number (a NAND b)
      b - the b number (a NAND b)
      Returns:
      Truth table element NAND[A][B] where A = double2IntBoolean(a), B = double2IntBoolean(b)
    • nor

      public static double nor(double a, double b)
      Boolean NOR
      Parameters:
      a - the a number (a NOR b)
      b - the b number (a NOR b)
      Returns:
      Truth table element NOR[A][B] where A = double2IntBoolean(a), B = double2IntBoolean(b)
    • xnor

      public static double xnor(double a, double b)
      Boolean XNOR
      Parameters:
      a - the a number (a XNOR b)
      b - the b number (a XNOR b)
      Returns:
      Truth table element XNOR[A][B] where A = double2IntBoolean(a), B = double2IntBoolean(b)
    • imp

      public static double imp(double a, double b)
      Boolean IMP
      Parameters:
      a - the a number (a IMP b)
      b - the b number (a IMP b)
      Returns:
      Truth table element IMP[A][B] where A = double2IntBoolean(a), B = double2IntBoolean(b)
    • eqv

      public static double eqv(double a, double b)
      Boolean EQV
      Parameters:
      a - the a number (a EQV b)
      b - the b number (a EQV b)
      Returns:
      Truth table element EQV[A][B] where A = double2IntBoolean(a), B = double2IntBoolean(b)
    • not

      public static double not(double a)
      Boolean NOT
      Parameters:
      a - the a number (NOT a)
      Returns:
      Truth table element NOT[A] where A = double2IntBoolean(a)
    • cimp

      public static double cimp(double a, double b)
      Boolean CIMP
      Parameters:
      a - the a number (a CIMP b)
      b - the b number (a CIMP b)
      Returns:
      Truth table element CIMP[A][B] where A = double2IntBoolean(a), B = double2IntBoolean(b)
    • nimp

      public static double nimp(double a, double b)
      Boolean NIMP
      Parameters:
      a - the a number (a NIMP b)
      b - the b number (a NIMP b)
      Returns:
      Truth table element NIMP[A][B] where A = double2IntBoolean(a), B = double2IntBoolean(b)
    • cnimp

      public static double cnimp(double a, double b)
      Boolean CNIMP
      Parameters:
      a - the a number (a CNIMP b)
      b - the b number (a CNIMP b)
      Returns:
      Truth table element CNIMP[A][B] where A = double2IntBoolean(a), B = double2IntBoolean(b)
    • andVariadic

      public static double andVariadic(double[] values)
      Boolean AND variadic
      Parameters:
      values - List of values
      Returns:
      Returns BooleanAlgebra.TRUE if all values on the list are BooleanAlgebra.TURE, otherwise returns BooleanAlgebra.FALSE
    • orVariadic

      public static double orVariadic(double[] values)
      Boolean OR variadic
      Parameters:
      values - List of values
      Returns:
      Returns BooleanAlgebra.TRUE if at least one value on the list is BooleanAlgebra.TURE, otherwise returns BooleanAlgebra.FALSE
    • xorVariadic

      public static double xorVariadic(double[] values)
      Boolean XOR variadic
      Parameters:
      values - List of values
      Returns:
      Returns BooleanAlgebra.TRUE if exactly one value on the list is BooleanAlgebra.TURE, otherwise returns BooleanAlgebra.FALSE