Pandora.LogicParser.Formula.BExp
Class BExp

java.lang.Object
  extended by Pandora.LogicParser.Formula.Formula
      extended by Pandora.LogicParser.Formula.BExp.BExp
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
EqualTo, GreaterThan, GTE, LessThan, LTE, NotEqual

public abstract class BExp
extends Formula

Abstract class for boolean expressions.

See Also:
Serialized Form

Field Summary
 Term left
           
 Term right
           
 
Constructor Summary
BExp()
           
 
Method Summary
 void addToSignature(PanSignature signature)
          This method adds this Formula to the passed PanSignature's Predicate list IF it is not already in the signature
If this Formula is an instance of Predicate, its Parameters will be added to the signature as well
 boolean checkSub(Term x, Term y, Formula f)
          Returns true if the passed formula f can be reached by substituting the occurrences of Term x by Term y.
 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  java.lang.String display()
          Returns a String to display the BExp.
 Term getLeftTerm()
          Returns the left hand side of the boolean expression.
 int getPrecedence()
          Returns an integer representing the precedence of this formula according to binding conventions
 Term getRightTerm()
          Returns the right hand side of the boolean expression.
 java.util.List<Term> getTerms()
          Returns both left and right side of the boolean expression in a list of Terms.
 void setAtoms()
          Adds the list of Atoms in a given tree to the list of Atoms.
 void setVars(Var v)
          This method adds Var v to the list of variables this Formula is bound to
 
Methods inherited from class Pandora.LogicParser.Formula.Formula
check, concatNoDup, getAtoms, getLeft, getRight, getTuples, getVars, higher, isBracketed, map, regenerate, s, setLeft, setRight, setTuples, showTuples, sub, subAll
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

left

public Term left

right

public Term right
Constructor Detail

BExp

public BExp()
Method Detail

display

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

Specified by:
display in class Formula

getLeftTerm

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


getRightTerm

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


checkSub

public boolean checkSub(Term x,
                        Term y,
                        Formula f)
Returns true if the passed formula f can be reached by substituting the occurrences of Term x by Term y.

Specified by:
checkSub in class Formula
Parameters:
x - Term represents the Term to be substituted.
y - Term represents the Term to substitute Term x.
f - Formula represents the Formula to check if it can be reached after substitution.

setAtoms

public void setAtoms()
Adds the list of Atoms in a given tree to the list of Atoms.

Specified by:
setAtoms in class Formula

clashes

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

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

getTerms

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

Specified by:
getTerms in class Formula

addToSignature

public void addToSignature(PanSignature signature)
This method adds this Formula to the passed PanSignature's Predicate list IF it is not already in the signature
If this Formula is an instance of Predicate, its Parameters will be added to the signature as well

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

setVars

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

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

getPrecedence

public int getPrecedence()
Description copied from class: Formula
Returns an integer representing the precedence of this formula according to binding conventions

Specified by:
getPrecedence in class Formula