|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectai.krr.fol.VariableRenaming
public class VariableRenaming
A VariableRenaming maps a set of Variables to a set of Variables. The resulting mapping must be one-to-one, i.e. every Variable is mapped to exactly one other Variable.
Constructor Summary | |
---|---|
VariableRenaming()
|
|
VariableRenaming(java.util.Collection<Variable> vars)
|
|
VariableRenaming(Variable... vars)
|
Method Summary | |
---|---|
boolean |
contains(Variable v)
This function tests whether this Substitution maps the given Variable to a new Term. |
Term |
getValue(Variable aVar)
This function returns the Term the given Variable is mapped to. |
java.util.Set<Variable> |
getVars()
This function returns a Set of all the Variables from the left Term that are unified in this Substitution. |
int |
size()
This function returns the number of variables bound by this Grounding. |
boolean |
unify(Term aTerm,
Variable aVar)
This function attempts to extend this Substitution such that the given Variable (from the "right" expression) and the given Term (from the "left") are unified and returns whether this succeeded. |
boolean |
unify(Variable aVar,
Term aTerm)
This function attempts to extend this Substitution such that the given Variable (from the "left" expression) and the given Term (from the "right") are unified and returns whether this succeeded. |
boolean |
unify(Variable leftVar,
Variable rightVar)
This function attempts to extend this Substitution such that the given Variables will be unified and returns true if this was possible. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public VariableRenaming()
public VariableRenaming(Variable... vars)
public VariableRenaming(java.util.Collection<Variable> vars)
Method Detail |
---|
public int size()
This function returns the number of variables bound by this Grounding.
public boolean unify(Variable aVar, Term aTerm)
This function attempts to extend this Substitution such that the given Variable (from the "left" expression) and the given Term (from the "right") are unified and returns whether this succeeded. This can only succeed if the given Term is a Variable.
unify
in interface Substitution
aVar
- the Variable the given Term is to be unified withaTerm
- the Term the given Variable will be mapped to
public boolean unify(Term aTerm, Variable aVar)
This function attempts to extend this Substitution such that the given Variable (from the "right" expression) and the given Term (from the "left") are unified and returns whether this succeeded. This can only succeed if the given Term is a Variable.
unify
in interface Substitution
aTerm
- the Term the given Variable will be mapped toaVar
- the Variable the given Term is to be unified with
public boolean unify(Variable leftVar, Variable rightVar)
This function attempts to extend this Substitution such that the given Variables will be unified and returns true if this was possible. Where this matters, the first variable is considered to come from the "left" expression and the second from the "right".
unify
in interface Substitution
leftVar
- a Variable to be associated with the other given VariablerightVar
- a Variable to be associated with the other given Variable
public boolean contains(Variable v)
This function tests whether this Substitution maps the given Variable to a new Term.
contains
in interface Substitution
v
- the Variable the Term is being sought for
public Term getValue(Variable aVar)
This function returns the Term the given Variable is mapped to. More specifically, it returns:
The given Variable is assumed to occur in the left Term.
getValue
in interface Substitution
aVar
- the Variable the Term is being sought for
public java.util.Set<Variable> getVars()
This function returns a Set of all the Variables from the left Term that are unified in this Substitution. It will not include new Variables old ones are being mapped to.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |