net.sf.molae.logic.tools
Class BooleanOperators

java.lang.Object
  |
  +--net.sf.molae.logic.tools.BooleanOperators

public final class BooleanOperators
extends Object

All boolean operators. (A boolean operator maps two Booleans to a Boolean.)

Since:
1.1

Field Summary
static BinaryFunction AND
          The binary function that computes a & b.
static BinaryFunction AND_NOT
          The binary function that computes a & !b.
static BinaryFunction CONSTANT_FALSE
          The binary function that returns always FALSE.
static BinaryFunction CONSTANT_TRUE
          The binary function that returns always TRUE.
static BinaryFunction EQUALS
          The binary function that computes a == b.
static BinaryFunction FIRST_OPERAND
          The binary function that returns the first operand.
static BinaryFunction IMPLIES
          The binary function that computes b ¦ !a.
static TwoWayTransformer NOT
          A transformer that negates Booleans.
static BinaryFunction NOT_AND
          The binary function that computes !(a & b).
static BinaryFunction NOT_FIRST_OPERAND
          The binary function that returns the negation of the first operand.
static BinaryFunction NOT_IMPLIED_BY
          The binary function that computes !a & b.
static BinaryFunction NOT_OR
          The binary function that computes !(a ¦ b).
static BinaryFunction NOT_SECOND_OPERAND
          The binary function that returns the negation of the second operand.
static List OPERATOR_LIST
          A list containing all boolean operators.
static BinaryFunction OR
          The binary function that computes a ¦ b.
static BinaryFunction OR_NOT
          The binary function that computes a ¦ !b.
static BinaryFunction SECOND_OPERAND
          The binary function that returns the second operand.
static BinaryFunction XOR
          The binary function that computes a ^ b.
 
Method Summary
static BinaryFunction getDeMorganOperator(BinaryFunction operator)
          Returns the deMorgan operator of the specified operator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AND

public static final BinaryFunction AND
The binary function that computes a & b.

AND_NOT

public static final BinaryFunction AND_NOT
The binary function that computes a & !b.

CONSTANT_FALSE

public static final BinaryFunction CONSTANT_FALSE
The binary function that returns always FALSE.

CONSTANT_TRUE

public static final BinaryFunction CONSTANT_TRUE
The binary function that returns always TRUE.

EQUALS

public static final BinaryFunction EQUALS
The binary function that computes a == b.

FIRST_OPERAND

public static final BinaryFunction FIRST_OPERAND
The binary function that returns the first operand.

NOT_AND

public static final BinaryFunction NOT_AND
The binary function that computes !(a & b).

NOT_OR

public static final BinaryFunction NOT_OR
The binary function that computes !(a ¦ b).

NOT_SECOND_OPERAND

public static final BinaryFunction NOT_SECOND_OPERAND
The binary function that returns the negation of the second operand.

OR

public static final BinaryFunction OR
The binary function that computes a ¦ b.

OR_NOT

public static final BinaryFunction OR_NOT
The binary function that computes a ¦ !b.

SECOND_OPERAND

public static final BinaryFunction SECOND_OPERAND
The binary function that returns the second operand.

XOR

public static final BinaryFunction XOR
The binary function that computes a ^ b.

IMPLIES

public static final BinaryFunction IMPLIES
The binary function that computes b ¦ !a.

NOT_FIRST_OPERAND

public static final BinaryFunction NOT_FIRST_OPERAND
The binary function that returns the negation of the first operand.

NOT_IMPLIED_BY

public static final BinaryFunction NOT_IMPLIED_BY
The binary function that computes !a & b.

OPERATOR_LIST

public static final List OPERATOR_LIST
A list containing all boolean operators.

NOT

public static final TwoWayTransformer NOT
A transformer that negates Booleans.
Method Detail

getDeMorganOperator

public static BinaryFunction getDeMorganOperator(BinaryFunction operator)
Returns the deMorgan operator of the specified operator. The deMorgan operator dmo is a binary function that fulfills

!operator.compute(arg1, arg2).equals(dmo.compute(!arg1, !arg2))

Parameters:
operator - a boolean operator.
Returns:
the deMorgan operator of this operator.
Throws:
IllegalArgumentException - operator is not an operator defined in this class (i.e. contained in OPERATOR_LIST).