public abstract class Term extends Object implements Serializable
Struct
,
Var
,
Number
,
Serialized FormConstructor and Description |
---|
Term() |
Modifier and Type | Method and Description |
---|---|
abstract void |
accept(TermVisitor tv)
Visitor pattern
|
Term |
copyGoal(AbstractMap<Var,Var> vars,
int idExecCtx)
gets a engine's copy of this term.
|
Term |
copyResult(Collection<Var> goalVars,
List<Var> resultVars)
gets a copy of this term for the output
|
static Term |
createTerm(String st)
Static service to create a Term from a string.
|
static Term |
createTerm(String st,
OperatorManager op)
Static service to create a Term from a string, providing an
external operator manager.
|
boolean |
equals(Object t)
Tests for the equality of two object terms
The comparison follows the same semantic of
the isEqual method.
|
abstract void |
free()
Unlink variables inside the term
|
static Iterator<Term> |
getIterator(String text)
Gets an iterator providing
a term stream from a source text
|
abstract Term |
getTerm()
Gets the actual term referred by this Term. if the Term is a bound variable, the method gets the Term linked to the variable
|
abstract boolean |
isAtom()
is this term a prolog (alphanumeric) atom?
|
abstract boolean |
isAtomic()
is this term a constant prolog term?
|
abstract boolean |
isCompound()
is this term a prolog compound term?
|
abstract boolean |
isEmptyList()
is this term a null term?
|
abstract boolean |
isEqual(Term t)
Tests if this term is (logically) equal to another
|
abstract boolean |
isGreater(Term t)
is term greater than term t?
|
abstract boolean |
isGround()
is this term a ground term?
|
abstract boolean |
isList()
is this term a prolog list?
|
abstract boolean |
isNumber()
Deprecated.
Use instanceof Number instead.
|
abstract boolean |
isStruct()
Deprecated.
Use instanceof Struct instead.
|
abstract boolean |
isVar()
Deprecated.
Use instanceof Var instead.
|
Term |
iteratedGoalTerm()
The iterated-goal term G of a term T is a term defined
recursively as follows:
if T unifies with ^(_, Goal) then G is the iterated-goal
term of Goal
else G is T
|
boolean |
match(Term t)
Tests if this term is unifiable with an other term.
|
static Term |
parse(String st)
Deprecated.
Use
createTerm(String) instead. |
static Term |
parse(String st,
OperatorManager op)
Deprecated.
Use
createTerm(String, OperatorManager) instead. |
void |
resolveTerm()
Resolves variables inside the term
If the variables has been already resolved, no renaming is done.
|
boolean |
unify(Prolog mediator,
Term t1)
Try to unify two terms
|
public abstract boolean isNumber()
public abstract boolean isStruct()
public abstract boolean isVar()
public abstract boolean isEmptyList()
public abstract boolean isAtomic()
public abstract boolean isCompound()
public abstract boolean isAtom()
public abstract boolean isList()
public abstract boolean isGround()
public boolean equals(Object t)
public abstract boolean isGreater(Term t)
public abstract boolean isEqual(Term t)
public abstract Term getTerm()
public abstract void free()
public void resolveTerm()
public Term copyGoal(AbstractMap<Var,Var> vars, int idExecCtx)
idExecCtx
- Execution Context identifiedpublic Term copyResult(Collection<Var> goalVars, List<Var> resultVars)
public boolean unify(Prolog mediator, Term t1)
mediator
- have the reference of EngineManagert1
- the term to unifypublic boolean match(Term t)
t
- the term to checkedpublic static Term createTerm(String st)
st
- the string representation of the termInvalidTermException
- if the string does not represent a valid termpublic static Term parse(String st)
createTerm(String)
instead.public static Term createTerm(String st, OperatorManager op)
st
- the string representation of the termop
- the operator manager used to build the termInvalidTermException
- if the string does not represent a valid termpublic static Term parse(String st, OperatorManager op)
createTerm(String, OperatorManager)
instead.public static Iterator<Term> getIterator(String text)
public Term iteratedGoalTerm()
public abstract void accept(TermVisitor tv)
tv
- - Visitor