Package it.unive.lisa.analysis.stability
Class Stability<V extends it.unive.lisa.analysis.value.ValueDomain<V>>
- java.lang.Object
-
- it.unive.lisa.analysis.stability.Stability<V>
-
- Type Parameters:
V
- the kind of auxiliary domain
- All Implemented Interfaces:
it.unive.lisa.analysis.BaseLattice<Stability<V>>
,it.unive.lisa.analysis.Lattice<Stability<V>>
,it.unive.lisa.analysis.ScopedObject<Stability<V>>
,it.unive.lisa.analysis.SemanticDomain<Stability<V>,it.unive.lisa.symbolic.value.ValueExpression,it.unive.lisa.symbolic.value.Identifier>
,it.unive.lisa.analysis.value.ValueDomain<Stability<V>>
,it.unive.lisa.analysis.value.ValueOracle
,it.unive.lisa.util.representation.StructuredObject
public class Stability<V extends it.unive.lisa.analysis.value.ValueDomain<V>> extends java.lang.Object implements it.unive.lisa.analysis.BaseLattice<Stability<V>>, it.unive.lisa.analysis.value.ValueDomain<Stability<V>>
Implementation of the stability abstract domain (yet to appear publicly). This domain computes per-variable numerical trends to infer stability, covariance and contravariance relations on program variables, exploiting an auxiliary domain of choice. This is implemented as an open product where the stability domain gathers information from the auxiliary one through boolean queries.
Implementation-wise, this class is built as a product between a givenValueDomain
aux
and aValueEnvironment
trends
ofTrend
instances, representing per-variable trends. Queries are carried over by theSemanticDomain.satisfies(SymbolicExpression, ProgramPoint, SemanticOracle)
operator invoked onaux
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stability<V>
assign(it.unive.lisa.symbolic.value.Identifier id, it.unive.lisa.symbolic.value.ValueExpression expression, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle)
Stability<V>
assume(it.unive.lisa.symbolic.value.ValueExpression expression, it.unive.lisa.program.cfg.ProgramPoint src, it.unive.lisa.program.cfg.ProgramPoint dest, it.unive.lisa.analysis.SemanticOracle oracle)
Stability<V>
bottom()
Stability<V>
combine(Stability<V> other)
Yields the combination of the trends in this stability instance with the ones contained in the given one.boolean
equals(java.lang.Object obj)
Stability<V>
forgetIdentifier(it.unive.lisa.symbolic.value.Identifier id)
Stability<V>
forgetIdentifiersIf(java.util.function.Predicate<it.unive.lisa.symbolic.value.Identifier> test)
V
getAuxiliaryDomain()
Yields the auxiliary domain contained in this domain instance.java.util.Map<Trend,java.util.Set<it.unive.lisa.symbolic.value.Identifier>>
getCovarianceClasses()
Yields a mapping fromTrend
s to theIdentifier
s having that trend.it.unive.lisa.analysis.nonrelational.value.ValueEnvironment<Trend>
getTrends()
Yields the per-variable trends contained in this domain instance.Stability<V>
glbAux(Stability<V> other)
int
hashCode()
boolean
isBottom()
boolean
isTop()
boolean
knowsIdentifier(it.unive.lisa.symbolic.value.Identifier id)
boolean
lessOrEqualAux(Stability<V> other)
Stability<V>
lubAux(Stability<V> other)
Stability<V>
popScope(it.unive.lisa.analysis.ScopeToken token)
Stability<V>
pushScope(it.unive.lisa.analysis.ScopeToken token)
it.unive.lisa.util.representation.StructuredRepresentation
representation()
it.unive.lisa.analysis.lattices.Satisfiability
satisfies(it.unive.lisa.symbolic.value.ValueExpression expression, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle)
Stability<V>
smallStepSemantics(it.unive.lisa.symbolic.value.ValueExpression expression, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle)
Stability<V>
top()
java.lang.String
toString()
Stability<V>
wideningAux(Stability<V> other)
-
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, narrowingAux, widening
-
-
-
-
Constructor Detail
-
Stability
public Stability(V aux)
Builds the top stability domain, usingaux
as auxiliary domain.- Parameters:
aux
- the auxiliary domain
-
-
Method Detail
-
lubAux
public Stability<V> lubAux(Stability<V> other) throws it.unive.lisa.analysis.SemanticException
-
glbAux
public Stability<V> glbAux(Stability<V> other) throws it.unive.lisa.analysis.SemanticException
-
wideningAux
public Stability<V> wideningAux(Stability<V> other) throws it.unive.lisa.analysis.SemanticException
-
lessOrEqualAux
public boolean lessOrEqualAux(Stability<V> other) throws it.unive.lisa.analysis.SemanticException
-
isTop
public boolean isTop()
-
isBottom
public boolean isBottom()
-
pushScope
public Stability<V> pushScope(it.unive.lisa.analysis.ScopeToken token) throws it.unive.lisa.analysis.SemanticException
-
popScope
public Stability<V> popScope(it.unive.lisa.analysis.ScopeToken token) throws it.unive.lisa.analysis.SemanticException
-
assign
public Stability<V> assign(it.unive.lisa.symbolic.value.Identifier id, it.unive.lisa.symbolic.value.ValueExpression expression, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle) throws it.unive.lisa.analysis.SemanticException
-
smallStepSemantics
public Stability<V> smallStepSemantics(it.unive.lisa.symbolic.value.ValueExpression expression, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle) throws it.unive.lisa.analysis.SemanticException
-
assume
public Stability<V> assume(it.unive.lisa.symbolic.value.ValueExpression expression, it.unive.lisa.program.cfg.ProgramPoint src, it.unive.lisa.program.cfg.ProgramPoint dest, it.unive.lisa.analysis.SemanticOracle oracle) throws it.unive.lisa.analysis.SemanticException
-
knowsIdentifier
public boolean knowsIdentifier(it.unive.lisa.symbolic.value.Identifier id)
-
forgetIdentifier
public Stability<V> forgetIdentifier(it.unive.lisa.symbolic.value.Identifier id) throws it.unive.lisa.analysis.SemanticException
-
forgetIdentifiersIf
public Stability<V> forgetIdentifiersIf(java.util.function.Predicate<it.unive.lisa.symbolic.value.Identifier> test) throws it.unive.lisa.analysis.SemanticException
-
satisfies
public it.unive.lisa.analysis.lattices.Satisfiability satisfies(it.unive.lisa.symbolic.value.ValueExpression expression, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle) throws it.unive.lisa.analysis.SemanticException
-
representation
public it.unive.lisa.util.representation.StructuredRepresentation representation()
- Specified by:
representation
in interfaceit.unive.lisa.util.representation.StructuredObject
-
equals
public boolean equals(java.lang.Object obj)
-
hashCode
public int hashCode()
-
toString
public java.lang.String toString()
-
getTrends
public it.unive.lisa.analysis.nonrelational.value.ValueEnvironment<Trend> getTrends()
Yields the per-variable trends contained in this domain instance.- Returns:
- the trends
-
getAuxiliaryDomain
public V getAuxiliaryDomain()
Yields the auxiliary domain contained in this domain instance.- Returns:
- the auxiliary domain
-
combine
public Stability<V> combine(Stability<V> other) throws it.unive.lisa.analysis.SemanticException
Yields the combination of the trends in this stability instance with the ones contained in the given one. This operation is to be interpreted as the sequential concatenation of the two: if two (blocks of) instructions are executed sequentially, a variable havingt1
trend in the former andt2
trend in the latter would havet1.combine(t2)
as an overall trend. This delegates toTrend.combine(Trend)
for single-trend combination.- Parameters:
other
- the other trends- Returns:
- the combination of the two trends
- Throws:
it.unive.lisa.analysis.SemanticException
- if something goes wrong during the computation
-
-