revisionlogic
Class MultipleCompound

java.lang.Object
  extended byrevisionlogic.ISent
      extended byrevisionlogic.MultipleCompound

public final class MultipleCompound
extends ISent

MultipleCompound represents a disjunction or a conjunction with at least 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 MultipleCompound.
(package private)  ISent conjunctionsIn()
          Returns a reference to an equivalent ISent sentence, in which, for each operand, its outer conjunction signs are moved inside in the DNF transformation.
(package private)  ISent disjunctionsIn()
          Returns a reference to an equivalent ISent sentence, in which, for each operand, its outer disjunction signs are moved inside in the CNF transformation.
 boolean equals(java.lang.Object s)
          Checks if this MultipleCompound equals s.
(package private)  java.util.HashSet getAtoms()
          Returns a set consisting of the literals of this MultipleCompound.
(package private)  java.util.Vector getClauses()
          Returns the operands.
(package private)  int getDepth()
          Returns the depth (levels of nesting) of this MultipleCompound.
(package private)  java.lang.StringBuffer getLabelSB()
          Returns a string buffer holding the string representation of this MultipleCompound.
(package private)  ISent getSubSentence(int i)
          Returns the operand at index i.
 int getType()
          Returns the type of this MultipleCompound.
 int hashCode()
          Returns the hash code of this MultipleCompound based on its operands.
(package private)  ISent implicationsOut()
          Returns a reference to an equivalent ISent sentence, in which, for each operand, its implications have been replaced with disjunctions, and its biconditionals with a conjunction of two disjunctions.
static ISent makeConj(java.util.Collection sentSet)
          Returns a reference to an ISent conjunction of sentences in sentSet.
static ISent makeConj(ISent s1, ISent s2)
          Returns a reference to an ISent conjunction of sentences s1 and s2.
static ISent makeDis(java.util.Collection sentSet)
          Returns a reference to an ISent disjunction of sentences in sentSet.
static ISent makeDis(ISent s1, ISent s2)
          Returns a reference to an ISent disjunction of sentences s1 and s2.
(package private)  ISent negationsIn()
          Returns a reference to an equivalent ISent sentence, in which, for each operand, its negation signs appear only on the literals.
 
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 MultipleCompound.

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

makeConj

public static ISent makeConj(ISent s1,
                             ISent s2)
Returns a reference to an ISent conjunction of sentences s1 and s2.

Parameters:
s1 - a reference to the ISent sentence used as the left conjunct.
s2 - a reference to the ISent sentence used as the right conjunct.
Returns:
a reference to the resultant ISent.

hashCode

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

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

makeDis

public static ISent makeDis(ISent s1,
                            ISent s2)
Returns a reference to an ISent disjunction of sentences s1 and s2.

Parameters:
s1 - a reference to the ISent sentence used as the left disjunct.
s2 - a reference to the ISent sentence used as the right disjunct.
Returns:
a reference to the resultant ISent.

makeConj

public static ISent makeConj(java.util.Collection sentSet)
Returns a reference to an ISent conjunction of sentences in sentSet.

Parameters:
sentSet - the collection of ISent sentences used as the conjuncts.
Returns:
a reference to the resultant ISent.

makeDis

public static ISent makeDis(java.util.Collection sentSet)
Returns a reference to an ISent disjunction of sentences in sentSet.

Parameters:
sentSet - the collection of ISent sentences used as the disjuncts.
Returns:
a reference to the resultant ISent.

getType

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

Specified by:
getType in class ISent
Returns:
an int indicating the disjunction type or the conditional type.

getDepth

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

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

getSubSentence

ISent getSubSentence(int i)
Returns the operand at index i.

Parameters:
i - an int indicating the index of the operand to be returned.
Returns:
a reference to the ISent operand at index i.

getLabelSB

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

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

getAtoms

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

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

equals

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

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

implicationsOut

ISent implicationsOut()
Returns a reference to an equivalent ISent sentence, in which, for each operand, its implications have been replaced with disjunctions, and its biconditionals 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 in each operand.

negationsIn

ISent negationsIn()
Returns a reference to an equivalent ISent sentence, in which, for each operand, its negation signs appear only on the literals.

Specified by:
negationsIn in class ISent
Returns:
a reference to an equivalent ISent sentence after the re-distribution of the outer negation signs in each operand.

disjunctionsIn

ISent disjunctionsIn()
Returns a reference to an equivalent ISent sentence, in which, for each operand, its outer disjunction signs are moved inside in the CNF transformation.

Specified by:
disjunctionsIn in class ISent
Returns:
a reference to an equivalent ISent sentence after the re-distribution of the outer disjunction signs in each operand.

getClauses

java.util.Vector getClauses()
Returns the operands.

Returns:
the Vector of ISent sentences used as the operands.

conjunctionsIn

ISent conjunctionsIn()
Returns a reference to an equivalent ISent sentence, in which, for each operand, its outer conjunction signs are moved inside in the DNF transformation.

Specified by:
conjunctionsIn in class ISent
Returns:
a reference to an equivalent ISent sentence after the re-distribution of the outer conjunction signs in each operand.