|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectua.gradsoft.termware.Term
public abstract class Term
Basic class for Term - universal representation of term (elementary TermWare object).
| Constructor Summary | |
|---|---|
Term()
|
|
| Method Summary | |
|---|---|
abstract boolean |
boundEquals(Term x)
equality, when propositional variables are already bounded. |
abstract boolean |
boundUnify(Term t,
Substitution s)
unification when we already have s
and when same propositional variables means same things |
abstract PartialOrderingResult |
concreteOrder(Term x,
Substitution s)
compare for 'more concrete' relation. |
boolean |
containsSubtermBoundEqualsTo(Term x)
|
abstract Term |
createSame(Term[] newBody)
create term, with same name but new body. |
abstract boolean |
emptyFv()
true, if term does not contains free propositional variables. |
abstract int |
findSubtermIndexBoundEqualsTo(Term x)
|
abstract boolean |
freeEquals(Term x)
Equality when all propositional variables are equal |
abstract boolean |
freeUnify(Term t,
Substitution s)
do unification of this and t
and store in s substitution. |
abstract int |
getArity()
get arity (i. |
BigDecimal |
getAsBigDecimal(TermWareInstance instance)
get BigDecimal value, if this term represent some Numeric value, otherwise throw UnsupportedOperationException |
BigInteger |
getAsBigInteger(TermWareInstance instance)
get BigInteger value, if this term represent some Numeric value, otherwise throw UnsupportedOperationException |
boolean |
getAsBoolean(TermWareInstance instance)
get boolean value, if this term can be converted to boolean |
byte |
getAsByte(TermWareInstance instance)
get Byte value, if this term represent some Numeric value, otherwise throw UnsupportedOperationException |
char |
getAsChar(TermWareInstance instance)
get char value. |
double |
getAsDouble(TermWareInstance instance)
get double value, if this term represent some number, otherwise throw ConversionException |
float |
getAsFloat(TermWareInstance instance)
get float value, if this term represent some number, otherwise throw ConversionException |
int |
getAsInt(TermWareInstance instance)
get integer value, if this term represent some number, otherwise throw ConversionException |
Object |
getAsJavaObject(TermWareInstance instance)
|
long |
getAsLong(TermWareInstance instance)
get long value, if this term represent some number, otherwise throw ConversionException |
Number |
getAsNumber(TermWareInstance instance)
|
short |
getAsShort(TermWareInstance instance)
get short value, if this term represent some number, otherwise throw ConversionException |
String |
getAsString(TermWareInstance instance)
get string value, if this term represent sring, otherwise throw ConversionException |
abstract BigDecimal |
getBigDecimal()
get BigDecimal value, if this term represent BigDecimal, otherwise throw UnsupportedOperationException |
abstract BigInteger |
getBigInteger()
get BigDecimal value, if this term represent BigInteger, otherwise throw UnsupportedOperationException |
abstract boolean |
getBoolean()
get boolean value, if this term represent boolean, otherwise throw UnsupportedOperationException |
abstract byte |
getByte()
get byte value, if this term represent byte, otherwise throw UnsupportedOperationException |
abstract char |
getChar()
get char value, if this term represent char, otherwise throw UnsupportedOperationException |
abstract 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. |
abstract float |
getFloat()
get float value, if this term represent float, otherwise throw UnsupportedOperationException. |
abstract int |
getInt()
get integer value, if this term represent integer, otherwise throw UnsupportedOperationException |
abstract Object |
getJavaObject()
|
abstract long |
getLong()
get long value, if this term represent long, otherwise throw UnsupportedOperationException Note, that this method does not provide conversion of other numeric types to long. |
abstract String |
getName()
get name of functional symbol. |
abstract Object |
getNameIndex()
get index of name in instance symbol table. |
abstract Number |
getNumber()
get numeric value, if this term represent number, otherwise throw UnsupportedOperationException |
String |
getPatternName()
return name of pattern, for which unification is applicable. |
Object |
getPatternNameIndex()
return index of pattern name. |
abstract int |
getPrimaryType0()
return code of level-0 primary type |
int |
getPrimaryType1()
return code of level-1 primary type |
abstract short |
getShort()
get short value, if this term represent short, otherwise throw UnsupportedOperationException Note, that this method does not provide conversion of other numeric types to short. |
abstract String |
getString()
get string value, if this term represent string, otherwise throw InvalidPrimitiveTypeException |
abstract Term |
getSubtermAt(int i)
get subterm of current term. |
abstract Term |
getTerm()
get term. |
abstract int |
getXIndex()
if this variable is a propositional variable, return index of one. |
abstract boolean |
isAtom()
is term is atom ? |
abstract boolean |
isBigDecimal()
true, if this term is BigDecimal |
abstract boolean |
isBigInteger()
true, if this term is BigInteger |
abstract boolean |
isBoolean()
is term is booleam ? |
abstract boolean |
isByte()
true, if this term is Byte |
abstract boolean |
isChar()
is term is char ? |
abstract boolean |
isComplexTerm()
true, if this term have subterms |
abstract boolean |
isDouble()
is Term is double ? |
abstract boolean |
isFloat()
is Term is float ? |
abstract boolean |
isInt()
is term is Int ? |
abstract boolean |
isJavaObject()
if this term is Java Object ? |
abstract boolean |
isLong()
is Term is long ? |
abstract boolean |
isNil()
is term is nil ? |
abstract boolean |
isNumber()
is term is Number ? |
abstract boolean |
isShort()
is Term is short ? |
abstract boolean |
isString()
is Term is string ? |
abstract boolean |
isX()
true if this term is propositional variable. |
abstract int |
maxFv()
get maximum index of free propositional variable in term |
abstract int |
minFv()
get minimal index of free propositional variable in term. |
void |
print(PrintStream out)
print term on out |
abstract void |
print(PrintWriter out)
print term on out |
void |
println(PrintStream out)
println term on out . |
void |
println(PrintWriter out)
println term on out . |
abstract void |
setSubtermAt(int i,
Term t)
set i-th subterm to t when i < arity then throw IndexOutOfBoundsException |
abstract void |
shiftFv(int newMinFv)
renumerate propositional variables in such case, that minFv(shiftFv(t))==newMinFv |
abstract Term |
subst(Substitution s)
receive new term, which is sibstution of current term and s |
abstract boolean |
substInside(Substitution s)
apply substitution s to current term. |
abstract Term |
termClone()
deep clone of term. |
abstract int |
termCompare(Term x)
compare functions. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Term()
| Method Detail |
|---|
public abstract int getPrimaryType0()
PrimaryTypespublic final int getPrimaryType1()
public abstract boolean isNil()
public abstract boolean isAtom()
public abstract boolean isBoolean()
public abstract boolean getBoolean()
UnsupportedOperationException - raised if this term does not represent boolean value.
public boolean getAsBoolean(TermWareInstance instance)
throws ConversionException
ConversionExceptionpublic abstract boolean isChar()
public abstract char getChar()
UnsupportedOperationException - raised if this term does not represent boolean value.
public char getAsChar(TermWareInstance instance)
throws ConversionException
instance type conversion routines.
ConversionExceptionpublic abstract boolean isNumber()
public abstract Number getNumber()
UnsupportedOperationException - raised if this term does not represent numeric value.
public Number getAsNumber(TermWareInstance instance)
throws ConversionException
ConversionExceptionpublic abstract boolean isBigDecimal()
public abstract BigDecimal getBigDecimal()
throws UnsupportedOperationException
UnsupportedOperationException - raised if this term does not represent BigDecimal value.
public BigDecimal getAsBigDecimal(TermWareInstance instance)
throws ConversionException
UnsupportedOperationException - raised if this term does not represent Number value.
ConversionException - is conversion is not possible.public abstract boolean isBigInteger()
public abstract BigInteger getBigInteger()
throws UnsupportedOperationException
UnsupportedOperationException - raised if this term does not represent BigInteger value.
public BigInteger getAsBigInteger(TermWareInstance instance)
throws ConversionException
ConversionException - raised if conversion is impossible.
UnsupportedOperationException - raised if this term does not represent Number value.public abstract boolean isByte()
public abstract byte getByte()
UnsupportedOperationException - raised if this term does not represent byte value.
public byte getAsByte(TermWareInstance instance)
throws ConversionException
ConversionException - if conversion to byte is impossible.public abstract boolean isInt()
public abstract int getInt()
throws UnsupportedOperationException
InvalidPrimitiveTypeException - raised if this term does not represent integer value.
UnsupportedOperationException
public int getAsInt(TermWareInstance instance)
throws ConversionException
ConversionException - if conversion is impossible.public abstract boolean isFloat()
public abstract float getFloat()
throws UnsupportedOperationException
UnsupportedOperationException - raised if this term does not represent double value.
public float getAsFloat(TermWareInstance instance)
throws ConversionException
ConversionException - if conversion is impossible.public abstract boolean isDouble()
public abstract double getDouble()
throws UnsupportedOperationException
UnsupportedOperationException - raised if this term does not represent double value.
public double getAsDouble(TermWareInstance instance)
throws ConversionException
ConversionException - if conversion is impossible.public abstract boolean isLong()
public abstract long getLong()
throws UnsupportedOperationException
UnsupportedOperationException - raised if this term does not represent double value.
public long getAsLong(TermWareInstance instance)
throws ConversionException
ConversionException - if conversion is impossible.public abstract boolean isShort()
public abstract short getShort()
throws UnsupportedOperationException
UnsupportedOperationException - raised if this term does not represent double value.
public short getAsShort(TermWareInstance instance)
throws ConversionException
instance - instance of runtime environment.
ConversionException - if conversion is impossible.public abstract boolean isString()
public abstract String getString()
UnsupportedOperationException - raised if this term does not represent string value.
public String getAsString(TermWareInstance instance)
throws ConversionException
instance - instance of runtime environment.
ConversionException - if conversion is impossible.public abstract boolean isX()
public abstract int getXIndex()
public abstract boolean isComplexTerm()
public abstract String getName()
public abstract Object getNameIndex()
public abstract boolean isJavaObject()
public abstract Object getJavaObject()
public Object getAsJavaObject(TermWareInstance instance)
throws ConversionException
ConversionExceptionpublic abstract int getArity()
public abstract Term getTerm()
public abstract Term getSubtermAt(int i)
i - - index of subterm, starting from 0
public abstract void setSubtermAt(int i,
Term t)
throws TermWareException
i - - index of subterm to set.t - - subterm to set.
TermWareExceptionpublic String getPatternName()
{ x : y }
is a pattern for set, where x - element from set, y -
rest of set). Name of this term is set_pattern , but pattern name is
set
public Object getPatternNameIndex()
public abstract boolean freeUnify(Term t,
Substitution s)
throws TermWareException
this and t
and store in s substitution.
TermWareException
public abstract boolean boundUnify(Term t,
Substitution s)
throws TermWareException
s
and when same propositional variables means same things
TermWareException
public abstract boolean substInside(Substitution s)
throws TermWareException
s to current term.
TermWareException
public abstract Term subst(Substitution s)
throws TermWareException
s
TermWareException
public abstract boolean freeEquals(Term x)
throws TermWareException
x - - term to compare.
TermWareException
public abstract boolean boundEquals(Term x)
throws TermWareException
x - - term to compare.
TermWareException
public boolean containsSubtermBoundEqualsTo(Term x)
throws TermWareException
TermWareException
public abstract int findSubtermIndexBoundEqualsTo(Term x)
throws TermWareException
TermWareException
public abstract Term termClone()
throws TermWareException
TermWareExceptionpublic abstract int termCompare(Term x)
x - - term to compare
public abstract PartialOrderingResult concreteOrder(Term x,
Substitution s)
throws TermWareException
x.<(concrete)<(y) means, that for each substitution
of free variables sx exists substituion sy :
x[sx] = y[sy] . s store previously matched variables.
TermWareException
public abstract Term createSame(Term[] newBody)
throws TermWareException
TermWareException
public abstract int minFv()
throws TermWareException
TermWareException
public abstract int maxFv()
throws TermWareException
TermWareException
public abstract void shiftFv(int newMinFv)
throws TermWareException
minFv(shiftFv(t))==newMinFv
TermWareExceptionpublic abstract boolean emptyFv()
public void print(PrintStream out)
out
out - - PrintStream, where to print term.public abstract void print(PrintWriter out)
out
out - - PrintWriter, where to print term.public final void println(PrintStream out)
out .
(i. e. effect of t.println(out) is equals to:
t.print(out); out.println();
public final void println(PrintWriter out)
out .
(i. e. effect of t.println(out) is equals to:
t.print(out); out.println();
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||