Class ValueEnvironment<T extends NonRelationalValueDomain<T>>
- java.lang.Object
-
- it.unive.lisa.analysis.lattices.FunctionalLattice<M,Identifier,T>
-
- it.unive.lisa.analysis.nonrelational.VariableLift<M,E,T>
-
- it.unive.lisa.analysis.nonrelational.Environment<ValueEnvironment<T>,ValueExpression,T>
-
- it.unive.lisa.analysis.nonrelational.value.ValueEnvironment<T>
-
- Type Parameters:
T
- the concrete instance of theNonRelationalValueDomain
whose instances are mapped in this environment
- All Implemented Interfaces:
BaseLattice<ValueEnvironment<T>>
,Lattice<ValueEnvironment<T>>
,ScopedObject<ValueEnvironment<T>>
,SemanticDomain<ValueEnvironment<T>,ValueExpression,Identifier>
,ValueDomain<ValueEnvironment<T>>
,ValueOracle
,StructuredObject
,java.lang.Iterable<java.util.Map.Entry<Identifier,T>>
public class ValueEnvironment<T extends NonRelationalValueDomain<T>> extends Environment<ValueEnvironment<T>,ValueExpression,T> implements ValueDomain<ValueEnvironment<T>>
An environment for aNonRelationalValueDomain
, that mapsIdentifier
s to instances of such domain. This is aFunctionalLattice
, that is, it implements a function mapping keys (identifiers) to values (instances of the domain), and lattice operations are automatically lifted for individual elements of the environment if they are mapped to the same key.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class it.unive.lisa.analysis.lattices.FunctionalLattice
FunctionalLattice.FunctionalLift<V extends Lattice<V>>, FunctionalLattice.KeyFunctionalLift<K>
-
-
Field Summary
-
Fields inherited from class it.unive.lisa.analysis.lattices.FunctionalLattice
function, lattice
-
Fields inherited from interface it.unive.lisa.analysis.Lattice
BOTTOM_STRING, TOP_STRING
-
-
Constructor Summary
Constructors Constructor Description ValueEnvironment(T domain)
Builds an empty environment.ValueEnvironment(T domain, java.util.Map<Identifier,T> function)
Builds an environment containing the given mapping.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ValueEnvironment<T>
bottom()
Yields the bottom element of this lattice.ValueEnvironment<T>
mk(T lattice, java.util.Map<Identifier,T> function)
Builds a instance of this class from the given lattice instance and the given mapping.ValueEnvironment<T>
top()
Yields the top element of this lattice.-
Methods inherited from class it.unive.lisa.analysis.nonrelational.Environment
assign, assume, eval, smallStepSemantics
-
Methods inherited from class it.unive.lisa.analysis.nonrelational.VariableLift
forgetIdentifier, forgetIdentifiersIf, knowsIdentifier, lubKeys, popScope, pushScope, satisfies, stateOfUnknown
-
Methods inherited from class it.unive.lisa.analysis.lattices.FunctionalLattice
equals, functionalLift, getKeys, getMap, getOtDefault, getState, getValues, glbAux, glbKeys, hashCode, isBottom, isTop, iterator, lessOrEqualAux, lubAux, mkNewFunction, narrowingAux, putState, representation, toString, wideningAux
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface it.unive.lisa.analysis.BaseLattice
glb, lessOrEqual, lub, narrowing, widening
-
Methods inherited from interface it.unive.lisa.analysis.ScopedObject
popScope, pushScope
-
Methods inherited from interface it.unive.lisa.analysis.SemanticDomain
assign, assume, forgetIdentifier, forgetIdentifiers, forgetIdentifiersIf, getAllDomainInstances, getDomainInstance, knowsIdentifier, satisfies, smallStepSemantics
-
Methods inherited from interface it.unive.lisa.util.representation.StructuredObject
representation
-
Methods inherited from interface it.unive.lisa.analysis.value.ValueDomain
applyReplacement
-
-
-
-
Constructor Detail
-
ValueEnvironment
public ValueEnvironment(T domain)
Builds an empty environment.- Parameters:
domain
- a singleton instance to be used during semantic operations to retrieve top and bottom values
-
ValueEnvironment
public ValueEnvironment(T domain, java.util.Map<Identifier,T> function)
Builds an environment containing the given mapping. If function isnull
, the new environment is the top environment iflattice.isTop()
holds, and it is the bottom environment iflattice.isBottom()
holds.- Parameters:
domain
- a singleton instance to be used during semantic operations to retrieve top and bottom valuesfunction
- the function representing the mapping contained in the new environment; can benull
-
-
Method Detail
-
mk
public ValueEnvironment<T> mk(T lattice, java.util.Map<Identifier,T> function)
Description copied from class:FunctionalLattice
Builds a instance of this class from the given lattice instance and the given mapping.- Specified by:
mk
in classFunctionalLattice<ValueEnvironment<T extends NonRelationalValueDomain<T>>,Identifier,T extends NonRelationalValueDomain<T>>
- Parameters:
lattice
- an instance of lattice to be used during semantic operations to retrieve top and bottom valuesfunction
- the function representing the mapping contained in the new environment; can benull
- Returns:
- a new instance of this class
-
top
public ValueEnvironment<T> top()
Description copied from interface:Lattice
Yields 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.- Specified by:
top
in interfaceLattice<T extends NonRelationalValueDomain<T>>
- Returns:
- the top element
-
bottom
public ValueEnvironment<T> bottom()
Description copied from interface:Lattice
Yields 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.- Specified by:
bottom
in interfaceLattice<T extends NonRelationalValueDomain<T>>
- Returns:
- the bottom element
-
-