Class Sign

  • All Implemented Interfaces:
    it.unive.lisa.analysis.BaseLattice<Sign>, it.unive.lisa.analysis.Lattice<Sign>, it.unive.lisa.analysis.nonrelational.NonRelationalDomain<Sign,​it.unive.lisa.symbolic.value.ValueExpression,​it.unive.lisa.analysis.nonrelational.value.ValueEnvironment<Sign>>, it.unive.lisa.analysis.nonrelational.NonRelationalElement<Sign,​it.unive.lisa.symbolic.value.ValueExpression,​it.unive.lisa.analysis.nonrelational.value.ValueEnvironment<Sign>>, it.unive.lisa.analysis.nonrelational.value.BaseNonRelationalValueDomain<Sign>, it.unive.lisa.analysis.nonrelational.value.NonRelationalValueDomain<Sign>, it.unive.lisa.analysis.SemanticEvaluator, it.unive.lisa.util.representation.StructuredObject

    public class Sign
    extends java.lang.Object
    implements it.unive.lisa.analysis.nonrelational.value.BaseNonRelationalValueDomain<Sign>
    The basic overflow-insensitive Sign abstract domain, tracking zero, strictly positive and strictly negative integer values, implemented as a BaseNonRelationalValueDomain, handling top and bottom values for the expression evaluation and bottom values for the expression satisfiability. Top and bottom cases for least upper bounds, widening and less or equals operations are handled by BaseLattice in BaseLattice.lub(L), BaseLattice.widening(L) and BaseLattice.lessOrEqual(L) methods, respectively.
    • 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 Sign BOTTOM
      The abstract bottom element.
      static Sign NEG
      The abstract negative element.
      static Sign POS
      The abstract positive element.
      static Sign TOP
      The abstract top element.
      static Sign ZERO
      The abstract zero element.
      • Fields inherited from interface it.unive.lisa.analysis.Lattice

        BOTTOM_STRING, TOP_STRING
    • Constructor Summary

      Constructors 
      Constructor Description
      Sign()
      Builds the sign abstract domain, representing the top of the sign abstract domain.
      Sign​(byte sign)
      Builds the sign instance for the given sign value.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      it.unive.lisa.analysis.nonrelational.value.ValueEnvironment<Sign> assumeBinaryExpression​(it.unive.lisa.analysis.nonrelational.value.ValueEnvironment<Sign> environment, it.unive.lisa.symbolic.value.operator.binary.BinaryOperator operator, it.unive.lisa.symbolic.value.ValueExpression left, it.unive.lisa.symbolic.value.ValueExpression right, it.unive.lisa.program.cfg.ProgramPoint src, it.unive.lisa.program.cfg.ProgramPoint dest, it.unive.lisa.analysis.SemanticOracle oracle)  
      Sign bottom()  
      it.unive.lisa.analysis.lattices.Satisfiability eq​(Sign other)
      Tests if this instance is equal to the given one, returning a Satisfiability element.
      boolean equals​(java.lang.Object obj)  
      Sign evalBinaryExpression​(it.unive.lisa.symbolic.value.operator.binary.BinaryOperator operator, Sign left, Sign right, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle)  
      Sign evalNonNullConstant​(it.unive.lisa.symbolic.value.Constant constant, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle)  
      Sign evalNullConstant​(it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle)  
      Sign evalUnaryExpression​(it.unive.lisa.symbolic.value.operator.unary.UnaryOperator operator, Sign arg, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle)  
      it.unive.lisa.analysis.lattices.Satisfiability gt​(Sign other)
      Tests if this instance is greater than the given one, returning a Satisfiability element.
      int hashCode()  
      boolean isNegative()
      Yields whether or not this is the negative sign.
      boolean isPositive()
      Yields whether or not this is the positive sign.
      boolean isZero()
      Yields whether or not this is the zero sign.
      boolean lessOrEqualAux​(Sign other)  
      Sign lubAux​(Sign other)  
      Sign opposite()
      Yields the sign opposite to this one.
      it.unive.lisa.util.representation.StructuredRepresentation representation()  
      it.unive.lisa.analysis.lattices.Satisfiability satisfiesBinaryExpression​(it.unive.lisa.symbolic.value.operator.binary.BinaryOperator operator, Sign left, Sign right, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle)  
      it.unive.lisa.analysis.lattices.Satisfiability satisfiesTernaryExpression​(it.unive.lisa.symbolic.value.operator.ternary.TernaryOperator operator, Sign left, Sign middle, Sign right, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle)  
      Sign 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, glbAux, lessOrEqual, lub, narrowing, narrowingAux, widening, wideningAux
      • Methods inherited from interface it.unive.lisa.analysis.nonrelational.value.BaseNonRelationalValueDomain

        assume, assumeTernaryExpression, assumeUnaryExpression, canProcess, eval, evalIdentifier, evalPushAny, evalPushInv, evalSkip, evalTernaryExpression, evalTypeCast, evalTypeConv, evalValueExpression, satisfies, satisfiesAbstractValue, satisfiesNonNullConstant, satisfiesNullConstant, 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

      • POS

        public static final Sign POS
        The abstract positive element.
      • NEG

        public static final Sign NEG
        The abstract negative element.
      • ZERO

        public static final Sign ZERO
        The abstract zero element.
      • TOP

        public static final Sign TOP
        The abstract top element.
      • BOTTOM

        public static final Sign BOTTOM
        The abstract bottom element.
    • Constructor Detail

      • Sign

        public Sign()
        Builds the sign abstract domain, representing the top of the sign abstract domain.
      • Sign

        public Sign​(byte sign)
        Builds the sign instance for the given sign value.
        Parameters:
        sign - the sign (0 = top, 1 = bottom, 2 = zero, 3 = negative, 4 = positive)
    • Method Detail

      • top

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

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

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

        public it.unive.lisa.util.representation.StructuredRepresentation representation()
        Specified by:
        representation in interface it.unive.lisa.util.representation.StructuredObject
      • evalNullConstant

        public Sign evalNullConstant​(it.unive.lisa.program.cfg.ProgramPoint pp,
                                     it.unive.lisa.analysis.SemanticOracle oracle)
        Specified by:
        evalNullConstant in interface it.unive.lisa.analysis.nonrelational.value.BaseNonRelationalValueDomain<Sign>
      • evalNonNullConstant

        public Sign evalNonNullConstant​(it.unive.lisa.symbolic.value.Constant constant,
                                        it.unive.lisa.program.cfg.ProgramPoint pp,
                                        it.unive.lisa.analysis.SemanticOracle oracle)
        Specified by:
        evalNonNullConstant in interface it.unive.lisa.analysis.nonrelational.value.BaseNonRelationalValueDomain<Sign>
      • isPositive

        public boolean isPositive()
        Yields whether or not this is the positive sign.
        Returns:
        true if that condition holds
      • isZero

        public boolean isZero()
        Yields whether or not this is the zero sign.
        Returns:
        true if that condition holds
      • isNegative

        public boolean isNegative()
        Yields whether or not this is the negative sign.
        Returns:
        true if that condition holds
      • opposite

        public Sign opposite()
        Yields the sign opposite to this one. Top and bottom elements do not change.
        Returns:
        the opposite sign
      • evalUnaryExpression

        public Sign evalUnaryExpression​(it.unive.lisa.symbolic.value.operator.unary.UnaryOperator operator,
                                        Sign arg,
                                        it.unive.lisa.program.cfg.ProgramPoint pp,
                                        it.unive.lisa.analysis.SemanticOracle oracle)
        Specified by:
        evalUnaryExpression in interface it.unive.lisa.analysis.nonrelational.value.BaseNonRelationalValueDomain<Sign>
      • evalBinaryExpression

        public Sign evalBinaryExpression​(it.unive.lisa.symbolic.value.operator.binary.BinaryOperator operator,
                                         Sign left,
                                         Sign right,
                                         it.unive.lisa.program.cfg.ProgramPoint pp,
                                         it.unive.lisa.analysis.SemanticOracle oracle)
        Specified by:
        evalBinaryExpression in interface it.unive.lisa.analysis.nonrelational.value.BaseNonRelationalValueDomain<Sign>
      • lubAux

        public Sign lubAux​(Sign other)
                    throws it.unive.lisa.analysis.SemanticException
        Specified by:
        lubAux in interface it.unive.lisa.analysis.BaseLattice<Sign>
        Throws:
        it.unive.lisa.analysis.SemanticException
      • lessOrEqualAux

        public boolean lessOrEqualAux​(Sign other)
                               throws it.unive.lisa.analysis.SemanticException
        Specified by:
        lessOrEqualAux in interface it.unive.lisa.analysis.BaseLattice<Sign>
        Throws:
        it.unive.lisa.analysis.SemanticException
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface it.unive.lisa.analysis.BaseLattice<Sign>
        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<Sign>
        Overrides:
        equals in class java.lang.Object
      • satisfiesBinaryExpression

        public it.unive.lisa.analysis.lattices.Satisfiability satisfiesBinaryExpression​(it.unive.lisa.symbolic.value.operator.binary.BinaryOperator operator,
                                                                                        Sign left,
                                                                                        Sign right,
                                                                                        it.unive.lisa.program.cfg.ProgramPoint pp,
                                                                                        it.unive.lisa.analysis.SemanticOracle oracle)
        Specified by:
        satisfiesBinaryExpression in interface it.unive.lisa.analysis.nonrelational.value.BaseNonRelationalValueDomain<Sign>
      • eq

        public it.unive.lisa.analysis.lattices.Satisfiability eq​(Sign other)
        Tests if this instance is equal to the given one, returning a Satisfiability element.
        Parameters:
        other - the instance
        Returns:
        the satisfiability of this = other
      • gt

        public it.unive.lisa.analysis.lattices.Satisfiability gt​(Sign other)
        Tests if this instance is greater than the given one, returning a Satisfiability element.
        Parameters:
        other - the instance
        Returns:
        the satisfiability of this > other
      • satisfiesTernaryExpression

        public it.unive.lisa.analysis.lattices.Satisfiability satisfiesTernaryExpression​(it.unive.lisa.symbolic.value.operator.ternary.TernaryOperator operator,
                                                                                         Sign left,
                                                                                         Sign middle,
                                                                                         Sign right,
                                                                                         it.unive.lisa.program.cfg.ProgramPoint pp,
                                                                                         it.unive.lisa.analysis.SemanticOracle oracle)
        Specified by:
        satisfiesTernaryExpression in interface it.unive.lisa.analysis.nonrelational.value.BaseNonRelationalValueDomain<Sign>
      • assumeBinaryExpression

        public it.unive.lisa.analysis.nonrelational.value.ValueEnvironment<Sign> assumeBinaryExpression​(it.unive.lisa.analysis.nonrelational.value.ValueEnvironment<Sign> environment,
                                                                                                        it.unive.lisa.symbolic.value.operator.binary.BinaryOperator operator,
                                                                                                        it.unive.lisa.symbolic.value.ValueExpression left,
                                                                                                        it.unive.lisa.symbolic.value.ValueExpression right,
                                                                                                        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
        Specified by:
        assumeBinaryExpression in interface it.unive.lisa.analysis.nonrelational.value.BaseNonRelationalValueDomain<Sign>
        Throws:
        it.unive.lisa.analysis.SemanticException