|
|||||||||
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
public class Atom
The Atom formula.
Extends abstract class Formula.
Constructor Summary | |
---|---|
Atom(java.lang.String pID)
Constructs an Atom Formula. |
Method Summary | |
---|---|
void |
addToSignature(PanSignature pSignature)
This method adds this Atom to the passed PanSignature's Predicate list IF it is not already in the signature. If this Atom is an instance of Predicate, its Parameters |
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 Atom. |
boolean |
clashes(Atom pAtom)
Returns true if this Atom clashes with the passed Atom An Atom clashes with another Atom if they have the same name but different arities. |
java.lang.String |
clashes(PanSignature pSignature)
Returns a String containing an Error character if this Atom clashes with the passed PanSignature, Otherwise it will return an Empty String "" An Atom clashes with a signature if it clashes with any of its Predicates/Functions/Constants/Variables. |
boolean |
clashes(Term pTerm)
Returns true if this Atom clashes with the passed Term An Atom clashes with a Term if they have the same name. |
java.lang.String |
display()
Returns the a String to display the Atom formula. |
boolean |
equals(Atom pAtom)
Returns true if this Atom is equal with the passes Atom. Two Atoms are equal if they have the same name and the same arity. |
int |
getArity()
Returns the arity. |
java.lang.String |
getName()
Returns the name of the atom. |
int |
getPrecedence()
Returns an integer representing the precedence of this formula according to binding conventions |
java.util.List<Term> |
getTerms()
This method returns a list i.e. |
boolean |
isIn(PanSignature pSignature)
Returns true if this Atom is in the passed PanSignature's Predicate list. |
Formula |
regenerate()
Returns a copy of the Formula which can be saved as part of the copy made for the undo function. |
Formula |
s()
Creates VVar to replace PVar in the formula where necessary. |
void |
setAtoms()
Adds this atom to the list of atoms for the formula. |
void |
setVars(Var pVar)
This method adds Var v to the list of variables this Atom is bound to. |
Term |
ST()
|
Formula |
subAll(PTerm left,
PTerm right)
|
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 Atom. |
Formula |
subBoolRes(java.lang.String display)
|
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 |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Atom(java.lang.String pID)
pID
- String of the name fo the atomMethod Detail |
---|
public java.lang.String getName()
public int getArity()
public java.lang.String display()
display
in class Formula
public void setAtoms()
setAtoms
in class Formula
public boolean clashes(Atom pAtom)
pAtom
- Atom represents the Atom to be checked if this Atom clashes
with.public boolean clashes(Term pTerm)
pTerm
- Term represents the Term to be checked if this Atom clashes
with.public java.lang.String clashes(PanSignature pSignature)
clashes
in class Formula
pSignature
- PanSignature represents the PanSignature to be checked if this
Atom clashes with.public boolean equals(Atom pAtom)
pAtom
- Atom represents the Atom to be checked if this Atom is equal
with.public boolean isIn(PanSignature pSignature)
pSignature
- PanSignature represents the signature to search within.public boolean checkSub(Term pTermX, Term pTermY, Formula pFormula)
checkSub
in class Formula
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 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 void setVars(Var pVar)
setVars
in class Formula
pVar
- Var represents the Var to be added to the list of this Atom's
variables.public void addToSignature(PanSignature pSignature)
addToSignature
in class Formula
pSignature
- PanSignature represents the signature to add this Atom to.public java.util.List<Term> getTerms()
getTerms
in class Formula
public Formula s()
s
in class Formula
public Formula regenerate()
regenerate
in class Formula
public int getPrecedence()
getPrecedence
in class Formula
public Term ST()
ST
in class Formula
public Formula subAll(PTerm left, PTerm right)
subAll
in class Formula
public Formula subBoolRes(java.lang.String display)
subBoolRes
in class Formula
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |