Pandora.LogicParser.Formula
Class Equals

java.lang.Object
  extended by Pandora.LogicParser.Formula.Formula
      extended by Pandora.LogicParser.Formula.Atom
          extended by Pandora.LogicParser.Formula.Predicate
              extended by Pandora.LogicParser.Formula.Equals
All Implemented Interfaces:
java.io.Serializable

public class Equals
extends Predicate

The Equals formula.
Extends class Predicate.

See Also:
Serialized Form

Constructor Summary
Equals(java.util.Vector<Term> terms)
          Constructs an Equals formula.
 
Method Summary
 boolean check2(Term a, Term b, Equals e)
          A helper function used by the checkSub method
Returns true if the passed formula f can be reached by substituting th eoccurrences of Term x by Term y in this Formula.
 boolean checkSub(Term a, Term b, Formula f)
          Returns true if the passed formula f can be reached by substituting th eoccurrences of Term x by Term y in this Formula.
 java.lang.String display()
          Returns the String to display the equality formula.
 Term getLeftTerm()
          Returns the left hand side of the equality.
 Term getRightTerm()
          Returns the right hand side of the equality.
 java.util.List<Term> getTerms()
          Returns both left and right side of the equality in a list of Terms.
 Formula regenerate()
          Returns a copy of the Formula which can be saved as part of the copy made for the undo function.
 void setAtoms()
          Adds this atom to the list of atoms for the formula.
 Formula subAll(Term a, Term b)
          Returns the Formula that is derived after substituting ALL the occurrences of Term x with Term y in this Formula.
 
Methods inherited from class Pandora.LogicParser.Formula.Predicate
check2, checkFunc, clone, equals, getArity, getName, getParams, setParams, setVars, subVar
 
Methods inherited from class Pandora.LogicParser.Formula.Atom
addToSignature, clashes, clashes, clashes, equals, getPrecedence, isIn, s
 
Methods inherited from class Pandora.LogicParser.Formula.Formula
check, concatNoDup, getAtoms, getLeft, getRight, getTuples, getVars, higher, isBracketed, map, setLeft, setRight, setTuples, showTuples, sub
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Equals

public Equals(java.util.Vector<Term> terms)
Constructs an Equals formula.

Parameters:
terms - Vector represents the list of the terms of the equality(i.e. Left and Right hand Terms)
Method Detail

getLeftTerm

public Term getLeftTerm()
Returns the left hand side of the equality.


getRightTerm

public Term getRightTerm()
Returns the right hand side of the equality.


display

public java.lang.String display()
Returns the String to display the equality formula.

Overrides:
display in class Predicate

setAtoms

public void setAtoms()
Adds this atom to the list of atoms for the formula.
The list of atoms is found in Formula class.

Overrides:
setAtoms in class Atom

getTerms

public java.util.List<Term> getTerms()
Returns both left and right side of the equality in a list of Terms.

Overrides:
getTerms in class Predicate

checkSub

public boolean checkSub(Term a,
                        Term b,
                        Formula f)
Returns true if the passed formula f can be reached by substituting th eoccurrences of Term x by Term y in this Formula.

Overrides:
checkSub in class Predicate
Parameters:
a - Term represents the Term to be substituted.
b - Term represents the Term to substitute Term a.
f - Formula represents the Formula to check if it can be reached after substitution.

check2

public boolean check2(Term a,
                      Term b,
                      Equals e)
A helper function used by the checkSub method
Returns true if the passed formula f can be reached by substituting th eoccurrences of Term x by Term y in this Formula.

Parameters:
a - Term represents the Term to be substituted.
b - Term represents the Term to substitute Term a.
e - Equals represents the Equals Formula to check if it can be reached after substitution.

subAll

public Formula subAll(Term a,
                      Term b)
Returns the Formula that is derived after substituting ALL the occurrences of Term x with Term y in this Formula.

Overrides:
subAll in class Predicate
Parameters:
a - Term represents the Term to be substituted.
b - Term represents the Term to substitute Term a.

regenerate

public Formula regenerate()
Returns a copy of the Formula which can be saved as part of the copy made for the undo function.

Overrides:
regenerate in class Predicate