Class CFGResults<A extends AbstractState<A>>

    • Constructor Detail

      • CFGResults

        public CFGResults​(AnalyzedCFG<A> lattice)
        Builds a new result.
        Parameters:
        lattice - a singleton instance used for retrieving top and bottom values
    • Method Detail

      • putResult

        public org.apache.commons.lang3.tuple.Pair<java.lang.Boolean,​AnalyzedCFG<A>> putResult​(ScopeId token,
                                                                                                     AnalyzedCFG<A> result)
                                                                                              throws SemanticException
        Stores the result of a fixpoint computation on a cfg, if needed. This method returns a pair of a boolean and a AnalyzedCFG, where (prev is the AnalyzedCFG already present for the given token):
        • if no prev was stored for token, than that token is mapped to result and this method returns <false, result>
        • if prev <= result, then token is mapped to result and this method returns <true, result>
        • if result <= prev, then the mapping is left untouched and this method returns <false, prev>
        • otherwise, token is mapped to lub = prev.lub(result) and this method returns <true, lub>
        The value returned by this method is intended to be a hint that a new fixpoint computation is needed to ensure that the results are stable.
        Parameters:
        token - the ScopeId that identifying the result
        result - the AnalyzedCFG to store
        Returns:
        true if the previous result has been updated, if any
        Throws:
        SemanticException - if something goes wrong during the update
      • contains

        public boolean contains​(ScopeId token)
        Yields true if a result exists for the given token.
        Parameters:
        token - the ScopeId that identifying the result
        Returns:
        true if that condition holds
      • getAll

        public java.util.Collection<AnalyzedCFG<A>> getAll()
        Yields all the results stored in this object, for any possible ScopeId used.
        Returns:
        the results
      • top

        public CFGResults<A> top()
        Description copied from interface: Lattice
        Yields the top element of this lattice. The returned element should be unique across different calls to this method, since Lattice.isTop() uses reference equality by default. If the value returned by this method is not a singleton, override Lattice.isTop() accordingly to provide a coherent test.
        Returns:
        the top element
      • bottom

        public CFGResults<A> bottom()
        Description copied from interface: Lattice
        Yields the bottom element of this lattice. The returned element should be unique across different calls to this method, since Lattice.isBottom() uses reference equality by default. If the value returned by this method is not a singleton, override Lattice.isBottom() accordingly to provide a coherent test.
        Returns:
        the bottom element