public class SubstitutionSet extends Object
The bindings are stored as Unifiable in a Map sorted by
Variable object.
| Modifier and Type | Field and Description |
|---|---|
private Map<Variable,Unifiable> |
bindings |
| Constructor and Description |
|---|
SubstitutionSet()
Constructor of the class.
|
SubstitutionSet(SubstitutionSet s)
Constructor of the class.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(Variable v,
Unifiable expr)
Adds the specified binding to the substitution set.
|
void |
clear()
Deletes all the bindings.
|
Unifiable |
getBinding(Variable v)
Gets the binding of the specified variable.
|
boolean |
isBound(Variable v)
Checks if the specified variable has a binding.
|
String |
toString()
Returns the substitution set in the form of:
"Bindings: [variable=[expression], variable=[expression], ...]".
|
public SubstitutionSet()
public SubstitutionSet(SubstitutionSet s)
s - the SubstitutionSet object to copy.public void add(Variable v, Unifiable expr)
v - the variable that is bound by the binding.expr - the expression to which the variable is bound.public void clear()
public Unifiable getBinding(Variable v)
v - the variable of the binding to get.Unifiable object that represent the expression to which
the variable is bound.public boolean isBound(Variable v)
v - the variable to check if it is bound.public String toString()
toString in class ObjectObject.toString()