revisionlogic
Class Atom

java.lang.Object
  extended byrevisionlogic.ISent
      extended byrevisionlogic.Atom

final class Atom
extends ISent

Atom represents an atom. It is a concrete subclass of ISent.

Author:
Daphne Liu, daphnel@sfu.ca

Field Summary
(package private)  java.lang.String m_LabelStr
          A reference to the literal string.
 
Fields inherited from class revisionlogic.ISent
ATOM, BIIMP, CONJ, CONT, DIS, IMP, NEG, TAUT
 
Constructor Summary
(package private) Atom(java.lang.String s)
          Creates a new Atom with literal s.
 
Method Summary
 java.lang.Object clone()
          Creates and returns a clone of this Atom.
(package private)  ISent conjunctionsIn()
          Returns a reference to this Atom, as the dnf transformation of an atom remains the same as the atom.
(package private)  ISent disjunctionsIn()
          Returns a reference to this Atom, as the cnf transformation of an atom remains the same as the atom.
 boolean equals(java.lang.Object s)
          Checks if this Atom equals s.
(package private)  java.util.HashSet getAtoms()
          Returns a set consisting of the literal of this Atom.
 ISent getCNF()
          Returns a reference to this Atom, as the cnf transformation of an atom remains the same as the atom.
 ISent getCNFUI()
          Returns a reference to this Atom, as the cnf transformation of an atom remains the same as the atom.
(package private)  int getDepth()
          Returns the depth of this Atom.
 ISent getDNFUI()
          Returns a reference to this Atom, as the dnf transformation of an atom remains the same as the atom.
 java.lang.String getLabel()
          Returns the string representation of this Atom.
(package private)  java.lang.StringBuffer getLabelSB()
          Returns the string buffer holding the literal of this Atom.
 int getType()
          Returns the type of this Atom.
 int hashCode()
          Returns the hash code of this Atom based on its literal.
(package private)  ISent implicationsOut()
          Returns a reference to this Atom, as the cnf and dnf transformations of an atom remain the same as the atom.
 boolean isConsistent()
          Returns true to indicate this Atom is itself consistent.
(package private)  ISent negationsIn()
          Returns a reference to this Atom, as the cnf and dnf transformations of an atom remain the same as the atom.
 
Methods inherited from class revisionlogic.ISent
getDIMACSFormat, isConsistent, isConsistent, isInconsistentSList, isprConsistent
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_LabelStr

java.lang.String m_LabelStr
A reference to the literal string.

Constructor Detail

Atom

Atom(java.lang.String s)
Creates a new Atom with literal s.

Parameters:
s - a reference to the literal string.
Method Detail

clone

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

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

getDepth

int getDepth()
Returns the depth of this Atom.

Specified by:
getDepth in class ISent
Returns:
always 0 for the depth of this Atom.

getType

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

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

getLabelSB

java.lang.StringBuffer getLabelSB()
Returns the string buffer holding the literal of this Atom.

Specified by:
getLabelSB in class ISent
Returns:
the string buffer holding the literal of this Atom.

getLabel

public java.lang.String getLabel()
Returns the string representation of this Atom.

Overrides:
getLabel in class ISent
Returns:
the string representation of this Tautology.

hashCode

public int hashCode()
Returns the hash code of this Atom based on its literal.

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

equals

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

Specified by:
equals in class ISent
Returns:
true if s is an Atom with the same literal, false otherwise.

isConsistent

public boolean isConsistent()
Returns true to indicate this Atom is itself consistent.

Overrides:
isConsistent in class ISent
Returns:
always true to indicate this Atom is itself consistent.

getAtoms

java.util.HashSet getAtoms()
Returns a set consisting of the literal of this Atom.

Specified by:
getAtoms in class ISent
Returns:
a HashSet consisting of the literal of this Atom.

implicationsOut

ISent implicationsOut()
Returns a reference to this Atom, as the cnf and dnf transformations of an atom remain the same as the atom.

Specified by:
implicationsOut in class ISent
Returns:
a reference to this Atom.

negationsIn

ISent negationsIn()
Returns a reference to this Atom, as the cnf and dnf transformations of an atom remain the same as the atom.

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

disjunctionsIn

ISent disjunctionsIn()
Returns a reference to this Atom, as the cnf transformation of an atom remains the same as the atom.

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

conjunctionsIn

ISent conjunctionsIn()
Returns a reference to this Atom, as the dnf transformation of an atom remains the same as the atom.

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

getCNF

public ISent getCNF()
Returns a reference to this Atom, as the cnf transformation of an atom remains the same as the atom.

Overrides:
getCNF in class ISent
Returns:
a reference to this Atom.

getCNFUI

public ISent getCNFUI()
Returns a reference to this Atom, as the cnf transformation of an atom remains the same as the atom.

This method is invoked only by the ListSent constructors.

Overrides:
getCNFUI in class ISent
Returns:
a reference to this Atom.

getDNFUI

public ISent getDNFUI()
Returns a reference to this Atom, as the dnf transformation of an atom remains the same as the atom.

This method is invoked only by the ListSent constructors.

Overrides:
getDNFUI in class ISent
Returns:
a reference to this Atom.