|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.agentfactory.logic.lang.FOS
public class FOS
This class represents First Order Structures (FOS)
| Constructor Summary | |
|---|---|
FOS()
creates a new empty FOS |
|
FOS(java.lang.String inString)
A nasty but necessarly constructor TODO - RR - Solve bug which allows for FOSs to be created badly out of invalid strings. |
|
| Method Summary | |
|---|---|
void |
addArgument(FOS f)
adds FOS to arguments |
FOS |
apply(SubstitutionSet sub)
applies a SubstitutionSet to this |
FOS |
argAt(int i)
gets argument at specified position |
void |
atArgPut(int i,
FOS f)
puts specified argument at specified position |
java.lang.Object |
clone()
Clone the current object |
FOS |
copy()
get copy of this |
boolean |
equals(java.lang.Object object)
|
java.util.ArrayList |
getArguments()
gets arguments |
java.util.ArrayList |
getConstants()
|
java.lang.String |
getFunctor()
get functor name |
java.util.ArrayList |
getVariables()
|
boolean |
isCompatibleFunction(FOS f)
formulae are compatible if they have the same functor and same number of arguments |
boolean |
isComposite()
checks to see if this is Composite (has arguments) |
boolean |
isDifferentTo(FOS f)
checks to see if specified formula is composite while this is a constant or vice versa |
boolean |
isDistinctConstant(FOS f)
checks to see if specified formula is distinct to this |
boolean |
isDistinctFunction(FOS f)
checks to see if specified formula has a distinct function to this |
boolean |
isFalse()
checks to see if this is a false ("false") |
boolean |
isNot()
|
boolean |
isNotFunctional(FOS f)
formulae are not functional if one is a variable contained by the other |
boolean |
isRule()
checks to see if this is a rule |
boolean |
isSameAs(FOS f)
compares this with another FOS to see if they are exactly the same |
boolean |
isTrue()
checks to see if this is a true ("true") |
boolean |
isVariable()
checks to see if this is a variable (starts with a '?') |
boolean |
matches(FOS f)
Sees if another FOS matches this. |
int |
numArguments()
gets the number of arguments |
protected FOS |
privateReplaceConstants()
Need this function below for recursion - the first time the replaceConstants() method is invoked, we do not want to make any modifications to the actual FOS - the top level must always remain the same. |
void |
putArguments(java.util.ArrayList arg)
replace arguments with other arguments |
void |
putArguments(java.util.Vector arg)
replace arguments with other arguments |
void |
putFunctor(java.lang.String s)
set functor name |
FOS |
realCopy()
Make a real copy of the FOS |
FOS |
replaceConstants()
|
void |
replaceVariableWith(FOS f,
FOS f1)
replaces formula f with formula f1 in this |
java.lang.String |
toString()
gets a String representation of this |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public FOS()
public FOS(java.lang.String inString)
| Method Detail |
|---|
public boolean isNot()
public java.util.ArrayList getArguments()
public int numArguments()
public void addArgument(FOS f)
f - FOS to be addedpublic void putArguments(java.util.ArrayList arg)
arg - different arguments for FOSpublic void putArguments(java.util.Vector arg)
arg - different arguments for FOSpublic FOS argAt(int i)
i - position of argument
public void atArgPut(int i,
FOS f)
i - position of argumentf - different argumentpublic java.lang.String getFunctor()
public void putFunctor(java.lang.String s)
s - name of functorpublic FOS copy()
public boolean isRule()
public boolean isComposite()
public boolean isVariable()
public boolean isFalse()
public boolean isTrue()
public boolean isSameAs(FOS f)
f - the formula to be compared
public boolean matches(FOS f)
f - formula to be matched
public boolean isDistinctConstant(FOS f)
f - formula to check
public boolean isDistinctFunction(FOS f)
f - formula to check
public boolean isDifferentTo(FOS f)
f - formula to check
public boolean isCompatibleFunction(FOS f)
f - formula to check
public boolean isNotFunctional(FOS f)
f - formula to check
public void replaceVariableWith(FOS f,
FOS f1)
f - a formula within thisf1 - replacement formulapublic FOS apply(SubstitutionSet sub)
sub - the SubstitutionSet to be used
public java.lang.String toString()
toString in class java.lang.Objectpublic FOS realCopy()
public java.lang.Object clone()
clone in class java.lang.Objectpublic boolean equals(java.lang.Object object)
equals in class java.lang.Objectpublic java.util.ArrayList getVariables()
public java.util.ArrayList getConstants()
public FOS replaceConstants()
protected FOS privateReplaceConstants()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||