Class Environment<M extends Environment<M,​E,​T>,​E extends SymbolicExpression,​T extends NonRelationalDomain<T,​E,​M>>

    • Constructor Detail

      • Environment

        public Environment​(T domain)
        Builds an empty environment.
        Parameters:
        domain - a singleton instance to be used during semantic operations to retrieve top and bottom values
      • Environment

        public Environment​(T domain,
                           java.util.Map<Identifier,​T> function)
        Builds an environment containing the given mapping. If function is null, the new environment is the top environment if lattice.isTop() holds, and it is the bottom environment if lattice.isBottom() holds.
        Parameters:
        domain - a singleton instance to be used during semantic operations to retrieve top and bottom values
        function - the function representing the mapping contained in the new environment; can be null
    • Method Detail

      • assign

        public M assign​(Identifier id,
                        E expression,
                        ProgramPoint pp,
                        SemanticOracle oracle)
                 throws SemanticException
        Description copied from interface: SemanticDomain
        Yields a copy of this domain, where id has been assigned to value.
        Parameters:
        id - the identifier to assign the value to
        expression - the expression to assign
        pp - the program point that where this operation is being evaluated
        oracle - the oracle for inter-domain communication
        Returns:
        a copy of this domain, modified by the assignment
        Throws:
        SemanticException - if an error occurs during the computation
      • smallStepSemantics

        public M smallStepSemantics​(E expression,
                                    ProgramPoint pp,
                                    SemanticOracle oracle)
                             throws SemanticException
        Description copied from interface: SemanticDomain
        Yields a copy of this domain, that has been modified accordingly to the semantics of the given expression.
        Parameters:
        expression - the expression whose semantics need to be computed
        pp - the program point that where this operation is being evaluated
        oracle - the oracle for inter-domain communication
        Returns:
        a copy of this domain, modified accordingly to the semantics of expression
        Throws:
        SemanticException - if an error occurs during the computation
      • eval

        public T eval​(E expression,
                      ProgramPoint pp,
                      SemanticOracle oracle)
               throws SemanticException
        Evaluates the given expression to an abstract value.
        Parameters:
        expression - the expression to evaluate
        pp - the program point where the evaluation happens
        oracle - the oracle for inter-domain communication
        Returns:
        the abstract result of the evaluation
        Throws:
        SemanticException - if an error happens during the evaluation
      • assume

        public M assume​(E expression,
                        ProgramPoint src,
                        ProgramPoint dest,
                        SemanticOracle oracle)
                 throws SemanticException
        Description copied from interface: SemanticDomain
        Yields a copy of this domain, modified by assuming that the given expression holds. It is required that the returned domain is in relation with this one. A safe (but imprecise) implementation of this method can always return this.
        Parameters:
        expression - the expression to assume to hold.
        src - the program point that where this operation is being evaluated, corresponding to the one that generated the given expression
        dest - the program point where the execution will move after the expression has been assumed
        oracle - the oracle for inter-domain communication
        Returns:
        the (optionally) modified copy of this domain
        Throws:
        SemanticException - if an error occurs during the computation