|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectPandora.LogicParser.Formula.Formula
public abstract class Formula
Abstract Formula class.
Extended by each of the Formula classes.
Constructor Summary | |
---|---|
Formula()
|
Method Summary | |
---|---|
abstract void |
addToSignature(PanSignature signature)
This method adds this Formula to the passed PanSignature's Predicate list IF it is not already in the signature |
Formula |
check(Term x,
Term y,
Formula f)
Returns true if the passed formula f can be reached by substituting th eoccurrences of Term x by Term y |
abstract boolean |
checkSub(Term x,
Term y,
Formula f)
Returns true if the passed formula f can be reached by substituting th eoccurrences of Term x by Term y |
abstract java.lang.String |
clashes(PanSignature signature)
Returns a String containing an Error character if this Formula clashes with the passed PanSignature, Otherwise it will return an Empty String "" |
java.util.List<Term> |
concatNoDup(java.util.List<Term> terms)
This method removes the duplicates from Formula's Term list. |
abstract java.lang.String |
display()
Returns the a String to display the Formula. |
java.util.List<Atom> |
getAtoms()
Returns the list of atoms contained in a Formula tree. |
Formula |
getLeft()
Default getLeft() method for when a Formula has no left Formula. |
abstract int |
getPrecedence()
Returns an integer representing the precedence of this formula according to binding conventions |
Formula |
getRight()
Default getRight() method for when a Formula has no right Formula. |
abstract java.util.List<Term> |
getTerms()
This method returns a list |
java.util.List<Tuple> |
getTuples()
Returns a list of all the bindings that has taken place so far. I.e. |
java.util.List<Var> |
getVars()
This method returns the list of all the variables this Formula is bound to. |
boolean |
higher(Formula f)
|
boolean |
isBracketed(java.lang.String s)
|
Term |
map(Term t,
java.util.List<Tuple> tuples)
Checks if the passed Term is equal to the first element of any of the Tuples in the passed List |
abstract Formula |
regenerate()
Returns a copy of the Formula which can be saved as part of the copy made for the undo function. |
abstract Formula |
s()
Creates SVar to replace PVar in the formula where necessary. |
abstract void |
setAtoms()
Adds the list of Atoms in a given tree to the list of Atoms. |
void |
setLeft(Formula left)
Default setLeft() method for when a Formula has no left Formula. |
void |
setRight(Formula right)
Default setRight() method for when a Formula has no right Formula. |
void |
setTuples(java.util.List<Tuple> tuples)
Replaces the binidng list of this formula with the passed binding list. |
abstract void |
setVars(Var v)
This method adds Var v to the list of variables this Formula is bound to. |
void |
showTuples()
|
Formula |
sub(Term x,
Term y,
Formula f)
Returns the Formula that can be reached by substituting the occurrences of Term x by Term y |
abstract Formula |
subAll(Term x,
Term y)
Returns the Formula that is derived after substituting ALL the occurrences of Term x with Term y |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Formula()
Method Detail |
---|
public Term map(Term t, java.util.List<Tuple> tuples)
t
- Term represents the Term to search the Listtuples
- Listpublic abstract java.lang.String display()
public java.util.List<Atom> getAtoms()
public java.util.List<Var> getVars()
public abstract void setAtoms()
public abstract void setVars(Var v)
v
- Var represents the Var to be added to the list of this Formula's variables.public Formula sub(Term x, Term y, Formula f) throws java.lang.Exception
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. If the passed formula is null it will call the subAll method to substitute all the occurrences of Term x by Term y. Otherwise it will call the checkSub method to check if formula f can be reached by substitution.
java.lang.Exception
public Formula check(Term x, Term y, Formula f) throws java.lang.Exception
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. If the frmula cannot be reached it will throw an Exception.
java.lang.Exception
public abstract boolean checkSub(Term x, Term y, Formula f)
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 abstract Formula subAll(Term x, Term y)
x
- Term represents the Term to be substituted.y
- Term represents the Term to substitute Term x.public abstract java.lang.String clashes(PanSignature signature)
signature
- PanSignature represents the PanSignature to be checked if this Atom clashes with.public abstract void addToSignature(PanSignature signature)
signature
- PanSignature represents the signature to add this Formula to.public abstract java.util.List<Term> getTerms()
public java.util.List<Term> concatNoDup(java.util.List<Term> terms)
public void showTuples()
public void setTuples(java.util.List<Tuple> tuples)
tuples
- Listpublic java.util.List<Tuple> getTuples()
public abstract Formula regenerate()
public abstract Formula s()
public void setLeft(Formula left)
public void setRight(Formula right)
public Formula getLeft()
public Formula getRight()
public abstract int getPrecedence()
public boolean higher(Formula f)
public boolean isBracketed(java.lang.String s)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |