Class Bricks

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

    public class Bricks
    extends java.lang.Object
    implements it.unive.lisa.analysis.nonrelational.value.BaseNonRelationalValueDomain<Bricks>, ContainsCharProvider
    The bricks 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 
      Modifier and Type Field Description
      static int kI
      The indices range of a brick used in the widening.
      static int kL
      The length of the bricks list used in the widening.
      static int kS
      The number of strings in the set of a brick used in the widening.
      • Fields inherited from interface it.unive.lisa.analysis.Lattice

        BOTTOM_STRING, TOP_STRING
    • Constructor Summary

      Constructors 
      Constructor Description
      Bricks()
      Builds the top brick abstract element.
      Bricks​(java.util.List<Brick> bricks)
      Builds a bricks abstract element.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Bricks bottom()  
      it.unive.lisa.analysis.lattices.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 object)  
      Bricks evalBinaryExpression​(it.unive.lisa.symbolic.value.operator.binary.BinaryOperator operator, Bricks left, Bricks right, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle)  
      Bricks evalNonNullConstant​(it.unive.lisa.symbolic.value.Constant constant, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle)  
      int hashCode()  
      it.unive.lisa.util.numeric.IntInterval indexOf​(Bricks 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​(Bricks other)  
      Bricks lubAux​(Bricks other)  
      void normBricks()
      The normalization method of the bricks domain.
      java.util.List<Brick> padList​(Bricks other)
      Pads the shortest brick list and adds empty brick elements to it, in order to make it the same size of the longer brick list, while maintaining the same position of equals elements between the two lists.
      it.unive.lisa.util.representation.StructuredRepresentation representation()  
      it.unive.lisa.analysis.lattices.Satisfiability satisfiesBinaryExpression​(it.unive.lisa.symbolic.value.operator.binary.BinaryOperator operator, Bricks left, Bricks right, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle)  
      Bricks substring​(long e, long b)
      The substring method of the bricks domain.
      Bricks top()  
      java.lang.String toString()  
      Bricks wideningAux​(Bricks other)  
      • 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
      • Methods inherited from interface it.unive.lisa.analysis.nonrelational.value.BaseNonRelationalValueDomain

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

      • kL

        public static int kL
        The length of the bricks list used in the widening.
      • kI

        public static int kI
        The indices range of a brick used in the widening.
      • kS

        public static int kS
        The number of strings in the set of a brick used in the widening.
    • Constructor Detail

      • Bricks

        public Bricks()
        Builds the top brick abstract element.
      • Bricks

        public Bricks​(java.util.List<Brick> bricks)
        Builds a bricks abstract element.
        Parameters:
        bricks - the list of brick
    • Method Detail

      • lubAux

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

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

        public Bricks wideningAux​(Bricks other)
                           throws it.unive.lisa.analysis.SemanticException
        Specified by:
        wideningAux in interface it.unive.lisa.analysis.BaseLattice<Bricks>
        Throws:
        it.unive.lisa.analysis.SemanticException
      • evalBinaryExpression

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

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

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

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

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

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

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

        public java.lang.String toString()
        Specified by:
        toString in interface it.unive.lisa.analysis.BaseLattice<Bricks>
        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
      • normBricks

        public void normBricks()
        The normalization method of the bricks domain. Modify bricks to its normalized form.
      • substring

        public Bricks substring​(long e,
                                long b)
        The substring method of the bricks domain.
        Parameters:
        e - The beginning index of the substring
        b - The ending index of the substring
        Returns:
        A new Bricks with all possible substrings if the conditions are met or TOP.
      • padList

        public java.util.List<Brick> padList​(Bricks other)
        Pads the shortest brick list and adds empty brick elements to it, in order to make it the same size of the longer brick list, while maintaining the same position of equals elements between the two lists.
        Parameters:
        other - the other bricks object, which has to yield the longer list
        Returns:
        the shorter list with empty brick in it
        Throws:
        java.lang.IllegalArgumentException - if the other brick list is longer or equal than the caller bricks object
      • 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​(Bricks 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.lattices.Satisfiability containsChar​(char c)
                                                                    throws it.unive.lisa.analysis.SemanticException
        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
        Throws:
        it.unive.lisa.analysis.SemanticException - if something goes wrong during the computation