|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjdrew.oo.util.Term
An object that represents a logic term (Ind, Var, Cterm, Plex, Atom). For a simple term (ind or variable) the subTerms array is set to null, for non-simple terms (atoms, complex terms, plexs) the subTerms array contains the parameters for that term.
Title: OO jDREW
Description: A deductive reasoning engine for Object-Oriented Knowledge in OO RuleML
Copyright: Copyright (c) 2005
| Field Summary | |
int |
href
|
Term |
oid
|
int |
prest
|
int |
rest
|
int |
role
|
Term[] |
subTerms
|
int |
symbol
|
int |
type
|
int |
wsymbol
|
| Constructor Summary | |
Term(int symbol,
int role,
int type)
Creates a new simple term (variable or ind). |
|
Term(int symbol,
int role,
int type,
int href)
Create a new simple term with a URI reference or label (must be ind) |
|
Term(int symbol,
int role,
int type,
Term[] subTerms)
Creates a new complex term (atom, cterm, plex). |
|
Term(int symbol,
int role,
int type,
java.util.Vector subTerms)
Creates a new complex term (atom, cterm, plex). |
|
| Method Summary | |
int |
compareTo(java.lang.Object oth)
Compares one term to another object. |
Term |
deepCopy()
Make an identical deep (recursive) copy of this term. |
Term |
deepCopy(int pside)
Produces a deep (recursive) copy of this term, with the side member set to the specified value. |
int |
getPosRest()
Gets the index of the positional rest parameter. |
int |
getRest()
Gets the index of the slotted rest paramater. |
int |
getRole()
Gets the role name code for this term. |
java.lang.String |
getRoleString()
Gets the role name for this term. |
int |
getSide()
Gets the value of the side member variable - this is used by the unification process to keep track of terms. |
Term[] |
getSubTerms()
Gets an array of the arguments for this term. |
int |
getSymbol()
Gets the symbol code for this term. |
java.lang.String |
getSymbolForRole(java.lang.String r)
A method to get the symbol for a role within a complex term. |
java.lang.String |
getSymbolString()
Gets the symbol for this term. |
int |
getType()
Gets the type code for this term. |
boolean |
isAtom()
Test if this term is an atom. |
boolean |
isCTerm()
Tests if a term is a complex term. |
void |
setAtom(boolean atom)
Sets the boolean atom flag to the passed value, if the atom member variable is set to true and it is not a complex term (subTerms array is set to null) isAtom() will still return false. |
void |
setRole(int role)
Sets the role code for this term. |
void |
setSide(int side)
Sets the value of the side member variable. |
void |
setSymbol(int symbol)
Sets the symbol code for this term. |
void |
setType(int type)
Sets the type code for this term. |
static java.util.Vector |
sort(Term[] toSort)
Sorts an array of jdrew.oo.util.Term values by the role code. |
static java.util.Vector |
sort(java.util.Vector toSort)
Sorts a Vector of term objects by the role code. |
java.lang.String |
toPOSLString()
Returns a string representation of this term in POSL syntax. |
java.lang.String |
toPOSLString(java.lang.String[] varNames)
Returns a string representation of this term in POSL syntax. |
java.lang.String |
toPOSLString(java.lang.String[] varNames,
boolean skiprole)
Returns a string representation of this term in POSL syntax, with the option of omitting the role name. |
Element |
toRuleML()
Produces an OO RuleML XML syntax representation of this term, stored in a nu.xom.Element object. |
Element |
toRuleML(java.lang.String[] varNames)
Produces an OO RuleML XML syntax representation of this term, stored in a nu.xom.Element object. |
java.lang.String |
toRuleMLString()
Produces an OO RuleML XML syntax representation of this term, stored in a string. |
java.lang.String |
toRuleMLString(java.lang.String[] varNames)
Produces an OO RuleML XML syntax representation of this term, stored in a string. |
java.lang.String |
toString()
Returns a string representation of this term. |
java.lang.String |
toString(java.lang.String[] varNames)
Returns a string representation of this term. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public int symbol
public int wsymbol
public int role
public int type
public int href
public Term[] subTerms
public Term oid
public int rest
public int prest
| Constructor Detail |
public Term(int symbol,
int role,
int type)
symbol - int The symbol code to be used for this term, for
a variable this is a negative number - and the variable name is stored
in the variableNames array of the DefiniteClause object, for a ind this
is a positive number and the symbol text is stored in the SymbolTable.role - int The role name code to be used for this term, for
a positional argument this is equal to the INOROLE member of the
SymbolTable. For slotted arguments the name of the role is stored in the
SymbolTable.type - int The type code to be used for this term, the types
for the engine are defined by an RDFS file, and are parsed by the
RDFSParser object into the Types system.
public Term(int symbol,
int role,
int type,
int href)
symbol - int The symbol code to be used for this term, for
a variable this is a negative number - and the variable name is stored
in the variableNames array of the DefiniteClause object, for a ind this
is a positive number and the symbol text is stored in the SymbolTable.role - int The role name code to be used for this term, for a
positional argument this is equal to the INOROLE member of the
SymbolTable. For a slotted parameter the role name is stored in the
SymbolTable.type - int The type code to be used for this term, the types
for the engine are defined by an RDFS file, and are parsed by the
RDFSParser object into the Types system.href - int The symbol code for the URI for this term; The actual
URI is stored in the SymbolTable.
public Term(int symbol,
int role,
int type,
Term[] subTerms)
symbol - int value The symbol code to be used for the relation or
constructor of this term, this is always a positive number and the symbol
text is stored in the SymbolTable.role - int The role name code to be used for this term, for a
positional argument this is equal to the INOROLE member of the
SymbolTable. For a slotted parameter the role name is stored in the
SymbolTable.type - int The type code to be used for this term, the types
for the engine are defined by an RDFS file, and are parsed by the
RDFSParser object into the Types system.subTerms - Term[] An array containing the terms
that will be the parameters of this atom, cterm or plex that is being
created.
public Term(int symbol,
int role,
int type,
java.util.Vector subTerms)
symbol - int value The symbol code to be used for the relation or
constructor of this term, this is always a positive number and the symbol
text is stored in the SymbolTable.role - int value The role name code to be used for this term, for a
positional argument this is equal to the INOROLE member of the
SymbolTable. For a slotted parameter the role name is stored in the
SymbolTable.type - int value The type code to be used for this term, the types
for the engine are defined by an RDFS file, and are parsed by the
RDFSParser object into the Types system.subTerms - Vector value An array containing the terms
that will be the parameters of this atom, cterm or plex that is being
created.| Method Detail |
public java.lang.String getSymbolForRole(java.lang.String r)
r - String A string containing the name of the role to
retrieve the symbol for.
public int getSymbol()
public void setSymbol(int symbol)
symbol - int value - the value to set symbol to.public java.lang.String getSymbolString()
public int getRole()
public void setRole(int role)
role - int value - the value to set role to.public java.lang.String getRoleString()
public int getType()
public void setType(int type)
type - int value - the value to set type to.public int getSide()
public void setSide(int side)
side - int value - the value to set side to.public int getRest()
public int getPosRest()
public Term[] getSubTerms()
public boolean isCTerm()
public boolean isAtom()
public void setAtom(boolean atom)
atom - boolean value - the value that the atom member should be set
to.public java.lang.String toString()
public java.lang.String toString(java.lang.String[] varNames)
public java.lang.String toPOSLString()
public java.lang.String toPOSLString(java.lang.String[] varNames)
varNames - String[] A string array containing the variable names
to use when outputting the string. These are stored in the
DefiniteClause that the term is part of.
public java.lang.String toPOSLString(java.lang.String[] varNames,
boolean skiprole)
varNames - String[] A string array containing the variable names
to use when outputting the string. These are stored in the
DefiniteClause that the term is part of.skiprole - boolean If true then the role name is omitted from the
string output - if false then the role name is included.
public java.lang.String toRuleMLString()
public java.lang.String toRuleMLString(java.lang.String[] varNames)
varNames - String[] A string array containing the variable names to
use when outputting - these are stored in the DefiniteClause object
associated with the term.
public Element toRuleML()
public Element toRuleML(java.lang.String[] varNames)
varNames - String[] The variable names associated with the term;
these are stored in the DefiniteClause object associated with the term.
public Term deepCopy()
public Term deepCopy(int pside)
pside - int The side value that should be stored in the
copy.
public static java.util.Vector sort(java.util.Vector toSort)
toSort - Vector A Vector containing only Term objects - to be
sorted by the role name code.
public static java.util.Vector sort(Term[] toSort)
toSort - Term[] An array of Term objects to be sorted by the role
name code.
public int compareTo(java.lang.Object oth)
compareTo in interface java.lang.Comparableoth - java.lang.Object value - the other object to compare this term
to.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||