Raptor.LogicParser.Formula
Class LogicTerm

java.lang.Object
  extended by Raptor.LogicParser.Formula.Term
      extended by Raptor.LogicParser.Formula.LogicTerm
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class LogicTerm
extends Term

See Also:
Serialized Form

Constructor Summary
LogicTerm(Formula f)
           
 
Method Summary
 void addToSignature(PanSignature signature)
          This method adds this Term to the passed PanSignature IF it is not already in the signature.
 java.lang.String clashes(PanSignature signature)
          Returns a String of error message if this Term clashes with the passed PanSignature.
A Term clashes with a PanSignature if it clashes with any of its Predicates,Constants,Functions or Variables.
If this Term does not clash with the Signature, it is added to the signature and an empty String is returned.
 Term clone()
          Returns a copy(clone) of this Term.
 java.lang.String display()
          Returns a String to display the Term.
 java.lang.String getName()
          Returns the name of the Term.
 boolean isIn(PanSignature signature)
          Returns true if this Term is in the passed PanSignature.
 void setVars(Var var)
          This method adds Var v to the list of variables this Term is bound to.
 Term sub(Term termX, Term termY)
          Substitutes all the occurences of Term x by Term y.
 
Methods inherited from class Raptor.LogicParser.Formula.Term
concatNoDup, equals, getVars, isIn, isInVars
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogicTerm

public LogicTerm(Formula f)
Method Detail

addToSignature

public void addToSignature(PanSignature signature)
Description copied from class: Term
This method adds this Term to the passed PanSignature IF it is not already in the signature.

Specified by:
addToSignature in class Term
Parameters:
signature - PanSignature represents the signature to add this Formula to.

clashes

public java.lang.String clashes(PanSignature signature)
Description copied from class: Term
Returns a String of error message if this Term clashes with the passed PanSignature.
A Term clashes with a PanSignature if it clashes with any of its Predicates,Constants,Functions or Variables.
If this Term does not clash with the Signature, it is added to the signature and an empty String is returned.

Specified by:
clashes in class Term
Parameters:
signature - PanSignature Represents the signature to be compared against.

clone

public Term clone()
Description copied from class: Term
Returns a copy(clone) of this Term.

Specified by:
clone in class Term

display

public java.lang.String display()
Description copied from class: Term
Returns a String to display the Term.

Specified by:
display in class Term

getName

public java.lang.String getName()
Description copied from class: Term
Returns the name of the Term.

Specified by:
getName in class Term

isIn

public boolean isIn(PanSignature signature)
Description copied from class: Term
Returns true if this Term is in the passed PanSignature.

Specified by:
isIn in class Term
Parameters:
signature - PanSignature represents the signature it is to be searched in.

setVars

public void setVars(Var var)
Description copied from class: Term
This method adds Var v to the list of variables this Term is bound to.

Specified by:
setVars in class Term
Parameters:
var - Var represents the Var to be added to the list of this Term's variables.

sub

public Term sub(Term termX,
                Term termY)
Description copied from class: Term
Substitutes all the occurences of Term x by Term y.

Specified by:
sub in class Term
Parameters:
termX - represents the Term to be substituted.
termY - represents the Term used to substitute the Term x