Class Prefix

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

    public class Prefix
    extends java.lang.Object
    implements it.unive.lisa.analysis.nonrelational.value.BaseNonRelationalValueDomain<Prefix>, ContainsCharProvider
    The prefix 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
      Prefix()
      Builds the top prefix abstract element.
      Prefix​(java.lang.String prefix)
      Builds a prefix abstract element.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Prefix 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 o)  
      Prefix evalBinaryExpression​(it.unive.lisa.symbolic.value.operator.binary.BinaryOperator operator, Prefix left, Prefix right, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle)  
      Prefix evalNonNullConstant​(it.unive.lisa.symbolic.value.Constant constant, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle)  
      Prefix evalTernaryExpression​(it.unive.lisa.symbolic.value.operator.ternary.TernaryOperator operator, Prefix left, Prefix middle, Prefix right, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle)  
      java.lang.String getPrefix()
      Yields the prefix of this abstract value.
      int hashCode()  
      it.unive.lisa.util.numeric.IntInterval indexOf​(Prefix 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​(Prefix other)  
      Prefix lubAux​(Prefix other)  
      it.unive.lisa.util.representation.StructuredRepresentation representation()  
      Prefix substring​(long begin, long end)
      Yields the prefix corresponding to the substring of this prefix between two indexes.
      Prefix 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, evalPushInv, evalSkip, 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
    • Constructor Detail

      • Prefix

        public Prefix()
        Builds the top prefix abstract element.
      • Prefix

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

      • lubAux

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

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

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

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

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

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

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

        public Prefix 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<Prefix>
      • evalBinaryExpression

        public Prefix evalBinaryExpression​(it.unive.lisa.symbolic.value.operator.binary.BinaryOperator operator,
                                           Prefix left,
                                           Prefix 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<Prefix>
      • evalTernaryExpression

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

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

        public Prefix substring​(long begin,
                                long end)
        Yields the prefix corresponding to the substring of this prefix between two indexes.
        Parameters:
        begin - where the substring starts
        end - where the substring ends
        Returns:
        the prefix corresponding to the substring of this prefix 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​(Prefix 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)
        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