|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectRaptor.LogicParser.Formula.Formula
Raptor.ProgramParser.Statements.PBExp.PBExp
public abstract class PBExp
Abstract class for boolean expressions.
Field Summary | |
---|---|
PTerm |
left
|
java.lang.String |
op
|
PTerm |
right
|
Constructor Summary | |
---|---|
PBExp(PTerm pLeft,
PTerm pRight,
java.lang.String pOp)
Create a new binary expression |
Method Summary | |
---|---|
void |
addToSignature(PanSignature pSignature)
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 |
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 pSignature)
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. |
java.lang.String |
display()
Returns a String to display the BExp. |
PTerm |
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 |
PTerm |
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 pVar)
This method adds Var v to the list of variables this Formula is bound to |
Formula |
subAll(Term pTermX,
Term pTermY)
Returns the Formula that is derived after substituting ALL the occurrences of Term x with Term y. |
Methods inherited from class Raptor.LogicParser.Formula.Formula |
---|
check, concatNoDup, getAtoms, getLeft, getRight, getTuples, getVars, higher, map, regenerate, s, setLeft, setRight, setTuples, showTuples, ST, sub, subAll, subBool, subBoolRes |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public PTerm left
public PTerm right
public java.lang.String op
Constructor Detail |
---|
public PBExp(PTerm pLeft, PTerm pRight, java.lang.String pOp)
pLeft
- the left side of the binary expressionpRight
- the right side of the binary expressionpOp
- the operator of the binary expressionMethod Detail |
---|
public java.lang.String display()
display
in class Formula
public PTerm getLeftTerm()
public PTerm getRightTerm()
public Formula subAll(Term pTermX, Term pTermY)
subAll
in class Formula
pTermX
- Term represents the Term to be substituted.pTermY
- Term represents the Term to substitute Term x.public boolean checkSub(Term x, Term y, Formula f)
checkSub
in class Formula
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.public void setAtoms()
setAtoms
in class Formula
public java.util.List<Term> getTerms()
getTerms
in class Formula
public void addToSignature(PanSignature pSignature)
addToSignature
in class Formula
pSignature
- PanSignature represents the signature to add this Formula to.public java.lang.String clashes(PanSignature pSignature)
clashes
in class Formula
pSignature
- PanSignature Represents the signature to be compared against.public void setVars(Var pVar)
setVars
in class Formula
pVar
- Var represents the Var to be added to the list of this
Formula's variables.public int getPrecedence()
getPrecedence
in class Formula
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |