|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--com.svincent.moksa.WamObject
|
+--com.svincent.moksa.PrologTerm
|
+--com.svincent.moksa.CompoundTerm
A compoundTerm is a Prolog tree constant (normally of the form
f(x1, x2, ..., xn),
where f is known as the compoundTerm's functor,
and x1 through xn
are known as the term's subterms.
The value n is known as the compoundTerm's
arity.
| Inner Class Summary | |
static class |
CompoundTerm.ListWrapper
A wrapper for a CompoundTerm as a list. |
static class |
CompoundTerm.PrologIterator
|
| Field Summary | |
static CompoundTerm[] |
EmptyArray
|
| Fields inherited from class com.svincent.moksa.PrologTerm |
EmptyArray |
| Constructor Summary | |
CompoundTerm(PrologEngine _engine,
java.lang.String _name,
PrologTerm[] _subterms,
int _priority)
Builds a new CompoundTerm with the given name. |
|
| Method Summary | |
java.lang.Object |
accept(PrologTermVisitor v,
java.lang.Object parm)
Allow PrologTermVisitor to access this PrologTerm. |
CompoundTerm.ListWrapper |
asList()
|
PrologTerm |
clonePrologTerm(java.util.Map objs)
|
PrologTerm |
evaluateExpression()
Evaluates this term as an expression. |
int |
getArity()
Retrives this CompoundTerm's arity. |
WamInteger |
getArityConstant()
Retrives this CompoundTerm's arity, as a constant. |
java.lang.String |
getName()
Retrieves this CompoundTerm's name. |
PrologTerm |
getNameConstant()
|
int |
getPriority()
|
PrologTerm |
getSubterm(int idx)
Retrieves this CompoundTerm's value. |
PrologTerm |
getSubtermDeref(int idx)
|
boolean |
isAtom()
Returns true iff this is an Atom. |
boolean |
isCompoundTerm()
Returns true iff this is a CompoundTerm. |
boolean |
isConstant()
Returns true iff this is a constant: i.e. |
boolean |
isEmptyList()
|
boolean |
isInfix()
|
boolean |
isList()
Returns true iff this is a List. |
boolean |
isNonEmptyList()
|
boolean |
isPostfix()
|
boolean |
isPrefix()
|
boolean |
isStructure()
Return true iff this is a CompoundTerm or an Atom |
protected void |
tag(java.io.PrintWriter out)
Writes a short human-readable representation of this object to the given Writer. |
boolean |
unify(PrologTerm _that,
boolean doBindings)
Unification algorithm. |
| Methods inherited from class com.svincent.moksa.PrologTerm |
clonePrologTerm,
deref,
floatValue,
intValue,
isFloat,
isInteger,
isJavaObject,
isStreamId,
isVariable,
printVariables,
setPriority,
unify,
unifyWithoutBindings,
untrail |
| Methods inherited from class com.svincent.moksa.WamObject |
tag |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
public static final CompoundTerm[] EmptyArray
| Constructor Detail |
public CompoundTerm(PrologEngine _engine,
java.lang.String _name,
PrologTerm[] _subterms,
int _priority)
| Method Detail |
public int getPriority()
public java.lang.String getName()
public PrologTerm getNameConstant()
public int getArity()
public WamInteger getArityConstant()
public boolean isStructure()
public boolean isCompoundTerm()
public boolean isAtom()
public boolean isConstant()
public PrologTerm getSubterm(int idx)
idx - - the index of the subterm to retrieve: must be in the
range 0 through getArity () - 1,
inclusively.public PrologTerm getSubtermDeref(int idx)
public java.lang.Object accept(PrologTermVisitor v,
java.lang.Object parm)
public boolean unify(PrologTerm _that,
boolean doBindings)
public PrologTerm clonePrologTerm(java.util.Map objs)
public PrologTerm evaluateExpression()
throws PrologException
public boolean isInfix()
public boolean isPrefix()
public boolean isPostfix()
public boolean isList()
public boolean isEmptyList()
public boolean isNonEmptyList()
protected void tag(java.io.PrintWriter out)
public CompoundTerm.ListWrapper asList()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
This is documentation for Moksa Prolog, which can be found at http://www.svincent.com/moksa/
Copyright © 1999 Shawn P. Vincent.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.