Class Sign

  • All Implemented Interfaces:
    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.NonRelationalValueDomain<Sign>, it.unive.lisa.analysis.SemanticEvaluator

    public class Sign
    extends 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 class it.unive.lisa.analysis.nonrelational.value.BaseNonRelationalValueDomain

        it.unive.lisa.analysis.nonrelational.value.BaseNonRelationalValueDomain.EvaluationVisitor
    • 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 pp)  
      Sign bottom()  
      it.unive.lisa.analysis.SemanticDomain.Satisfiability eq​(Sign other)
      Tests if this instance is equal to the given one, returning a SemanticDomain.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)  
      Sign evalNonNullConstant​(it.unive.lisa.symbolic.value.Constant constant, it.unive.lisa.program.cfg.ProgramPoint pp)  
      Sign evalNullConstant​(it.unive.lisa.program.cfg.ProgramPoint pp)  
      Sign evalUnaryExpression​(it.unive.lisa.symbolic.value.operator.unary.UnaryOperator operator, Sign arg, it.unive.lisa.program.cfg.ProgramPoint pp)  
      it.unive.lisa.analysis.SemanticDomain.Satisfiability gt​(Sign other)
      Tests if this instance is greater than the given one, returning a SemanticDomain.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.analysis.representation.DomainRepresentation representation()  
      it.unive.lisa.analysis.SemanticDomain.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.SemanticDomain.Satisfiability satisfiesTernaryExpression​(it.unive.lisa.symbolic.value.operator.ternary.TernaryOperator operator, Sign left, Sign middle, Sign right, it.unive.lisa.program.cfg.ProgramPoint pp)  
      Sign top()  
      • Methods inherited from class it.unive.lisa.analysis.nonrelational.value.BaseNonRelationalValueDomain

        assume, assumeTernaryExpression, assumeUnaryExpression, canProcess, eval, evalIdentifier, evalPushAny, evalTernaryExpression, evalTypeCast, evalTypeConv, glb, glbAux, satisfies, satisfiesAbstractValue, satisfiesNonNullConstant, satisfiesNullConstant, satisfiesUnaryExpression, toString, tracksIdentifiers
      • Methods inherited from class it.unive.lisa.analysis.BaseLattice

        lessOrEqual, lub, widening, wideningAux
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface it.unive.lisa.analysis.Lattice

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

        variable
    • 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()
      • bottom

        public Sign bottom()
      • representation

        public it.unive.lisa.analysis.representation.DomainRepresentation representation()
      • evalNullConstant

        public Sign evalNullConstant​(it.unive.lisa.program.cfg.ProgramPoint pp)
        Overrides:
        evalNullConstant in class 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)
        Overrides:
        evalNonNullConstant in class 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)
        Overrides:
        evalUnaryExpression in class 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)
        Overrides:
        evalBinaryExpression in class it.unive.lisa.analysis.nonrelational.value.BaseNonRelationalValueDomain<Sign>
      • lubAux

        public Sign lubAux​(Sign other)
                    throws it.unive.lisa.analysis.SemanticException
        Specified by:
        lubAux in class 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 class it.unive.lisa.analysis.BaseLattice<Sign>
        Throws:
        it.unive.lisa.analysis.SemanticException
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in class it.unive.lisa.analysis.BaseLattice<Sign>
      • equals

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

        public it.unive.lisa.analysis.SemanticDomain.Satisfiability satisfiesBinaryExpression​(it.unive.lisa.symbolic.value.operator.binary.BinaryOperator operator,
                                                                                              Sign left,
                                                                                              Sign right,
                                                                                              it.unive.lisa.program.cfg.ProgramPoint pp)
        Overrides:
        satisfiesBinaryExpression in class it.unive.lisa.analysis.nonrelational.value.BaseNonRelationalValueDomain<Sign>
      • eq

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

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

        public it.unive.lisa.analysis.SemanticDomain.Satisfiability satisfiesTernaryExpression​(it.unive.lisa.symbolic.value.operator.ternary.TernaryOperator operator,
                                                                                               Sign left,
                                                                                               Sign middle,
                                                                                               Sign right,
                                                                                               it.unive.lisa.program.cfg.ProgramPoint pp)
        Overrides:
        satisfiesTernaryExpression in class 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 pp)
                                                                                                 throws it.unive.lisa.analysis.SemanticException
        Overrides:
        assumeBinaryExpression in class it.unive.lisa.analysis.nonrelational.value.BaseNonRelationalValueDomain<Sign>
        Throws:
        it.unive.lisa.analysis.SemanticException