Package it.unive.lisa.analysis.stability
Class Trend
- java.lang.Object
-
- it.unive.lisa.analysis.stability.Trend
-
- All Implemented Interfaces:
it.unive.lisa.analysis.BaseLattice<Trend>
,it.unive.lisa.analysis.Lattice<Trend>
,it.unive.lisa.analysis.nonrelational.NonRelationalDomain<Trend,it.unive.lisa.symbolic.value.ValueExpression,it.unive.lisa.analysis.nonrelational.value.ValueEnvironment<Trend>>
,it.unive.lisa.analysis.nonrelational.NonRelationalElement<Trend,it.unive.lisa.symbolic.value.ValueExpression,it.unive.lisa.analysis.nonrelational.value.ValueEnvironment<Trend>>
,it.unive.lisa.analysis.nonrelational.value.BaseNonRelationalValueDomain<Trend>
,it.unive.lisa.analysis.nonrelational.value.NonRelationalValueDomain<Trend>
,it.unive.lisa.analysis.SemanticEvaluator
,it.unive.lisa.util.representation.StructuredObject
public class Trend extends java.lang.Object implements it.unive.lisa.analysis.nonrelational.value.BaseNonRelationalValueDomain<Trend>
A single-variable numerical trend. Instances of this class (corresponding to its public static fields) abstract the trend of the value of a variable after the execution of an instruction w.r.t. its value before the execution.
-
-
Field Summary
Fields Modifier and Type Field Description static Trend
BOTTOM
The abstract bottom element.static Trend
DEC
The abstract decreasing element.static Trend
INC
The abstract increasing element.static Trend
NON_DEC
The abstract non-decreasing element.static Trend
NON_INC
The abstract non-increasing element.static Trend
NON_STABLE
The abstract not stable element.static Trend
STABLE
The abstract stable element.static Trend
TOP
The abstract top element.
-
Constructor Summary
Constructors Constructor Description Trend()
Builds the top trend.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Trend
bottom()
boolean
canProcess(it.unive.lisa.symbolic.SymbolicExpression expression, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle)
Trend
combine(Trend other)
Yields the combination of this trend with the given one.boolean
equals(java.lang.Object obj)
Trend
glbAux(Trend other)
int
hashCode()
Trend
invert()
Inverts the current trend.boolean
isDec()
Yieldstrue
if this Trend instance represent a decreasing variation, that is, if the current value is less than the previous one.boolean
isInc()
Yieldstrue
if this Trend instance represent an increasing variation, that is, if the current value is greater than the previous one.boolean
isNonDec()
Yieldstrue
if this Trend instance represent a non-decreasing variation, that is, if the current value is greater or equal than the previous one.boolean
isNonInc()
Yieldstrue
if this Trend instance represent a non-increasing variation, that is, if the current value is less or equal than the previous one.boolean
isNonStable()
Yieldstrue
if this Trend instance represent an unstable variation, that is, if the current value is different from the previous one.it.unive.lisa.analysis.lattices.Satisfiability
isPossiblyGrowing()
Returns the direction of the trend as aSatisfiability
instance.boolean
isStable()
Yieldstrue
if this Trend instance represent a stable variation, that is, if the current value is the same as the previous one.boolean
lessOrEqualAux(Trend other)
Trend
lubAux(Trend other)
it.unive.lisa.util.representation.StructuredRepresentation
representation()
Trend
top()
java.lang.String
toString()
-
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, wideningAux
-
Methods inherited from interface it.unive.lisa.analysis.nonrelational.value.BaseNonRelationalValueDomain
assume, assumeBinaryExpression, assumeTernaryExpression, assumeUnaryExpression, eval, evalBinaryExpression, evalIdentifier, evalNonNullConstant, evalNullConstant, evalPushAny, evalPushInv, evalSkip, evalTernaryExpression, evalTypeCast, evalTypeConv, evalUnaryExpression, evalValueExpression, satisfies, satisfiesAbstractValue, satisfiesBinaryExpression, satisfiesNonNullConstant, satisfiesNullConstant, satisfiesTernaryExpression, satisfiesUnaryExpression
-
-
-
-
Field Detail
-
TOP
public static final Trend TOP
The abstract top element.
-
BOTTOM
public static final Trend BOTTOM
The abstract bottom element.
-
STABLE
public static final Trend STABLE
The abstract stable element.
-
INC
public static final Trend INC
The abstract increasing element.
-
DEC
public static final Trend DEC
The abstract decreasing element.
-
NON_DEC
public static final Trend NON_DEC
The abstract non-decreasing element.
-
NON_INC
public static final Trend NON_INC
The abstract non-increasing element.
-
NON_STABLE
public static final Trend NON_STABLE
The abstract not stable element.
-
-
Method Detail
-
isStable
public boolean isStable()
Yieldstrue
if this Trend instance represent a stable variation, that is, if the current value is the same as the previous one.- Returns:
true
if this is the stable trend
-
isInc
public boolean isInc()
Yieldstrue
if this Trend instance represent an increasing variation, that is, if the current value is greater than the previous one.- Returns:
true
if this is the increasing trend
-
isDec
public boolean isDec()
Yieldstrue
if this Trend instance represent a decreasing variation, that is, if the current value is less than the previous one.- Returns:
true
if this is the decreasing trend
-
isNonDec
public boolean isNonDec()
Yieldstrue
if this Trend instance represent a non-decreasing variation, that is, if the current value is greater or equal than the previous one.- Returns:
true
if this is the non-decreasing trend
-
isNonInc
public boolean isNonInc()
Yieldstrue
if this Trend instance represent a non-increasing variation, that is, if the current value is less or equal than the previous one.- Returns:
true
if this is the non-increasing trend
-
isNonStable
public boolean isNonStable()
Yieldstrue
if this Trend instance represent an unstable variation, that is, if the current value is different from the previous one.- Returns:
true
if this is the unstable trend
-
isPossiblyGrowing
public it.unive.lisa.analysis.lattices.Satisfiability isPossiblyGrowing()
Returns the direction of the trend as aSatisfiability
instance. Specifically:Satisfiability.SATISFIED
means that this trend is non-decreasing or increasing;Satisfiability.NOT_SATISFIED
means that this trend is non-increasing or decreasing;Satisfiability.UNKNOWN
means that this trend is stable or unstable.
- Returns:
- whether this trend is possibly growing.
-
combine
public Trend combine(Trend other) throws it.unive.lisa.analysis.SemanticException
Yields the combination of this trend with 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.- Parameters:
other
- the other trend- Returns:
- the combination of the two trends
- Throws:
it.unive.lisa.analysis.SemanticException
- if something goes wrong during the computation
-
invert
public Trend invert()
Inverts the current trend. This operation is the identity on top, bottom, stable and unstable trends. Otherwise, it inverts the direction of the trend.- Returns:
- the inverted trend
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfaceit.unive.lisa.analysis.BaseLattice<Trend>
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Specified by:
equals
in interfaceit.unive.lisa.analysis.BaseLattice<Trend>
- Overrides:
equals
in classjava.lang.Object
-
lessOrEqualAux
public boolean lessOrEqualAux(Trend other) throws it.unive.lisa.analysis.SemanticException
- Specified by:
lessOrEqualAux
in interfaceit.unive.lisa.analysis.BaseLattice<Trend>
- Throws:
it.unive.lisa.analysis.SemanticException
-
lubAux
public Trend lubAux(Trend other) throws it.unive.lisa.analysis.SemanticException
- Specified by:
lubAux
in interfaceit.unive.lisa.analysis.BaseLattice<Trend>
- Throws:
it.unive.lisa.analysis.SemanticException
-
glbAux
public Trend glbAux(Trend other) throws it.unive.lisa.analysis.SemanticException
- Specified by:
glbAux
in interfaceit.unive.lisa.analysis.BaseLattice<Trend>
- Throws:
it.unive.lisa.analysis.SemanticException
-
bottom
public Trend bottom()
- Specified by:
bottom
in interfaceit.unive.lisa.analysis.Lattice<Trend>
-
representation
public it.unive.lisa.util.representation.StructuredRepresentation representation()
- Specified by:
representation
in interfaceit.unive.lisa.util.representation.StructuredObject
-
canProcess
public boolean canProcess(it.unive.lisa.symbolic.SymbolicExpression expression, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle)
- Specified by:
canProcess
in interfaceit.unive.lisa.analysis.nonrelational.value.BaseNonRelationalValueDomain<Trend>
- Specified by:
canProcess
in interfaceit.unive.lisa.analysis.SemanticEvaluator
-
toString
public java.lang.String toString()
- Specified by:
toString
in interfaceit.unive.lisa.analysis.BaseLattice<Trend>
- Overrides:
toString
in classjava.lang.Object
-
-