|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectRaptor.LogicParser.Formula.Formula
Raptor.LogicParser.Formula.Atom
Raptor.LogicParser.Formula.Predicate
public class Predicate
The Predicate formula.
Extends abstract class Atom.
Constructor Summary | |
---|---|
Predicate(java.lang.String pName,
java.util.Vector<Term> pParams)
Constructs a Predicate Formula. |
Method Summary | |
---|---|
boolean |
check2(Term pTermX,
Term pTermY,
Predicate pPred)
A helper function used by th checkSub method. Returns true if the passed formula f can be reached by substituting th eoccurrences of Term x by Term y in this Predicate. |
boolean |
checkFunc(Function pFunction1,
Function pFunction2)
|
boolean |
checkSub(Term pTermX,
Term pTermY,
Formula pFormula)
Returns true if the passed formula f can be reached by substituting th eoccurrences of Term x by Term y in this Predicate. If no Term is passed to be substituted(a = null) it is the case that we have to check if formula f can be reached by substituting any of its Terms. |
Predicate |
clone()
Returns a clone(copy) of this Predicate. |
java.lang.String |
display()
Returns an String representation of the Predicate formula. |
boolean |
equals(Predicate pPred)
Returns true if the passed Predicate is equal to this Predicate. Two predicates are equal if they have the same name and the same arity. |
int |
getArity()
Returns the Arity of the Predicate. |
java.lang.String |
getName()
Returns the name of the Predicate. |
java.util.Vector<Term> |
getParams()
Returns the list of parameters of this Predicate. |
java.util.List<Term> |
getTerms()
This method returns a list |
Formula |
regenerate()
Returns a copy of the Formula which can be saved as part of the copy made for the undo function. |
void |
setParams(java.util.Vector<Term> pParams)
Sets the parameter list of this Predicate to the passed list. |
void |
setVars(Var pVar)
This method adds Var v to the list of variables this Predicate 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 in this Predicate. |
boolean |
subVar(Predicate pPred)
|
Methods inherited from class Raptor.LogicParser.Formula.Atom |
---|
addToSignature, clashes, clashes, clashes, equals, getPrecedence, isIn, s, setAtoms, ST, subAll, subBoolRes |
Methods inherited from class Raptor.LogicParser.Formula.Formula |
---|
check, concatNoDup, getAtoms, getLeft, getRight, getTuples, getVars, higher, map, setLeft, setRight, setTuples, showTuples, sub, subBool |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Predicate(java.lang.String pName, java.util.Vector<Term> pParams)
pName
- String of the name of the Predicate.pParams
- VectorMethod Detail |
---|
public java.lang.String getName()
getName
in class Atom
public int getArity()
getArity
in class Atom
public java.util.Vector<Term> getParams()
public void setParams(java.util.Vector<Term> pParams)
pParams
- Vectorpublic java.lang.String display()
display
in class Atom
public Predicate clone()
clone
in class java.lang.Object
public boolean equals(Predicate pPred)
pPred
- Predicate represents the predicate it is to be compared
against.public boolean checkSub(Term pTermX, Term pTermY, Formula pFormula)
checkSub
in class Atom
pTermX
- Term represents the Term to be substituted.pTermY
- Term represents the Term to substitute Term x.pFormula
- Formula represents the Formula to check if it can be reached
after substitution.public boolean check2(Term pTermX, Term pTermY, Predicate pPred)
pTermX
- Term represents the Term to be substituted.pTermY
- Term represents the Term to substitute Term x.pPred
- Formula represents the Formula to check if it can be reached
after substitution.public boolean subVar(Predicate pPred)
public boolean checkFunc(Function pFunction1, Function pFunction2)
public Formula subAll(Term pTermX, Term pTermY)
subAll
in class Atom
pTermX
- Term represents the Term to be substituted.pTermY
- Term represents the Term to substitute Term x.public void setVars(Var pVar)
setVars
in class Atom
pVar
- Var represents the Var to be added to the list of this
Predicate's variables.public java.util.List<Term> getTerms()
getTerms
in class Atom
public Formula regenerate()
regenerate
in class Atom
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |