|
|||||||||
| 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.AbstractPrimitiveTerm
public abstract class AbstractPrimitiveTerm
this is abstract class for primitive term (i. e. term, which contains primitive value, like int or String)
| Constructor Summary | |
|---|---|
AbstractPrimitiveTerm()
|
|
| Method Summary | |
|---|---|
boolean |
boundEquals(Term t)
equality, when propositional variables are already bounded. |
boolean |
boundUnify(Term t,
Substitution s)
bound unification. |
Object |
clone()
|
PartialOrderingResult |
concreteOrder(Term x,
Substitution s)
compare for 'more concrete' relation. |
Term |
createSame(Term[] newBody)
create term, with same name but new body. |
boolean |
emptyFv()
true, if term does not contains free propositional variables. |
abstract boolean |
eq(Term x)
|
int |
findSubtermIndexBoundEqualsTo(Term x)
|
boolean |
freeEquals(Term t)
Equality when all propositional variables are equal |
boolean |
freeUnify(Term t,
Substitution s)
free unification |
int |
getArity()
get arity (i. |
BigDecimal |
getBigDecimal()
get BigDecimal value, if this term represent BigDecimal, otherwise throw UnsupportedOperationException |
BigInteger |
getBigInteger()
get BigDecimal value, if this term represent BigInteger, otherwise throw UnsupportedOperationException |
boolean |
getBoolean()
get boolean value, if this term represent boolean, otherwise throw UnsupportedOperationException |
byte |
getByte()
get byte value, if this term represent byte, otherwise throw UnsupportedOperationException |
char |
getChar()
get char value, if this term represent char, otherwise throw 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()
get float value, if this term represent float, otherwise throw UnsupportedOperationException. |
int |
getInt()
get integer value, if this term represent integer, otherwise throw UnsupportedOperationException |
Object |
getJavaObject()
|
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. |
Object |
getNameIndex()
get index of name in instance symbol table. |
String |
getPatternName()
return name of pattern, for which unification is applicable. |
Object |
getPatternNameIndex()
return index of pattern name. |
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. |
String |
getString()
get string value, if this term represent string, otherwise throw InvalidPrimitiveTypeException |
Term |
getSubtermAt(int i)
throws UnsupporedOperationException |
Term |
getTerm()
get term. |
int |
getXIndex()
if this variable is a propositional variable, return index of one. |
boolean |
isAtom()
is term is atom ? |
boolean |
isBigDecimal()
true, if this term is BigDecimal |
boolean |
isBigInteger()
true, if this term is BigInteger |
boolean |
isBoolean()
is term is booleam ? |
boolean |
isByte()
true, if this term is Byte |
boolean |
isChar()
is term is char ? |
boolean |
isComplexTerm()
true, if this term have subterms |
boolean |
isDouble()
is Term is double ? |
boolean |
isFloat()
is Term is float ? |
boolean |
isInt()
is term is Int ? |
boolean |
isJavaObject()
if this term is Java Object ? |
boolean |
isLong()
is Term is long ? |
boolean |
isNil()
is term is nil ? |
boolean |
isShort()
is Term is short ? |
boolean |
isString()
is Term is string ? |
boolean |
isX()
true if this term is propositional variable. |
int |
maxFv()
get maximum index of free propositional variable in term |
int |
minFv()
get minimal index of free propositional variable in term. |
abstract void |
print(PrintWriter out)
print term to out. |
void |
setSubtermAt(int i,
Term t)
set i-th subterm to t when i < arity then throw IndexOutOfBoundsException |
void |
shiftFv(int newMin)
renumerate propositional variables in such case, that minFv(shiftFv(t))==newMinFv |
Term |
subst(Substitution s)
substitution |
boolean |
substInside(Substitution s)
apply substitution s to current term. |
abstract Term |
termClone()
clone |
abstract int |
termCompare(Term x)
compare functions. |
| Methods inherited from class ua.gradsoft.termware.Term |
|---|
containsSubtermBoundEqualsTo, getAsBigDecimal, getAsBigInteger, getAsBoolean, getAsByte, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsJavaObject, getAsLong, getAsNumber, getAsShort, getAsString, getNumber, getPrimaryType0, getPrimaryType1, isNumber, print, println, println |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractPrimitiveTerm()
| Method Detail |
|---|
public boolean isNil()
Term
isNil in class Termpublic boolean isAtom()
Term
isAtom in class Termpublic boolean isBoolean()
Term
isBoolean in class Termpublic boolean getBoolean()
Term
getBoolean in class Termpublic boolean isByte()
Term
isByte in class Termpublic byte getByte()
Term
getByte in class Termpublic boolean isShort()
Term
isShort in class Termpublic short getShort()
Term
getShort in class Termpublic boolean isInt()
Term
isInt in class Termpublic int getInt()
Term
getInt in class Termpublic boolean isLong()
Term
isLong in class Termpublic long getLong()
Term
getLong in class Termpublic boolean isBigDecimal()
Term
isBigDecimal in class Termpublic BigDecimal getBigDecimal()
Term
getBigDecimal in class Termpublic boolean isBigInteger()
Term
isBigInteger in class Termpublic BigInteger getBigInteger()
Term
getBigInteger in class Termpublic boolean isFloat()
Term
isFloat in class Termpublic float getFloat()
Term
getFloat in class Termpublic boolean isDouble()
Term
isDouble in class Termpublic double getDouble()
Term
getDouble in class Termpublic boolean isString()
Term
isString in class Termpublic String getString()
Term
getString in class Termpublic boolean isChar()
Term
isChar in class Termpublic char getChar()
Term
getChar in class Termpublic final boolean isX()
Term
isX in class Termpublic Term getTerm()
Term
getTerm in class Termpublic final boolean isComplexTerm()
Term
isComplexTerm in class Termpublic final boolean isJavaObject()
Term
isJavaObject in class Termpublic final Object getJavaObject()
getJavaObject in class Termpublic abstract String getName()
Term
getName in class Termpublic Object getNameIndex()
Term
getNameIndex in class Termpublic final String getPatternName()
Term { 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
getPatternName in class Termpublic final Object getPatternNameIndex()
Term
getPatternNameIndex in class Termpublic final int getXIndex()
Term
getXIndex in class Termpublic final int getArity()
Term
getArity in class Termpublic final Term getSubtermAt(int i)
getSubtermAt in class Termi - - index of subterm, starting from 0
UnsupportedOperationExceptionTerm.getSubtermAt(int i)
public final void setSubtermAt(int i,
Term t)
Term
setSubtermAt in class Termi - - index of subterm to set.t - - subterm to set.
public final boolean freeUnify(Term t,
Substitution s)
throws TermWareException
freeUnify in class TermTermWareException
public boolean boundUnify(Term t,
Substitution s)
throws TermWareException
boundUnify in class TermTermWareExceptionpublic final Term subst(Substitution s)
subst in class Termpublic final boolean substInside(Substitution s)
Term s to current term.
substInside in class Term
public final boolean freeEquals(Term t)
throws TermWareException
Term
freeEquals in class Termt - - term to compare.
TermWareException
public final boolean boundEquals(Term t)
throws TermWareException
Term
boundEquals in class Termt - - term to compare.
TermWareException
public abstract boolean eq(Term x)
throws TermWareException
TermWareExceptionpublic abstract Term termClone()
termClone in class Termpublic final Object clone()
clone in class Objectpublic abstract int termCompare(Term x)
Term
termCompare in class Termx - - term to compare
public PartialOrderingResult concreteOrder(Term x,
Substitution s)
throws TermWareException
Term x.<(concrete)<(y) means, that for each substitution
of free variables sx exists substituion sy :
x[sx] = y[sy] . s store previously matched variables.
concreteOrder in class TermTermWareException
public final int findSubtermIndexBoundEqualsTo(Term x)
throws SubtermNotFoundException
findSubtermIndexBoundEqualsTo in class TermSubtermNotFoundExceptionpublic final Term createSame(Term[] newBody)
Term
createSame in class Termpublic abstract void print(PrintWriter out)
print in class Termout - - PrintWriter, where to print term.public final boolean emptyFv()
Term
emptyFv in class Termpublic final int minFv()
Term
minFv in class Termpublic final int maxFv()
Term
maxFv in class Termpublic final void shiftFv(int newMin)
Term minFv(shiftFv(t))==newMinFv
shiftFv in class Term
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||