|
|||||||||
| 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.JTerm
public class JTerm
Term wich incapsulate opaque Java Object.
| Constructor Summary | |
|---|---|
JTerm(Object o)
construct instance of JTerm from Java Object |
|
| Method Summary | |
|---|---|
boolean |
boundEquals(Term x)
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 |
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. |
int |
findSubtermIndexBoundEqualsTo(Term x)
|
boolean |
freeEquals(Term x)
Equality when all propositional variables are equal |
boolean |
freeUnify(Term t,
Substitution s)
do unification of this and t
and store in s substitution. |
int |
getArity()
get arity (i. |
BigDecimal |
getBigDecimal()
getBigDecimal |
BigInteger |
getBigInteger()
get BigInteger value |
boolean |
getBoolean()
get boolean value, if this term represent boolean, otherwise throw UnsupportedOperationException |
byte |
getByte()
get byte value |
char |
getChar()
get character value |
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 |
int |
getInt()
get integer value, if this term represent integer, otherwise throw UnsupportedOperationException |
Object |
getJavaObject()
|
long |
getLong()
get long value |
String |
getName()
get name of functional symbol. |
Object |
getNameIndex()
get index of name in instance symbol table. |
Number |
getNumber()
return Number value of underlaying number term, if one exists. |
String |
getPatternName()
return name of pattern, for which unification is applicable. |
Object |
getPatternNameIndex()
return index of pattern name. |
int |
getPrimaryType0()
get 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()
get x index. |
boolean |
isAtom()
if this is atom ? |
boolean |
isBigDecimal()
if this is BigDecimal |
boolean |
isBigInteger()
if this is BigInteger |
boolean |
isBoolean()
is term is booleam ? |
boolean |
isByte()
if this is Byte |
boolean |
isChar()
if this is Char |
boolean |
isComplexTerm()
true, if this term have subterms |
boolean |
isDouble()
is Term is double ? |
boolean |
isFloat()
if this is Float |
boolean |
isInt()
is term is Int ? |
boolean |
isJavaObject()
if this term is Java Object ? |
boolean |
isLong()
if this is long |
boolean |
isNil()
is this term is nil ? |
boolean |
isNumber()
is term is Number ? |
boolean |
isShort()
is Term is short ? |
boolean |
isString()
is Term is string ? |
boolean |
isX()
if this 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 |
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 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, getPrimaryType1, print, println, println |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JTerm(Object o)
| Method Detail |
|---|
public int getPrimaryType0()
getPrimaryType0 in class TermPrimaryTypespublic boolean isNil()
isNil in class Termpublic boolean isAtom()
isAtom in class Termpublic boolean isBoolean()
Term
isBoolean in class Termpublic boolean getBoolean()
Term
getBoolean in class Termpublic boolean isBigDecimal()
isBigDecimal in class Termpublic BigDecimal getBigDecimal()
getBigDecimal in class Termpublic boolean isBigInteger()
isBigInteger in class Termpublic BigInteger getBigInteger()
getBigInteger in class Termpublic boolean isByte()
isByte in class Termpublic byte getByte()
getByte in class Termpublic boolean isChar()
isChar in class Termpublic char getChar()
getChar in class Termpublic boolean isFloat()
isFloat in class Termpublic float getFloat()
getFloat in class Termpublic boolean isDouble()
Term
isDouble in class Termpublic double getDouble()
Term
getDouble 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()
isLong in class Termpublic long getLong()
getLong in class TermUnsupportedOperationExceptionpublic boolean isString()
Term
isString in class Termpublic String getString()
Term
getString in class Termpublic boolean isX()
isX in class Termpublic int getXIndex()
getXIndex in class Termpublic boolean isComplexTerm()
Term
isComplexTerm in class Termpublic String getName()
Term
getName in class Termpublic Object getNameIndex()
Term
getNameIndex in class Termpublic int getArity()
Term
getArity in class Termpublic final boolean isJavaObject()
Term
isJavaObject in class Termpublic final Object getJavaObject()
getJavaObject in class Termpublic Term getTerm()
Term
getTerm in class Termpublic Term getSubtermAt(int i)
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.
TermWareExceptionpublic String getPatternName()
getPatternName 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
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 x)
throws TermWareException
boundEquals in class Termx - - term to compare.
TermWareException
public Term termClone()
throws TermWareException
Term
termClone in class TermTermWareExceptionpublic 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 int findSubtermIndexBoundEqualsTo(Term x)
throws TermWareException
findSubtermIndexBoundEqualsTo in class TermTermWareException
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
Term minFv(shiftFv(t))==newMinFv
shiftFv in class TermTermWareExceptionpublic final boolean emptyFv()
Term
emptyFv in class Term
public final Term createSame(Term[] newBody)
throws TermWareException
Term
createSame in class TermTermWareExceptionpublic boolean isNumber()
Term
isNumber in class Termpublic Number getNumber()
getNumber in class Termpublic Object getPatternNameIndex()
Term
getPatternNameIndex in class Termpublic 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 | ||||||||