Class InferredValue.InferredPair<T extends InferredValue<T>>
- java.lang.Object
-
- it.unive.lisa.analysis.BaseLattice<InferredValue.InferredPair<T>>
-
- it.unive.lisa.analysis.nonrelational.inference.InferredValue.InferredPair<T>
-
- Type Parameters:
T- the type ofInferredValue
- All Implemented Interfaces:
Lattice<InferredValue.InferredPair<T>>
- Enclosing interface:
- InferredValue<T extends InferredValue<T>>
public static class InferredValue.InferredPair<T extends InferredValue<T>> extends BaseLattice<InferredValue.InferredPair<T>>
A pair of instances ofInferredValue, representing the result of an evaluation in the form of<inferred value, new execution state>.
-
-
Field Summary
-
Fields inherited from interface it.unive.lisa.analysis.Lattice
BOTTOM_REPR, BOTTOM_STRING, TOP_REPR, TOP_STRING
-
-
Constructor Summary
Constructors Constructor Description InferredPair(T domain, T inferred, T state)Builds the pair.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InferredValue.InferredPair<T>bottom()Yields the bottom element of this lattice.booleanequals(java.lang.Object obj)TgetInferred()Yields the instance ofInferredValuerepresenting the inferred value.TgetState()Yields the instance ofInferredValuerepresenting the execution state.inthashCode()booleanisBottom()Yieldstrueif and only if this object represents the bottom of the lattice.booleanisTop()Yieldstrueif and only if this object represents the top of the lattice.protected booleanlessOrEqualAux(InferredValue.InferredPair<T> other)Yieldstrueif and only if this lattice element is in relation with (usually represented through ≤) the given one, assuming that base cases have already been handled.protected InferredValue.InferredPair<T>lubAux(InferredValue.InferredPair<T> other)Performs the least upper bound operation between this lattice element and the given one, assuming that base cases have already been handled.DomainRepresentationrepresentation()Yields aDomainRepresentationof the information contained in this pair.InferredValue.InferredPair<T>top()Yields the top element of this lattice.java.lang.StringtoString()protected InferredValue.InferredPair<T>wideningAux(InferredValue.InferredPair<T> other)Performs the widening operation between this lattice element and the given one, assuming that base cases have already been handled.-
Methods inherited from class it.unive.lisa.analysis.BaseLattice
lessOrEqual, lub, widening
-
-
-
-
Method Detail
-
getInferred
public T getInferred()
Yields the instance ofInferredValuerepresenting the inferred value.- Returns:
- the inferred value
-
getState
public T getState()
Yields the instance ofInferredValuerepresenting the execution state.- Returns:
- the execution state
-
top
public InferredValue.InferredPair<T> top()
Description copied from interface:LatticeYields the top element of this lattice. The returned element should be unique across different calls to this method, sinceLattice.isTop()uses reference equality by default. If the value returned by this method is not a singleton, overrideLattice.isTop()accordingly to provide a coherent test.- Returns:
- the top element
-
isTop
public boolean isTop()
Description copied from interface:LatticeYieldstrueif and only if this object represents the top of the lattice. The default implementation of this method uses reference equality betweenthisand the value returned byLattice.top(), thus assuming that the top element is a singleton. If this is not the case, override this method accordingly to provide a coherent test.- Returns:
trueif this is the top of the lattice
-
bottom
public InferredValue.InferredPair<T> bottom()
Description copied from interface:LatticeYields the bottom element of this lattice. The returned element should be unique across different calls to this method, sinceLattice.isBottom()uses reference equality by default. If the value returned by this method is not a singleton, overrideLattice.isBottom()accordingly to provide a coherent test.- Returns:
- the bottom element
-
isBottom
public boolean isBottom()
Description copied from interface:LatticeYieldstrueif and only if this object represents the bottom of the lattice. The default implementation of this method uses reference equality betweenthisand the value returned byLattice.bottom(), thus assuming that the bottom element is a singleton. If this is not the case, override this method accordingly to provide a coherent test.- Returns:
trueif this is the bottom of the lattice
-
lubAux
protected InferredValue.InferredPair<T> lubAux(InferredValue.InferredPair<T> other) throws SemanticException
Description copied from class:BaseLatticePerforms the least upper bound operation between this lattice element and the given one, assuming that base cases have already been handled. In particular, it is guaranteed that:otheris notnullotheris neither top nor bottomthisis neither top nor bottomthisandotherare not the same object (according both to==and toObject.equals(Object))
- Specified by:
lubAuxin classBaseLattice<InferredValue.InferredPair<T extends InferredValue<T>>>- Parameters:
other- the other lattice element- Returns:
- the least upper bound between this and other
- Throws:
SemanticException- if an error occurs during the computation
-
wideningAux
protected InferredValue.InferredPair<T> wideningAux(InferredValue.InferredPair<T> other) throws SemanticException
Description copied from class:BaseLatticePerforms the widening operation between this lattice element and the given one, assuming that base cases have already been handled. In particular, it is guaranteed that:otheris notnullotheris neither top nor bottomthisis neither top nor bottomthisandotherare not the same object (according both to==and toObject.equals(Object))
- Specified by:
wideningAuxin classBaseLattice<InferredValue.InferredPair<T extends InferredValue<T>>>- Parameters:
other- the other lattice element- Returns:
- the widening between this and other
- Throws:
SemanticException- if an error occurs during the computation
-
lessOrEqualAux
protected boolean lessOrEqualAux(InferredValue.InferredPair<T> other) throws SemanticException
Description copied from class:BaseLatticeYieldstrueif and only if this lattice element is in relation with (usually represented through ≤) the given one, assuming that base cases have already been handled. In particular, it is guaranteed that:otheris notnullotheris neither top nor bottomthisis neither top nor bottomthisandotherare not the same object (according both to==and toObject.equals(Object))
- Specified by:
lessOrEqualAuxin classBaseLattice<InferredValue.InferredPair<T extends InferredValue<T>>>- Parameters:
other- the other lattice element- Returns:
trueif and only if that condition holds- Throws:
SemanticException- if an error occurs during the computation
-
hashCode
public int hashCode()
- Specified by:
hashCodein classBaseLattice<InferredValue.InferredPair<T extends InferredValue<T>>>
-
equals
public boolean equals(java.lang.Object obj)
- Specified by:
equalsin classBaseLattice<InferredValue.InferredPair<T extends InferredValue<T>>>
-
toString
public java.lang.String toString()
- Specified by:
toStringin classBaseLattice<InferredValue.InferredPair<T extends InferredValue<T>>>
-
representation
public DomainRepresentation representation()
Yields aDomainRepresentationof the information contained in this pair.- Returns:
- the representation
-
-