revisionlogic
Class BinaryCompound

java.lang.Object
  extended byrevisionlogic.ISent
      extended byrevisionlogic.BinaryCompound

final class BinaryCompound
extends ISent

BinaryCompound represents an implication or a biconditional (equivalence) with two operands. It is a concrete subclass of ISent.

Author:
Daphne Liu, daphnel@sfu.ca; Sven Thiele, sthiele@rz.uni-potsdam.de

Field Summary
 
Fields inherited from class revisionlogic.ISent
ATOM, BIIMP, CONJ, CONT, DIS, IMP, NEG, TAUT
 
Method Summary
 java.lang.Object clone()
          Creates and returns a clone of this BinaryCompound.
(package private)  ISent conjunctionsIn()
          Returns a reference to this BinaryCompound, as a BinaryCompound has no outer conjunction sign to re-distribute.
(package private)  ISent disjunctionsIn()
          Returns a reference to this BinaryCompound, as a BinaryCompound has no outer disjunction sign to re-distribute.
 boolean equals(java.lang.Object s)
          Checks if this BinaryCompound equals s.
(package private)  java.util.HashSet getAtoms()
          Returns a set consisting of the literals of this BinaryCompound.
(package private)  int getDepth()
          Returns the depth (levels of nesting) of this BinaryCompound.
(package private)  java.lang.StringBuffer getLabelSB()
          Returns a string buffer holding the string representation of this BinaryCompound.
(package private)  ISent getSubSentence1()
          Returns the left operand.
(package private)  ISent getSubSentence2()
          Returns the right operand.
 int getType()
          Returns the type of this BinaryCompound.
 int hashCode()
          Returns the hash code of this BinaryCompound based on its two operands.
(package private)  ISent implicationsOut()
          Returns a reference to an equivalent ISent sentence, in which the implication has been replaced with disjunctions, and the biconditional with a conjunction of two disjunctions.
static ISent makeBiImp(ISent s1, ISent s2)
          Returns a reference to an ISent biconditional with left operand s1 and right operand s2.
static ISent makeImp(ISent s1, ISent s2)
          Returns a reference to an ISent implication with premise s1 and conclusion s2.
(package private)  ISent negationsIn()
          Returns a reference to this BinaryCompound, as a BinaryCompound has no outer negation sign to re-distribute.
 
Methods inherited from class revisionlogic.ISent
getCNF, getCNFUI, getDIMACSFormat, getDNFUI, getLabel, isConsistent, isConsistent, isConsistent, isInconsistentSList, isprConsistent
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

clone

public java.lang.Object clone()
Creates and returns a clone of this BinaryCompound.

Specified by:
clone in class ISent
Returns:
a reference to a clone of this BinaryCompound.

hashCode

public int hashCode()
Returns the hash code of this BinaryCompound based on its two operands.

Returns:
an int indicating the hash code of this BinaryCompound.

makeImp

public static ISent makeImp(ISent s1,
                            ISent s2)
Returns a reference to an ISent implication with premise s1 and conclusion s2.

Parameters:
s1 - a reference to the ISent sentence used as the premise.
s2 - a reference to the ISent sentence used as the conclusion.
Returns:
a reference to null if either s1 or s2 is null, or to the resultant ISent.

makeBiImp

public static ISent makeBiImp(ISent s1,
                              ISent s2)
Returns a reference to an ISent biconditional with left operand s1 and right operand s2.

Parameters:
s1 - a reference to the ISent sentence used as the left operand.
s2 - a reference to the ISent sentence used as the right operand.
Returns:
a reference to null if either s1 or s2 is null, or to the resultant ISent.

getType

public int getType()
Returns the type of this BinaryCompound.

Specified by:
getType in class ISent
Returns:
an int indicating the implication type or the biconditional type.

getDepth

int getDepth()
Returns the depth (levels of nesting) of this BinaryCompound.

Specified by:
getDepth in class ISent
Returns:
an int indicating the depth of this BinaryCompound.

getSubSentence1

ISent getSubSentence1()
Returns the left operand.

Returns:
a reference to the ISent sentence used as the left operand.

getSubSentence2

ISent getSubSentence2()
Returns the right operand.

Returns:
a reference to the ISent sentence used as the right operand.

getLabelSB

java.lang.StringBuffer getLabelSB()
Returns a string buffer holding the string representation of this BinaryCompound.

Specified by:
getLabelSB in class ISent
Returns:
a string buffer holding the string representation of this BinaryCompound.

getAtoms

java.util.HashSet getAtoms()
Returns a set consisting of the literals of this BinaryCompound.

Specified by:
getAtoms in class ISent
Returns:
a HashSet consisting of the literals of this BinaryCompound.

equals

public boolean equals(java.lang.Object s)
Checks if this BinaryCompound equals s.

Specified by:
equals in class ISent
Returns:
true if s is a BinaryCompound of the same type with equal operands, false otherwise.

implicationsOut

ISent implicationsOut()
Returns a reference to an equivalent ISent sentence, in which the implication has been replaced with disjunctions, and the biconditional with a conjunction of two disjunctions.

Specified by:
implicationsOut in class ISent
Returns:
a reference to an equivalent ISent sentence after the replacement of implications and biconditionals.

negationsIn

ISent negationsIn()
Returns a reference to this BinaryCompound, as a BinaryCompound has no outer negation sign to re-distribute.

Specified by:
negationsIn in class ISent
Returns:
a reference to this BinaryCompound.

disjunctionsIn

ISent disjunctionsIn()
Returns a reference to this BinaryCompound, as a BinaryCompound has no outer disjunction sign to re-distribute.

Specified by:
disjunctionsIn in class ISent
Returns:
a reference to this BinaryCompound.

conjunctionsIn

ISent conjunctionsIn()
Returns a reference to this BinaryCompound, as a BinaryCompound has no outer conjunction sign to re-distribute.

Specified by:
conjunctionsIn in class ISent
Returns:
a reference to this BinaryCompound.