Package it.unive.lisa.analysis.heap
Class HeapSemanticOperation.HeapReplacement
- java.lang.Object
-
- it.unive.lisa.analysis.heap.HeapSemanticOperation.HeapReplacement
-
- Enclosing interface:
- HeapSemanticOperation
public static final class HeapSemanticOperation.HeapReplacement extends java.lang.ObjectA replacement betweenIdentifiers caused by a change in the heap abstraction. A replacement express a relation between two sets of identifiers (returned bygetSources()andgetTargets()). The semantics of a replacement is to assign to every identifier ingetTargets()the upper bound of the value of each identifier ingetSources(), and then forget about all the sources identifiers that are not also the targets.
-
-
Constructor Summary
Constructors Constructor Description HeapReplacement()Builds the replacement.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSource(Identifier id)Adds anIdentifierto the set of identifiers that are the sources of this replacement.voidaddTarget(Identifier id)Adds anIdentifierto the set of identifiers that are the targets of this replacement.booleanequals(java.lang.Object obj)java.util.Collection<Identifier>getIdsToForget()Yields the collection of identifiers that must be removed after the application of this replacement, that is, the identifiers that are ingetSources()but not ingetTargets().java.util.Set<Identifier>getSources()Yields the set of identifiers that this replacement originates from, that is, the ones whose value will be assigned to the targets.java.util.Set<Identifier>getTargets()Yields the set of identifiers that are targeted by this replacement, that is, the ones that will be assigned.inthashCode()java.lang.StringtoString()
-
-
-
Constructor Detail
-
HeapReplacement
public HeapReplacement()
Builds the replacement. It starts with empty sets of sources and targets. New ones can be added withaddSource(Identifier)andaddTarget(Identifier).
-
-
Method Detail
-
addSource
public void addSource(Identifier id)
Adds anIdentifierto the set of identifiers that are the sources of this replacement.- Parameters:
id- the identifier to add
-
addTarget
public void addTarget(Identifier id)
Adds anIdentifierto the set of identifiers that are the targets of this replacement.- Parameters:
id- the identifier to add
-
getSources
public java.util.Set<Identifier> getSources()
Yields the set of identifiers that this replacement originates from, that is, the ones whose value will be assigned to the targets.- Returns:
- the sources of this replacement
-
getTargets
public java.util.Set<Identifier> getTargets()
Yields the set of identifiers that are targeted by this replacement, that is, the ones that will be assigned.- Returns:
- the targets of this replacement
-
getIdsToForget
public java.util.Collection<Identifier> getIdsToForget()
Yields the collection of identifiers that must be removed after the application of this replacement, that is, the identifiers that are ingetSources()but not ingetTargets().- Returns:
- the identifiers to forget after this replacement
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-