|
Algernon Software | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jatha.dynatype.StandardLispValue
org.jatha.dynatype.StandardLispConsOrNil
org.algernon.datatype.BindingSet
This is a set of BindingLists.
| Field Summary | |
private Algernon |
f_algy
|
protected ArrayList |
f_bindings
|
LispValue |
FAILED
|
| Fields inherited from class org.jatha.dynatype.StandardLispValue |
f_lisp |
| Constructor Summary | |
BindingSet(Algernon algy)
Create a new BindingSet. |
|
BindingSet(Algernon algy,
BindingList bl)
Create a new BindingSet containing one binding list. |
|
| Method Summary | |
void |
addList(BindingList newList)
Adds a new list to the binding set. |
LispValue |
bind(LispValue var,
LispValue env,
LispValue term)
|
int |
bindingsCount()
Returns the number of bindings across all binding lists in the set. |
protected static LispValue |
bindingTerm(LispValue binding)
|
protected static LispValue |
bindingVar(LispValue binding)
|
void |
clear()
Removes all entries from the BindingSet. |
protected LispValue |
dereferenceExpression(LispValue term,
LispValue env,
LispValue patEnv)
Follows bindings to a non-variable or unbound variable. |
protected static LispValue |
dereferencePattern(LispValue pattern,
LispValue patEnv)
Follows bindings to a non-variable or unbound variable. |
BindingList |
getEntry(int index)
Return the nth BindingList in the given register, where the topmost item is entry number zero. |
BindingList |
getRandomBindingList()
Returns a random binding list from the set. |
boolean |
hasSingleBinding(LispValue var)
Returns true if the given variable has one and only one binding in this binding set. |
boolean |
isEmpty()
Returns true if this binding set contains no bindings. |
Iterator |
iterator()
Returns an iterator over the BindingSet. |
BindingSet |
merge(BindingSet otherSet)
Merges two binding sets and returns a new one. |
LispValue |
pop()
Removes the first BindingList and returns it. |
BindingSet |
push(BindingList newList)
Pushes the new BindingList onto the BindingSet. |
int |
size()
Returns the number of binding lists in this binding set. |
String |
toString()
|
LispValue |
unify(LispValue pattern,
LispValue expression)
Unifies the unbound clause with the bound clauses (data) and returns a binding list containing the bindings derived from unification. |
protected LispValue |
unifyAux(LispValue pattern,
LispValue patEnv,
LispValue expression,
LispValue expEnv)
|
BindingSet |
unmerge(LispValue countedVariable)
Takes a merged binding set and undoes the combinatorial merge, returning a binding set which represents the previous version of the input set before the merge. |
| Methods inherited from class org.jatha.dynatype.StandardLispConsOrNil |
basic_consp, basic_listp, butlast, elt, length, listp, nconc, nreverse, position, reverse |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public LispValue FAILED
protected ArrayList f_bindings
private Algernon f_algy
| Constructor Detail |
public BindingSet(Algernon algy)
public BindingSet(Algernon algy,
BindingList bl)
| Method Detail |
public String toString()
public void addList(BindingList newList)
public BindingList getEntry(int index)
public BindingSet merge(BindingSet otherSet)
public LispValue unify(LispValue pattern,
LispValue expression)
protected LispValue unifyAux(LispValue pattern,
LispValue patEnv,
LispValue expression,
LispValue expEnv)
public LispValue bind(LispValue var,
LispValue env,
LispValue term)
protected LispValue dereferenceExpression(LispValue term,
LispValue env,
LispValue patEnv)
protected static LispValue dereferencePattern(LispValue pattern,
LispValue patEnv)
protected static LispValue bindingTerm(LispValue binding)
protected static LispValue bindingVar(LispValue binding)
public BindingList getRandomBindingList()
public LispValue pop()
public boolean hasSingleBinding(LispValue var)
public BindingSet push(BindingList newList)
public int size()
public void clear()
public Iterator iterator()
public boolean isEmpty()
public int bindingsCount()
public BindingSet unmerge(LispValue countedVariable)
countedVariable -
|
Algernon Software | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||