|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--com.ifcomputer.minerva.MinervaTerm
|
+--com.ifcomputer.minerva.MinervaStruct
|
+--com.ifcomputer.minerva.MinervaCompound
The class MinervaCompound is used to represent a
Minerva compound term.
| Field Summary |
| Fields inherited from class com.ifcomputer.minerva.MinervaTerm |
ATOM, COMPOUND, DOUBLE, LIST, LONG, OBJECT, VARIABLE |
| Constructor Summary | |
MinervaCompound(java.lang.String functor,
int arity)
Constructs a Minerva compound term, where all arguments are undefined. |
|
MinervaCompound(java.lang.String functor,
com.ifcomputer.minerva.MinervaTerm a1)
Constructs a compound term with arity 1. |
|
MinervaCompound(java.lang.String functor,
com.ifcomputer.minerva.MinervaTerm[] args)
Constructs a Minerva compound term. |
|
MinervaCompound(java.lang.String functor,
com.ifcomputer.minerva.MinervaTerm a1,
com.ifcomputer.minerva.MinervaTerm a2)
Constructs a compound term with arity 2. |
|
MinervaCompound(java.lang.String functor,
com.ifcomputer.minerva.MinervaTerm a1,
com.ifcomputer.minerva.MinervaTerm a2,
com.ifcomputer.minerva.MinervaTerm a3)
Constructs a compound term with arity 3. |
|
MinervaCompound(java.lang.String functor,
com.ifcomputer.minerva.MinervaTerm a1,
com.ifcomputer.minerva.MinervaTerm a2,
com.ifcomputer.minerva.MinervaTerm a3,
com.ifcomputer.minerva.MinervaTerm a4)
Constructs a compound term with arity 4. |
|
MinervaCompound(java.lang.String functor,
com.ifcomputer.minerva.MinervaTerm a1,
com.ifcomputer.minerva.MinervaTerm a2,
com.ifcomputer.minerva.MinervaTerm a3,
com.ifcomputer.minerva.MinervaTerm a4,
com.ifcomputer.minerva.MinervaTerm a5)
Constructs a compound term with arity 5. |
|
MinervaCompound(java.lang.String functor,
com.ifcomputer.minerva.MinervaTerm a1,
com.ifcomputer.minerva.MinervaTerm a2,
com.ifcomputer.minerva.MinervaTerm a3,
com.ifcomputer.minerva.MinervaTerm a4,
com.ifcomputer.minerva.MinervaTerm a5,
com.ifcomputer.minerva.MinervaTerm a6)
Constructs a compound term with arity 6. |
|
| Method Summary | |
boolean |
equals(java.lang.Object other)
This function returns true, if 'this' and 'other' are identical terms, i.e. if both are compound terms with identical functor, arity and arguments. |
com.ifcomputer.minerva.MinervaTerm |
getArg(int i)
This function retrieves the i-th argument of a compound term. |
int |
getArity()
This function retrieves the arity of a compound term. |
java.lang.String |
getFunctor()
This function retrieves the functor of a compound term. |
int |
hashCode()
This function calculates a hashcode for a compoundterm. |
void |
reset()
This function is used to unbind all variables ( MinervaVariable) in this term. |
com.ifcomputer.minerva.MinervaTerm |
resolve()
This function is used to create a copy of this term,
where all bound variable will be replaced by the term to which
they are bound |
void |
setArg(int i,
com.ifcomputer.minerva.MinervaTerm term)
This function replaces the i-th argument of a compound term by 'term'. |
java.lang.String |
toString()
Stringifies a compound term. |
int |
typeOf()
This function returns the type ( VARIABLE,
ATOM, etc.) of this term. |
| Methods inherited from class com.ifcomputer.minerva.MinervaTerm |
getEnumeration, getListLength, getStringArray, getTermArray, isList, setValue |
| Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public MinervaCompound(java.lang.String functor,
com.ifcomputer.minerva.MinervaTerm[] args)
functor - functor of the compound termargs - arguments of the compound term (args.length is the
arity of the compound term; the arity must be greater than 0)
public MinervaCompound(java.lang.String functor,
int arity)
functor - functor of the compound termarity - arity of the compound termsetArg(int, com.ifcomputer.minerva.MinervaTerm)
public MinervaCompound(java.lang.String functor,
com.ifcomputer.minerva.MinervaTerm a1)
functor - the functor of the compound terma1 - the argument of the compound term
public MinervaCompound(java.lang.String functor,
com.ifcomputer.minerva.MinervaTerm a1,
com.ifcomputer.minerva.MinervaTerm a2)
functor - the functor of the compound terma1 - the 1st argument of the compound terma2 - the 2nd argument of the compound term
public MinervaCompound(java.lang.String functor,
com.ifcomputer.minerva.MinervaTerm a1,
com.ifcomputer.minerva.MinervaTerm a2,
com.ifcomputer.minerva.MinervaTerm a3)
functor - the functor of the compound terma1 - the 1st argument of the compound terma2 - the 2nd argument of the compound terma3 - the 3th argument of the compound term
public MinervaCompound(java.lang.String functor,
com.ifcomputer.minerva.MinervaTerm a1,
com.ifcomputer.minerva.MinervaTerm a2,
com.ifcomputer.minerva.MinervaTerm a3,
com.ifcomputer.minerva.MinervaTerm a4)
functor - the functor of the compound terma1 - the 1st argument of the compound terma2 - the 2nd argument of the compound terma3 - the 3th argument of the compound terma4 - the 4th argument of the compound term
public MinervaCompound(java.lang.String functor,
com.ifcomputer.minerva.MinervaTerm a1,
com.ifcomputer.minerva.MinervaTerm a2,
com.ifcomputer.minerva.MinervaTerm a3,
com.ifcomputer.minerva.MinervaTerm a4,
com.ifcomputer.minerva.MinervaTerm a5)
functor - the functor of the compound terma1 - the 1st argument of the compound terma2 - the 2nd argument of the compound terma3 - the 3th argument of the compound terma4 - the 4th argument of the compound terma5 - the 5th argument of the compound term
public MinervaCompound(java.lang.String functor,
com.ifcomputer.minerva.MinervaTerm a1,
com.ifcomputer.minerva.MinervaTerm a2,
com.ifcomputer.minerva.MinervaTerm a3,
com.ifcomputer.minerva.MinervaTerm a4,
com.ifcomputer.minerva.MinervaTerm a5,
com.ifcomputer.minerva.MinervaTerm a6)
functor - the functor of the compound terma1 - the 1st argument of the compound terma2 - the 2nd argument of the compound terma3 - the 3th argument of the compound terma4 - the 4th argument of the compound terma5 - the 5th argument of the compound terma6 - the 6th argument of the compound term| Method Detail |
public void reset()
MinervaTermMinervaVariable) in this term.
reset in class MinervaTermcom.ifcomputer.minerva.MinervaTermMinervaVariable.setValue(com.ifcomputer.minerva.MinervaTerm)public com.ifcomputer.minerva.MinervaTerm resolve()
MinervaTermthis term,
where all bound variable will be replaced by the term to which
they are bound
resolve in class MinervaTermcom.ifcomputer.minerva.MinervaTermMinervaVariable.setValue(com.ifcomputer.minerva.MinervaTerm),
MinervaTerm.reset()public java.lang.String getFunctor()
getFunctor in class MinervaStructpublic int getArity()
getArity in class MinervaStructpublic com.ifcomputer.minerva.MinervaTerm getArg(int i)
getArg in class MinervaStructi - argument index (0 <= index < arity)
public void setArg(int i,
com.ifcomputer.minerva.MinervaTerm term)
setArg in class MinervaStructi - argument index (0 <= index < arity)term - term by which the selected argument has to be replacedpublic boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic int typeOf()
MinervaTermVARIABLE,
ATOM, etc.) of this term.
typeOf in class MinervaTermcom.ifcomputer.minerva.MinervaTermMinervaTerm.VARIABLE,
MinervaTerm.ATOM,
MinervaTerm.LONG,
MinervaTerm.DOUBLE,
MinervaTerm.OBJECT,
MinervaTerm.COMPOUND,
MinervaTerm.LIST
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||