revisionlogic
Class Negation

java.lang.Object
  extended byrevisionlogic.ISent
      extended byrevisionlogic.Negation

final class Negation
extends ISent

Negation represents a negation. 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 Negation.
(package private)  ISent conjunctionsIn()
          Returns a reference to this Negation, as this method is invoked only after (1) the implications and the biconditionals have been replaced with and, or, and not, and (2) the negations signs have been re-distributed to the literals.
(package private)  ISent disjunctionsIn()
          Returns a reference to this Negation, as this method is invoked only after (1) the implications and the biconditionals have been replaced with and, or, and not, and (2) the negations signs have been re-distributed to the literals.
 boolean equals(java.lang.Object s)
          Checks if this Negation equals s.
(package private)  java.util.HashSet getAtoms()
          Returns a set consisting of the literals of this Negation.
(package private)  int getDepth()
          Returns the depth (levels of nesting) of this Negation.
(package private)  java.lang.StringBuffer getLabelSB()
          Returns a string buffer holding a negation sign and the string representation of the negated sentence.
(package private)  ISent getSubSentence()
          Returns the negated sentence.
 int getType()
          Returns the type of this Negation.
 int hashCode()
          Returns the hash code of this Negation based on its negated sentence.
(package private)  ISent implicationsOut()
          Returns a reference to an equivalent ISent sentence, in which the negated sentence has all its implications and biconditionals replaced with and, or, and not.
(package private) static ISent makeNeg(ISent s)
          Returns a reference to an ISent as a result of negating the sentence s.
(package private)  ISent negationsIn()
          Returns a reference to an equivalent ISent sentence, in which 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

makeNeg

static ISent makeNeg(ISent s)
Returns a reference to an ISent as a result of negating the sentence s.

Parameters:
s - a reference to the ISent sentence to be negated.
Returns:
a reference to null if s is null, or to the resultant ISent.

clone

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

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

hashCode

public int hashCode()
Returns the hash code of this Negation based on its negated sentence.

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

getType

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

Specified by:
getType in class ISent
Returns:
an int indicating the negation type.

getDepth

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

Specified by:
getDepth in class ISent
Returns:
an int indicating the depth of the underlying negated sentence.

getSubSentence

ISent getSubSentence()
Returns the negated sentence.

Returns:
a reference to the underlying negated ISent sentence.

getLabelSB

java.lang.StringBuffer getLabelSB()
Returns a string buffer holding a negation sign and the string representation of the negated sentence.

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

getAtoms

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

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

equals

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

Specified by:
equals in class ISent
Returns:
true if s is a Negation with an equal negated sentence, false otherwise.

implicationsOut

ISent implicationsOut()
Returns a reference to an equivalent ISent sentence, in which the negated sentence has all its implications and biconditionals replaced with and, or, and not.

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 an equivalent ISent sentence, in which 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.

disjunctionsIn

ISent disjunctionsIn()
Returns a reference to this Negation, as this method is invoked only after (1) the implications and the biconditionals have been replaced with and, or, and not, and (2) the negations signs have been re-distributed to the literals.

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

conjunctionsIn

ISent conjunctionsIn()
Returns a reference to this Negation, as this method is invoked only after (1) the implications and the biconditionals have been replaced with and, or, and not, and (2) the negations signs have been re-distributed to the literals.

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