|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectPandora.LogicParser.Formula.Formula
Pandora.LogicParser.Formula.Atom
Pandora.LogicParser.Formula.Predicate
public class Predicate
The Predicate formula.
Extends abstract class Atom.
Constructor Summary | |
---|---|
Predicate(java.lang.String name,
java.util.Vector<Term> params)
Constructs a Predicate Formula. |
Method Summary | |
---|---|
boolean |
check2(Term a,
Term b,
Predicate p)
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 f1,
Function f2)
|
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 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 p)
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> params)
Sets the parameter list of this Predicate to the passed list |
void |
setVars(Var v)
This method adds Var v to the list of variables this Predicate is bound to. |
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 Predicate. |
boolean |
subVar(Predicate p)
|
Methods inherited from class Pandora.LogicParser.Formula.Atom |
---|
addToSignature, clashes, clashes, clashes, equals, getPrecedence, isIn, s, setAtoms |
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 |
---|
public Predicate(java.lang.String name, java.util.Vector<Term> params)
name
- String of the name of the Predicate.params
- 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> params)
params
- Vectorpublic java.lang.String display()
display
in class Atom
public Predicate clone()
clone
in class java.lang.Object
public boolean equals(Predicate p)
p
- Predicate represents the predicate it is to be compared against.public boolean checkSub(Term a, Term b, Formula f)
checkSub
in class Atom
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 boolean check2(Term a, Term b, Predicate p)
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 boolean subVar(Predicate p)
public boolean checkFunc(Function f1, Function f2)
public Formula subAll(Term a, Term b)
subAll
in class Atom
x
- Term represents the Term to be substituted.y
- Term represents the Term to substitute Term x.public void setVars(Var v)
setVars
in class Atom
v
- 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 |