tarau.jinni
Class Var
java.lang.Object
|
+--tarau.jinni.Term
|
+--tarau.jinni.Var
- public class Var
- extends Term
Part of the Term hierarchy implmenting
logical variables. They are subject to
reset by application of and undo action keep
on the trail stack.
- See Also:
Trail,
Prog,
Clause,
Nonvar
|
Constructor Summary |
Var()
|
|
Method Summary |
(package private) boolean |
bind_to(Term x,
Trail trail)
|
(package private) boolean |
eq(Term x)
|
int |
getArity()
returns or fakes an arity for all subtypes |
java.lang.String |
getKey()
Returns a string key used based on the string name
of the term. |
protected java.lang.String |
name()
|
(package private) Term |
reaction(Term agent)
Defines the reaction to an agent recursing
over the structure of a term. |
protected Term |
ref()
Dereferences if necessary. |
java.lang.String |
toString()
|
(package private) boolean |
unbound()
|
protected void |
undo()
|
(package private) boolean |
unify_to(Term that,
Trail trail)
Unify dereferenced |
| Methods inherited from class tarau.jinni.Term |
action,
charsToString,
copy,
exec,
exec,
fromString,
isBuiltin,
isClause,
matches,
matching_copy,
numbervars,
pprint,
pprint,
stringToChars,
toChars,
toClause,
token,
toObject,
toTerm,
toUnquoted,
unify,
varsOf |
| Methods inherited from class java.lang.Object |
,
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
registerNatives,
wait,
wait,
wait |
val
protected Term val
Var
public Var()
getArity
public int getArity()
- Description copied from class: Term
- returns or fakes an arity for all subtypes
- Overrides:
- getArity in class Term
unbound
final boolean unbound()
ref
protected Term ref()
- Description copied from class: Term
- Dereferences if necessary.
This should be synchronized
otherwise vicious non-reentrancy problems
may occur in the presence of GC and heavy
multi-threading!!!
- Overrides:
- ref in class Term
bind_to
boolean bind_to(Term x,
Trail trail)
- Overrides:
- bind_to in class Term
undo
protected void undo()
- Overrides:
- undo in class Term
unify_to
boolean unify_to(Term that,
Trail trail)
- Description copied from class: Term
- Unify dereferenced
- Overrides:
- unify_to in class Term
eq
boolean eq(Term x)
- Overrides:
- eq in class Term
getKey
public java.lang.String getKey()
- Description copied from class: Term
- Returns a string key used based on the string name
of the term. Note that the key for a clause AL-B,C.
is the key insted of ':-'.
- Overrides:
- getKey in class Term
reaction
Term reaction(Term agent)
- Description copied from class: Term
- Defines the reaction to an agent recursing
over the structure of a term. This is passed
to the agent and the result of the action is returned.
Through overriding, for instance, a Fun term will provide
the recursion over its arguments, by applying the action
to each of them.
- Overrides:
- reaction in class Term
- Tags copied from class: Term
- See Also:
Fun
name
protected java.lang.String name()
toString
public java.lang.String toString()
- Overrides:
- toString in class java.lang.Object