public abstract class Term extends Object implements Serializable
Struct
,
Var
,
Number
,
Serialized FormConstructor and Description |
---|
Term() |
Modifier and Type | Method and Description |
---|---|
abstract Term |
copy(AbstractMap vMap,
AbstractMap substMap)
gets a copy for result.
|
abstract Term |
copy(AbstractMap vMap,
int idExecCtx)
gets a copy (with renamed variables) of the term.
|
Term |
copyGoal(AbstractMap vars,
int idExecCtx)
gets a engine's copy of this term.
|
Term |
copyResult(Collection goalVars,
List 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,
alice.tuprolog.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 isEQU method.
|
abstract void |
free()
Unlink variables inside the term
|
static Iterator |
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.
|
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(Prolog mediator,
Term t)
Tests if this term is (logically) equal to another
|
abstract boolean |
isGreater(Prolog mediator,
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(Prolog mediator,
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,
alice.tuprolog.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.
|
abstract long |
resolveTerm(long count)
Resolves variables inside the term, starting from a specific time count.
|
abstract boolean |
unify(Prolog mediator,
List varsUnifiedArg1,
List varsUnifiedArg2,
Term t)
Tries to unify two terms, given a demonstration context
identified by the mark integer.
|
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(Prolog mediator, Term t)
mediator
- TODOpublic abstract boolean isEqual(Prolog mediator, Term t)
mediator
- TODOpublic abstract Term getTerm()
public abstract void free()
public abstract long resolveTerm(long count)
count
- new starting time count for resolving processpublic void resolveTerm()
public Term copyGoal(AbstractMap vars, int idExecCtx)
idExecCtx
- Execution Context identifiedpublic Term copyResult(Collection goalVars, List resultVars)
public abstract Term copy(AbstractMap vMap, int idExecCtx)
idExecCtx
- Execution Context identifierpublic abstract Term copy(AbstractMap vMap, AbstractMap substMap)
public boolean unify(Prolog mediator, Term t1)
mediator
- have the reference of EngineManagert1
- the term to unifypublic boolean match(Prolog mediator, Term t)
mediator
- TODOt
- the term to checkedpublic abstract boolean unify(Prolog mediator, List varsUnifiedArg1, List varsUnifiedArg2, Term t)
mediator
- TODOvarsUnifiedArg1
- Vars unified in myselfvarsUnifiedArg2
- Vars unified in term tpublic static Term createTerm(String st) throws InvalidTermException
st
- the string representation of the termInvalidTermException
- if the string does not represent a valid termpublic static Term parse(String st) throws InvalidTermException
createTerm(String)
instead.InvalidTermException
public static Term createTerm(String st, alice.tuprolog.OperatorManager op) throws InvalidTermException
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, alice.tuprolog.OperatorManager op) throws InvalidTermException
createTerm(String, OperatorManager)
instead.InvalidTermException
public static Iterator getIterator(String text)
public Term iteratedGoalTerm()
Copyright © 2015. All rights reserved.