Class Suffix

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

    public class Suffix
    extends java.lang.Object
    implements it.unive.lisa.analysis.nonrelational.value.BaseNonRelationalValueDomain<Suffix>, ContainsCharProvider
    The suffix string abstract domain.
    See Also:
    https://link.springer.com/chapter/10.1007/978-3-642-24559-6_34
    • 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 inherited from interface it.unive.lisa.analysis.Lattice

        BOTTOM_STRING, TOP_STRING
    • Constructor Summary

      Constructors 
      Constructor Description
      Suffix()
      Builds the top suffix abstract element.
      Suffix​(java.lang.String suffix)
      Builds a suffix abstract element.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Suffix bottom()  
      it.unive.lisa.analysis.SemanticDomain.Satisfiability containsChar​(char c)
      Simplified semantics of the string contains operator, checking a single character is part of the string.
      boolean equals​(java.lang.Object o)  
      Suffix evalBinaryExpression​(it.unive.lisa.symbolic.value.operator.binary.BinaryOperator operator, Suffix left, Suffix right, it.unive.lisa.program.cfg.ProgramPoint pp)  
      Suffix evalNonNullConstant​(it.unive.lisa.symbolic.value.Constant constant, it.unive.lisa.program.cfg.ProgramPoint pp)  
      Suffix evalTernaryExpression​(it.unive.lisa.symbolic.value.operator.ternary.TernaryOperator operator, Suffix left, Suffix middle, Suffix right, it.unive.lisa.program.cfg.ProgramPoint pp)  
      java.lang.String getSuffix()
      Yields the suffix of this abstract value.
      int hashCode()  
      it.unive.lisa.util.numeric.IntInterval indexOf​(Suffix s)
      Yields the IntInterval containing the minimum and maximum index of s in this.
      it.unive.lisa.util.numeric.IntInterval length()
      Yields the IntInterval containing the minimum and maximum length of this abstract value.
      boolean lessOrEqualAux​(Suffix other)  
      Suffix lubAux​(Suffix other)  
      it.unive.lisa.analysis.representation.DomainRepresentation representation()  
      Suffix substring​(long begin, long end)
      Yields the suffix corresponding to the substring of this suffix between two indexes.
      Suffix top()  
      • Methods inherited from class java.lang.Object

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

        glb, glbAux, lessOrEqual, lub, narrowing, narrowingAux, toString, widening, wideningAux
      • Methods inherited from interface it.unive.lisa.analysis.nonrelational.value.BaseNonRelationalValueDomain

        assume, assumeBinaryExpression, assumeTernaryExpression, assumeUnaryExpression, canProcess, eval, evalIdentifier, evalNullConstant, evalPushAny, evalSkip, evalTypeCast, evalTypeConv, evalUnaryExpression, satisfies, satisfiesAbstractValue, satisfiesBinaryExpression, satisfiesNonNullConstant, satisfiesNullConstant, satisfiesTernaryExpression, satisfiesUnaryExpression, tracksIdentifiers
      • Methods inherited from interface it.unive.lisa.analysis.Lattice

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

        variable
    • Constructor Detail

      • Suffix

        public Suffix()
        Builds the top suffix abstract element.
      • Suffix

        public Suffix​(java.lang.String suffix)
        Builds a suffix abstract element.
        Parameters:
        suffix - the suffix
    • Method Detail

      • lubAux

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

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

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

        public int hashCode()
        Specified by:
        hashCode in interface it.unive.lisa.analysis.BaseLattice<Suffix>
        Overrides:
        hashCode in class java.lang.Object
      • top

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

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

        public it.unive.lisa.analysis.representation.DomainRepresentation representation()
        Specified by:
        representation in interface it.unive.lisa.analysis.nonrelational.NonRelationalElement<Suffix,​it.unive.lisa.symbolic.value.ValueExpression,​it.unive.lisa.analysis.nonrelational.value.ValueEnvironment<Suffix>>
      • evalNonNullConstant

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

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

        public Suffix evalTernaryExpression​(it.unive.lisa.symbolic.value.operator.ternary.TernaryOperator operator,
                                            Suffix left,
                                            Suffix middle,
                                            Suffix right,
                                            it.unive.lisa.program.cfg.ProgramPoint pp)
                                     throws it.unive.lisa.analysis.SemanticException
        Specified by:
        evalTernaryExpression in interface it.unive.lisa.analysis.nonrelational.value.BaseNonRelationalValueDomain<Suffix>
        Throws:
        it.unive.lisa.analysis.SemanticException
      • getSuffix

        public java.lang.String getSuffix()
        Yields the suffix of this abstract value.
        Returns:
        the suffix of this abstract value.
      • substring

        public Suffix substring​(long begin,
                                long end)
        Yields the suffix corresponding to the substring of this suffix between two indexes.
        Parameters:
        begin - where the substring starts
        end - where the substring ends
        Returns:
        the suffix corresponding to the substring of this suffix between two indexes
      • length

        public it.unive.lisa.util.numeric.IntInterval length()
        Yields the IntInterval containing the minimum and maximum length of this abstract value.
        Returns:
        the minimum and maximum length of this abstract value
      • indexOf

        public it.unive.lisa.util.numeric.IntInterval indexOf​(Suffix s)
        Yields the IntInterval containing the minimum and maximum index of s in this.
        Parameters:
        s - the string to be searched
        Returns:
        the minimum and maximum index of s in this
      • containsChar

        public it.unive.lisa.analysis.SemanticDomain.Satisfiability containsChar​(char c)
        Description copied from interface: ContainsCharProvider
        Simplified semantics of the string contains operator, checking a single character is part of the string.
        Specified by:
        containsChar in interface ContainsCharProvider
        Parameters:
        c - the character to check
        Returns:
        whether or not the character is part of the string