|
|||||||||
| 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.XTerm
public final class XTerm
Term, which represent propositional variable. when propositional variable is free, isX is true and minFv - number of this variable. when we bind propositional variable with some value - it's act as proxy. (during unifications, we do 'unproxying' to avoid memory leaks)
| 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 |
PartialOrderingResult |
concreteOrder(Term x,
Substitution s)
return result of 'concreteOrder' comparison with x. |
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 x)
|
boolean |
freeEquals(Term t)
Equality when all propositional variables are equal |
boolean |
freeUnify(Term t,
Substitution s)
return unification of this and t
and store in s substitution. |
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. |
String |
getName()
get name of functional symbol. |
Object |
getNameIndex()
get index of name in instance symbol table. |
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. |
int |
getPrimaryType0()
return code of level-0 primary type |
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)
get subterm of current term. |
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 |
isNumber()
is term is Number ? |
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. |
void |
print(PrintWriter out)
print term on out |
void |
setSubtermAt(int i,
Term t)
set i-th subterm to t when i < arity then throw IndexOutOfBoundsException |
void |
shiftFv(int newMinFv)
renumerate propositional variables in such case, that minFv(shiftFv(t))==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. |
Term |
termClone()
deep clone of term. |
int |
termCompare(Term t)
compare functions. |
| Methods inherited from class ua.gradsoft.termware.Term |
|---|
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 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public final int getPrimaryType0()
Term
getPrimaryType0 in class TermPrimaryTypespublic final boolean isNil()
Term
isNil in class Termpublic final boolean isAtom()
Term
isAtom in class Termpublic final boolean isBoolean()
Term
isBoolean in class Termpublic final boolean getBoolean()
Term
getBoolean in class Termpublic final boolean isNumber()
Term
isNumber in class Termpublic final Number getNumber()
Term
getNumber in class Termpublic final boolean isByte()
Term
isByte in class Termpublic final byte getByte()
Term
getByte in class Termpublic final boolean isBigDecimal()
Term
isBigDecimal in class Termpublic final BigDecimal getBigDecimal()
Term
getBigDecimal in class Termpublic final boolean isBigInteger()
Term
isBigInteger in class Termpublic final BigInteger getBigInteger()
Term
getBigInteger in class Termpublic final boolean isShort()
Term
isShort in class Termpublic final short getShort()
Term
getShort in class Termpublic final boolean isInt()
Term
isInt in class Termpublic final int getInt()
Term
getInt in class Termpublic final boolean isLong()
Term
isLong in class Termpublic final long getLong()
Term
getLong in class Termpublic final boolean isDouble()
Term
isDouble in class Termpublic final double getDouble()
Term
getDouble in class Termpublic final boolean isFloat()
Term
isFloat in class Termpublic final float getFloat()
Term
getFloat in class Termpublic final boolean isString()
Term
isString in class Termpublic final String getString()
Term
getString in class Termpublic final boolean isChar()
Term
isChar in class Termpublic final char getChar()
Term
getChar in class Termpublic final boolean isX()
Term
isX 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 final Term getTerm()
Term
getTerm in class Termpublic final String getName()
Term
getName in class Termpublic final 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 int getArity()
Term
getArity in class Termpublic Term getSubtermAt(int i)
Term
getSubtermAt in class Termi - - index of subterm, starting from 0
public void setSubtermAt(int i,
Term t)
throws TermWareException
Term
setSubtermAt in class Termi - - index of subterm to set.t - - subterm to set.
TermWareException
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
s
boundUnify in class TermTermWareException
public boolean substInside(Substitution s)
throws TermWareException
substInside in class TermTermWareException
public Term subst(Substitution s)
throws TermWareException
Term s
subst in class TermTermWareException
public boolean freeEquals(Term t)
throws TermWareException
Term
freeEquals in class Termt - - term to compare.
TermWareException
public boolean boundEquals(Term t)
throws TermWareException
Term
boundEquals in class Termt - - term to compare.
TermWareException
public int findSubtermIndexBoundEqualsTo(Term x)
throws TermWareException
findSubtermIndexBoundEqualsTo in class TermTermWareExceptionpublic final int termCompare(Term t)
Term
termCompare in class Termt - - term to compare
public Term termClone()
throws TermWareException
Term
termClone in class TermTermWareException
public final Term createSame(Term[] newBody)
throws TermWareException
Term
createSame in class TermTermWareExceptionpublic final boolean emptyFv()
Term
emptyFv in class Term
public PartialOrderingResult concreteOrder(Term x,
Substitution s)
throws TermWareException
concreteOrder in class TermTermWareException
public final int minFv()
throws TermWareException
Term
minFv in class TermTermWareException
public final int maxFv()
throws TermWareException
Term
maxFv in class TermTermWareException
public final void shiftFv(int newMinFv)
throws TermWareException
Term minFv(shiftFv(t))==newMinFv
shiftFv in class TermTermWareExceptionpublic final int getXIndex()
Term
getXIndex in class Termpublic final void print(PrintWriter out)
Term out
print in class Termout - - PrintWriter, where to print term.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||