Class Identifier

    • Constructor Detail

      • Identifier

        protected Identifier​(Type staticType,
                             java.lang.String name,
                             boolean weak,
                             Annotations annotations,
                             CodeLocation location)
        Builds the identifier.
        Parameters:
        staticType - the static type of this expression
        name - the name of the identifier
        weak - whether or not this identifier is weak, meaning that it should only receive weak assignments
        annotations - the annotations of this identifier
        location - the code location of the statement that has generated this identifier
    • Method Detail

      • getName

        public java.lang.String getName()
        Yields the name of this identifier.
        Returns:
        the name
      • isWeak

        public boolean isWeak()
        Yields whether or not this identifier is weak. Weak identifiers should only receive weak assignments, that is, the value of the identifier after the assignment should be the least upper bound between its old value and the fresh value being assigned. With strong identifiers instead, the new value corresponds to the freshly provided value.
        Returns:
        true if this identifier is weak, false otherwise
      • isScopedByCall

        public boolean isScopedByCall()
        Yields true if this is an OutOfScopeIdentifier whose (i) scope was introduced by a call, or (ii) inner identifier is an OutOfScopeIdentifier such that inner.isScopedByCall() holds.
        Returns:
        true if that condition holds
      • getAnnotations

        public Annotations getAnnotations()
        Yields the annotations of this identifier.
        Returns:
        the annotations of this identifier
      • addAnnotation

        public void addAnnotation​(Annotation ann)
        Adds an annotation to the annotations of this identifier.
        Parameters:
        ann - the annotation to be added
      • lub

        public Identifier lub​(Identifier other)
                       throws SemanticException
        Yields the least upper bounds between two identifiers.
        Parameters:
        other - the other identifier
        Returns:
        the least upper bounds between two identifiers.
        Throws:
        SemanticException - if this and other are not equal.
      • mightNeedRewriting

        public boolean mightNeedRewriting()
        Description copied from class: SymbolicExpression
        Yields whether or not this expression can be considered safe to be processed by domains that only focus on ValueExpressions, or if it might need rewriting. This is a definite answer: if this method returns true, than this expression is sure to not contain anything that deals with, or points to, the memory.
        Specified by:
        mightNeedRewriting in class SymbolicExpression
        Returns:
        whether or not this expression might need rewriting