|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object blog.Substitution
public class Substitution
A mapping from logical variables to terms.
Field Summary | |
---|---|
protected java.util.Map<LogicalVar,Term> |
map
|
Constructor Summary | |
---|---|
Substitution()
Creates a new "empty" substitution that does not change anything. |
|
Substitution(java.util.List<LogicalVar> vars,
java.util.List<? extends Term> terms)
Creates a new substitution that maps the given list of logical variables respectively to the given list of terms. |
Method Summary | |
---|---|
void |
add(LogicalVar var,
Term replacement)
Adds the given mapping to this substitution, replacing any existing mapping for var . |
boolean |
equals(java.lang.Object o)
|
java.util.Set<LogicalVar> |
getPreimage(Term t,
boolean allowSelf)
Returns the set of logical variables that map to the given term. |
Term |
getReplacement(LogicalVar var)
Returns the replacement for the given logical variable, or the logical variable itself if no replacement has been specified. |
java.util.Set<LogicalVar> |
getVars()
|
boolean |
hasConstant()
|
int |
hashCode()
|
boolean |
isOneToOneOn(java.util.Collection<LogicalVar> vars)
Returns true if this substitution, restricted to the given variables, is one-to-one. |
boolean |
makeEqual(Term t1,
Term t2)
Adds the given mapping to this substitution, and keeps the substitution in normal form (so that the rewrites can be applied in any order). |
void |
remove(LogicalVar var)
Removes the mapping (if any) for the given logical variable. |
int |
size()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.util.Map<LogicalVar,Term> map
Constructor Detail |
---|
public Substitution()
public Substitution(java.util.List<LogicalVar> vars, java.util.List<? extends Term> terms)
java.lang.IllegalArgumentException
- if the two given lists have
different lengthsMethod Detail |
---|
public void add(LogicalVar var, Term replacement)
var
.
public void remove(LogicalVar var)
public boolean makeEqual(Term t1, Term t2)
public Term getReplacement(LogicalVar var)
public java.util.Set<LogicalVar> getPreimage(Term t, boolean allowSelf)
allowSelf
- if true, the set returned may include t
itself; otherwise t
is excludedpublic boolean isOneToOneOn(java.util.Collection<LogicalVar> vars)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public int size()
public boolean hasConstant()
public java.util.Set<LogicalVar> getVars()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |