Pandora.LogicParser.Formula
Class Term

java.lang.Object
  extended by Pandora.LogicParser.Formula.Term
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
AExp, Function, Num, SimpleTerm, SkTerm, SVar, Var

public abstract class Term
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

This abstract class is the superclass of all classes that represent a term in Pnadora
As in Pandora we use first order predicate logic a term can be:

See Also:
Serialized Form

Constructor Summary
Term()
           
 
Method Summary
abstract  void addToSignature(PanSignature signature)
          This method adds this Term to the passed PanSignature IF it is not already in the signature
abstract  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.
abstract  Term clone()
          Returns a copy(clone) of this Term.
 java.util.List<Term> concatNoDup(java.util.List<Term> terms)
          This method removes the duplicates from the Term list.
abstract  java.lang.String display()
          Returns a String to display the Term.
 boolean equals(Term t)
          Returns true if the passed Term is equal to this Term.
abstract  java.lang.String getName()
          Returns the name of the Term.
 java.util.List<Var> getVars()
          Returns the list of all varibles this Term is bound to.
 boolean isIn(java.util.List<Term> terms)
          Returns true if this term is in the passed List.
abstract  boolean isIn(PanSignature signature)
          Returns true if this Term is in the passed PanSignature
 boolean isInVars(java.util.List<Var> vars)
          Returns true if this Term is in the passed List.
abstract  void setVars(Var v)
          This method adds Var v to the list of variables this Term is bound to.
abstract  Term sub(Term x, Term y)
          Substitutes all the occurences of Term x by Term y.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Term

public Term()
Method Detail

sub

public abstract Term sub(Term x,
                         Term y)
Substitutes all the occurences of Term x by Term y.

Parameters:
x - represents the Term to be substituted.
y - represents the Term used to substitute the Term x

isIn

public abstract boolean isIn(PanSignature signature)
Returns true if this Term is in the passed PanSignature

Parameters:
signature - PanSignature represents the signature it is to be searched in.

equals

public boolean equals(Term t)
Returns true if the passed Term is equal to this Term.

Parameters:
t - Term represents the Term it is to be compared against.

display

public abstract java.lang.String display()
Returns a String to display the Term.


clone

public abstract Term clone()
Returns a copy(clone) of this Term.

Overrides:
clone in class java.lang.Object

clashes

public abstract 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.

Parameters:
signature - PanSignature Represents the signature to be compared against.

getName

public abstract java.lang.String getName()
Returns the name of the Term.


setVars

public abstract void setVars(Var v)
This method adds Var v to the list of variables this Term is bound to.

Parameters:
v - Var represents the Var to be added to the list of this Term's variables.

addToSignature

public abstract void addToSignature(PanSignature signature)
This method adds this Term to the passed PanSignature IF it is not already in the signature

Parameters:
signature - PanSignature represents the signature to add this Formula to.

concatNoDup

public java.util.List<Term> concatNoDup(java.util.List<Term> terms)
This method removes the duplicates from the Term list.


isIn

public boolean isIn(java.util.List<Term> terms)
Returns true if this term is in the passed List.

Parameters:
terms - List represents the List to search for this Term in.

isInVars

public boolean isInVars(java.util.List<Var> vars)
Returns true if this Term is in the passed List.

Parameters:
vars - List represents the List to search for this Term in.

getVars

public java.util.List<Var> getVars()
Returns the list of all varibles this Term is bound to.