Class 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.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface it.unive.lisa.analysis.nonrelational.value.BaseNonRelationalValueDomain

        it.unive.lisa.analysis.nonrelational.value.BaseNonRelationalValueDomain.EvaluationVisitor<T extends it.unive.lisa.analysis.nonrelational.value.BaseNonRelationalValueDomain<T>>
    • 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.
      • Fields inherited from interface it.unive.lisa.analysis.Lattice

        BOTTOM_STRING, TOP_STRING
    • 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()
      Yields true if this Trend instance represent a decreasing variation, that is, if the current value is less than the previous one.
      boolean isInc()
      Yields true if this Trend instance represent an increasing variation, that is, if the current value is greater than the previous one.
      boolean isNonDec()
      Yields true 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()
      Yields true 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()
      Yields true 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 a Satisfiability instance.
      boolean isStable()
      Yields true 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
      • Methods inherited from interface it.unive.lisa.analysis.Lattice

        isBottom, isTop
      • Methods inherited from interface it.unive.lisa.analysis.nonrelational.NonRelationalElement

        fixedVariable, unknownVariable
    • 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.
    • Constructor Detail

      • Trend

        public Trend()
        Builds the top trend.
    • Method Detail

      • isStable

        public boolean isStable()
        Yields true 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()
        Yields true 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()
        Yields true 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()
        Yields true 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()
        Yields true 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()
        Yields true 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 a Satisfiability 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 having t1 trend in the former and t2 trend in the latter would have t1.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 interface it.unive.lisa.analysis.BaseLattice<Trend>
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Specified by:
        equals in interface it.unive.lisa.analysis.BaseLattice<Trend>
        Overrides:
        equals in class java.lang.Object
      • lessOrEqualAux

        public boolean lessOrEqualAux​(Trend other)
                               throws it.unive.lisa.analysis.SemanticException
        Specified by:
        lessOrEqualAux in interface it.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 interface it.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 interface it.unive.lisa.analysis.BaseLattice<Trend>
        Throws:
        it.unive.lisa.analysis.SemanticException
      • top

        public Trend top()
        Specified by:
        top in interface it.unive.lisa.analysis.Lattice<Trend>
      • bottom

        public Trend bottom()
        Specified by:
        bottom in interface it.unive.lisa.analysis.Lattice<Trend>
      • representation

        public it.unive.lisa.util.representation.StructuredRepresentation representation()
        Specified by:
        representation in interface it.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 interface it.unive.lisa.analysis.nonrelational.value.BaseNonRelationalValueDomain<Trend>
        Specified by:
        canProcess in interface it.unive.lisa.analysis.SemanticEvaluator
      • toString

        public java.lang.String toString()
        Specified by:
        toString in interface it.unive.lisa.analysis.BaseLattice<Trend>
        Overrides:
        toString in class java.lang.Object