|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectua.gradsoft.termware.Term
ua.gradsoft.termware.AbstractComplexTerm
public abstract class AbstractComplexTerm
Abstract complex term.
This is term like f(x1,.. xN).
Contains some subclass-specific storage for subterms.
| Field Summary | |
|---|---|
protected boolean |
emptyFv_
|
| Constructor Summary | |
|---|---|
AbstractComplexTerm()
|
|
| Method Summary | |
|---|---|
boolean |
boundEquals(Term t)
equality, when propositional variables are already bounded. |
boolean |
boundUnify(Term t,
Substitution s)
unification when we already have s
and when same propositional variables means same things |
Object |
clone()
|
abstract Term |
createSame(Term[] newBody)
create term, with same name but new body. |
boolean |
emptyFv()
true, if term does not contains free propositional variables. |
int |
findSubtermIndexBoundEqualsTo(Term t)
|
boolean |
freeEquals(Term x)
Equality when all propositional variables are equal |
boolean |
freeUnify(Term t,
Substitution s)
return unification of this and t
and store in s substitution. |
abstract int |
getArity()
get arity of term. |
BigDecimal |
getBigDecimal()
in this interface throws UnsupportedOperationException |
BigInteger |
getBigInteger()
in this interface throws UnsupportedOperationException |
boolean |
getBoolean()
in this class throws UnsupportedOperationException |
byte |
getByte()
in this interface throws UnsupportedOperationException |
char |
getChar()
in this interface throws UnsupportedOperationException |
double |
getDouble()
get double value, if this term represent double, otherwise throw UnsupportedOperationException Note, that this method does not provide conversion of other numeric types to double. |
float |
getFloat()
in this interface throws UnsupportedOperationException |
int |
getInt()
in this interface throws UnsupportedOperationException |
Object |
getJavaObject()
in this class throws UnsupportedOperationException |
long |
getLong()
in this interface throws UnsupportedOperationException |
abstract String |
getName()
get name of term. |
abstract Object |
getNameIndex()
get name index in bounded symbol table or sust string, if name in symbol table does not exists. |
Number |
getNumber()
in this class throws UnsupportedOperationException |
String |
getPatternName()
get name, for which we can forse unfication. |
Object |
getPatternNameIndex()
get index for pattern name. |
int |
getPrimaryType0()
get primary type of the term. |
short |
getShort()
in this class throws UnsupportedOperationException |
String |
getString()
in this interface throws UnsupportedOperationException |
abstract Term |
getSubtermAt(int i)
get i-th subterm. |
Term |
getTerm()
return term |
int |
getXIndex()
in this class throws UnsupportedOperationException |
boolean |
isAtom()
is this term is Atom ? |
boolean |
isBigDecimal()
is this tern is BigDecimal ? |
boolean |
isBigInteger()
is this tern is BigInteger ? |
boolean |
isBoolean()
is this term is Boolean ? |
boolean |
isByte()
is this term is Byte ? |
boolean |
isChar()
is this term is Char ? |
boolean |
isComplexTerm()
is this term is ComplexTerm ? |
boolean |
isDouble()
is this tern is Double ? |
boolean |
isFloat()
is this term is Float ? |
boolean |
isInt()
is this term is Int ? |
boolean |
isJavaObject()
is this term is Java Object ? |
boolean |
isLong()
is this term is Long ? |
boolean |
isNil()
is this term is nil ? |
boolean |
isNumber()
is this term is Number ? |
boolean |
isShort()
is this term is Short ? |
boolean |
isString()
is this tern is String ? |
boolean |
isX()
is this term is X ? |
int |
maxFv()
get maximum index of free propositional variable in term |
int |
minFv()
get minimal index of free propositional variable in term. |
void |
normalizeFv(int i)
|
void |
print(PrintWriter out)
print term on out |
protected void |
recheckEmptyFv()
recheck existance of propositional variables in subterms. |
protected void |
resetFV()
|
abstract void |
setSubtermAt(int i,
Term t)
set i-th subterm. |
void |
shiftFv(int newMinFv)
shift set of propositional variables to start from newMinFv |
Term |
subst(Substitution s)
receive new term, which is sibstution of current term and s |
boolean |
substInside(Substitution s)
apply substitution s to current term. |
abstract Term |
termClone()
do 'deep-clone' of object. |
int |
termCompare(Term t)
compare function. |
| Methods inherited from class ua.gradsoft.termware.Term |
|---|
concreteOrder, containsSubtermBoundEqualsTo, getAsBigDecimal, getAsBigInteger, getAsBoolean, getAsByte, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsJavaObject, getAsLong, getAsNumber, getAsShort, getAsString, getPrimaryType1, print, println, println |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected transient boolean emptyFv_
| Constructor Detail |
|---|
public AbstractComplexTerm()
| Method Detail |
|---|
public final int getPrimaryType0()
getPrimaryType0 in class TermPrimaryTypespublic abstract String getName()
getName in class Termpublic abstract Object getNameIndex()
getNameIndex in class Termpublic String getPatternName()
getPatternName in class Termpublic Object getPatternNameIndex()
getPatternNameIndex in class Termpublic abstract int getArity()
getArity in class Termpublic abstract Term getSubtermAt(int i)
getSubtermAt in class Termi - - index of subterm to get.
i
TermIndexOutOfBoundsException - when i>getArity()
InvalidArgumentException - when i < 0
public abstract void setSubtermAt(int i,
Term t)
throws TermWareException
setSubtermAt in class Termi - - indext of subterm to set.t - - subterm to set.
TermWareException
public abstract Term createSame(Term[] newBody)
throws TermWareException
Term
createSame in class TermTermWareException
public abstract Term termClone()
throws TermWareException
termClone in class TermTermWareExceptionpublic final Object clone()
clone in class Objectpublic final boolean isNil()
isNil in class Termpublic final boolean isAtom()
isAtom in class Termpublic final boolean isBoolean()
isBoolean in class Termpublic final boolean getBoolean()
getBoolean in class Termpublic final boolean isNumber()
isNumber in class Termpublic final Number getNumber()
getNumber in class Termpublic final boolean isByte()
isByte in class Termpublic final byte getByte()
getByte in class Termpublic final boolean isShort()
isShort in class Termpublic final short getShort()
getShort in class Termpublic final boolean isInt()
isInt in class Term
public final int getInt()
throws UnsupportedOperationException
getInt in class TermUnsupportedOperationExceptionpublic final boolean isLong()
isLong in class Term
public final long getLong()
throws UnsupportedOperationException
getLong in class TermUnsupportedOperationException - raised if this term does not represent double value.public final boolean isFloat()
isFloat in class Termpublic final float getFloat()
getFloat in class Termpublic final boolean isDouble()
isDouble in class Termpublic final double getDouble()
Term
getDouble in class Termhere throws UnsupportedOperationExceptionpublic final boolean isBigDecimal()
isBigDecimal in class Termpublic final BigDecimal getBigDecimal()
getBigDecimal in class Termpublic final boolean isBigInteger()
isBigInteger in class Term
public final BigInteger getBigInteger()
throws UnsupportedOperationException
getBigInteger in class TermUnsupportedOperationException - raised if this term does not represent BigInteger value.public final boolean isChar()
isChar in class Termpublic final char getChar()
getChar in class Termpublic final boolean isString()
isString in class Termpublic final String getString()
getString in class Termpublic final boolean isJavaObject()
isJavaObject in class Termpublic final Object getJavaObject()
getJavaObject in class Termpublic final boolean isX()
isX in class Termpublic final int getXIndex()
getXIndex in class Termpublic final boolean isComplexTerm()
isComplexTerm in class Termpublic Term getTerm()
getTerm in class Term
public boolean freeUnify(Term t,
Substitution s)
throws TermWareException
this and t
and store in s substitution.
freeUnify in class TermTermWareException
public boolean boundUnify(Term t,
Substitution s)
throws TermWareException
Term s
and when same propositional variables means same things
boundUnify in class TermTermWareException
public boolean substInside(Substitution s)
throws TermWareException
s to current term.
substInside in class TermTermWareException
public Term subst(Substitution s)
throws TermWareException
s
subst in class TermTermWareException
public boolean freeEquals(Term x)
throws TermWareException
freeEquals in class Termx - - term to compare.
TermWareException
public boolean boundEquals(Term t)
throws TermWareException
Term
boundEquals in class Termt - - term to compare.
TermWareException
public int findSubtermIndexBoundEqualsTo(Term t)
throws TermWareException
findSubtermIndexBoundEqualsTo in class TermTermWareExceptionpublic int termCompare(Term t)
termCompare in class Termt - - term to comparepublic boolean emptyFv()
Term
emptyFv in class Term
public int minFv()
throws TermWareException
Term
minFv in class TermTermWareException
public int maxFv()
throws TermWareException
Term
maxFv in class TermTermWareException
public void shiftFv(int newMinFv)
throws TermWareException
newMinFv
shiftFv in class TermnewMinFv - new minimal index of propositional variable in term
TermWareException
public void normalizeFv(int i)
throws TermWareException
TermWareExceptionpublic void print(PrintWriter out)
Term out
print in class Termout - - PrintWriter, where to print term.protected void recheckEmptyFv()
protected final void resetFV()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||