Class OptimizedAnalyzedCFG<A extends AbstractState<A>>

    • Constructor Detail

      • OptimizedAnalyzedCFG

        public OptimizedAnalyzedCFG​(CFG cfg,
                                    ScopeId id,
                                    AnalysisState<A> singleton,
                                    InterproceduralAnalysis<A> interprocedural)
        Builds the control flow graph, storing the given mapping between nodes and fixpoint computation results.
        Parameters:
        cfg - the original control flow graph
        id - a ScopeId meant to identify this specific result based on how it has been produced
        singleton - an instance of the AnalysisState containing the abstract state of the analysis that was executed, used to retrieve top and bottom values
        interprocedural - the analysis that have been used to produce this result, and that can be used to unwind the results
      • OptimizedAnalyzedCFG

        public OptimizedAnalyzedCFG​(CFG cfg,
                                    ScopeId id,
                                    AnalysisState<A> singleton,
                                    java.util.Map<Statement,​AnalysisState<A>> entryStates,
                                    java.util.Map<Statement,​AnalysisState<A>> results,
                                    InterproceduralAnalysis<A> interprocedural)
        Builds the control flow graph, storing the given mapping between nodes and fixpoint computation results.
        Parameters:
        cfg - the original control flow graph
        id - a ScopeId meant to identify this specific result based on how it has been produced
        singleton - an instance of the AnalysisState containing the abstract state of the analysis that was executed, used to retrieve top and bottom values
        entryStates - the entry state for each entry point of the cfg
        results - the results of the fixpoint computation
        interprocedural - the analysis that have been used to produce this result, and that can be used to unwind the results
      • OptimizedAnalyzedCFG

        public OptimizedAnalyzedCFG​(CFG cfg,
                                    ScopeId id,
                                    StatementStore<A> entryStates,
                                    StatementStore<A> results,
                                    InterproceduralAnalysis<A> interprocedural)
        Builds the control flow graph, storing the given mapping between nodes and fixpoint computation results.
        Parameters:
        cfg - the original control flow graph
        id - a ScopeId meant to identify this specific result based on how it has been produced
        entryStates - the entry state for each entry point of the cfg
        results - the results of the fixpoint computation
        interprocedural - the analysis that have been used to produce this result, and that can be used to unwind the results
    • Method Detail

      • getUnwindedAnalysisStateAfter

        public AnalysisState<A> getUnwindedAnalysisStateAfter​(Statement st,
                                                              FixpointConfiguration conf)
        Yields the computed result at a given statement (exit state). If such a state is not available as it was discarded due to optimization, and fixpoint's results have not been unwinded yet, a fixpoint iteration is executed in-place through unwind(FixpointConfiguration).
        Parameters:
        st - the statement
        conf - the FixpointConfiguration to use for running the fast fixpoint computation
        Returns:
        the result computed at the given statement
      • unwind

        public void unwind​(FixpointConfiguration conf)
        Runs an ascending fixpoint computation starting with the results available in this graph, with the purpose of propagating the approximations held in this result to all the missing nodes.
        Parameters:
        conf - the FixpointConfiguration to use for running the fast fixpoint computation
      • hasPostStateOf

        public boolean hasPostStateOf​(Statement st)
        Yields whether or not the non-unwinded results of this cfg contain the poststate of the given statement.
        Parameters:
        st - the statement
        Returns:
        whether or not a poststate for st exists
      • storePostStateOf

        public void storePostStateOf​(Statement st,
                                     AnalysisState<A> postState)
        Stores the given poststate for the statement in the non-unwinded results of this cfg, overwriting any existing value.
        Parameters:
        st - the statement
        postState - the poststate
      • lubAux

        public OptimizedAnalyzedCFG<A> lubAux​(AnalyzedCFG<A> other)
                                       throws SemanticException
        Description copied from interface: BaseLattice
        Performs the least upper bound operation between this lattice element and the given one, assuming that base cases have already been handled. In particular, it is guaranteed that:
        • other is not null
        • other is neither top nor bottom
        • this is neither top nor bottom
        • this and other are not the same object (according both to == and to Object.equals(Object))
        Specified by:
        lubAux in interface BaseLattice<A extends AbstractState<A>>
        Overrides:
        lubAux in class AnalyzedCFG<A extends AbstractState<A>>
        Parameters:
        other - the other lattice element
        Returns:
        the least upper bound between this and other
        Throws:
        SemanticException - if an error occurs during the computation
      • glbAux

        public OptimizedAnalyzedCFG<A> glbAux​(AnalyzedCFG<A> other)
                                       throws SemanticException
        Description copied from interface: BaseLattice
        Performs the greatest lower bound operation between this lattice element and the given one, assuming that base cases have already been handled. In particular, it is guaranteed that:
        • other is not null
        • other is neither top nor bottom
        • this is neither top nor bottom
        • this and other are not the same object (according both to == and to Object.equals(Object))
        Specified by:
        glbAux in interface BaseLattice<A extends AbstractState<A>>
        Overrides:
        glbAux in class AnalyzedCFG<A extends AbstractState<A>>
        Parameters:
        other - the other lattice element
        Returns:
        the greatest lower bound between this and other
        Throws:
        SemanticException - if an error occurs during the computation
      • wideningAux

        public OptimizedAnalyzedCFG<A> wideningAux​(AnalyzedCFG<A> other)
                                            throws SemanticException
        Description copied from interface: BaseLattice
        Performs the widening operation between this lattice element and the given one, assuming that base cases have already been handled. In particular, it is guaranteed that:
        • other is not null
        • other is neither top nor bottom
        • this is neither top nor bottom
        • this and other are not the same object (according both to == and to Object.equals(Object))
        The default implementation of this method delegates to BaseLattice.lubAux(BaseLattice), and is thus safe for finite lattices and ACC ones.
        Specified by:
        wideningAux in interface BaseLattice<A extends AbstractState<A>>
        Overrides:
        wideningAux in class AnalyzedCFG<A extends AbstractState<A>>
        Parameters:
        other - the other lattice element
        Returns:
        the widening between this and other
        Throws:
        SemanticException - if an error occurs during the computation
      • narrowingAux

        public OptimizedAnalyzedCFG<A> narrowingAux​(AnalyzedCFG<A> other)
                                             throws SemanticException
        Description copied from interface: BaseLattice
        Performs the narrowing operation between this lattice element and the given one, assuming that base cases have already been handled. In particular, it is guaranteed that:
        • other is not null
        • other is neither top nor bottom
        • this is neither top nor bottom
        • this and other are not the same object (according both to == and to Object.equals(Object))
        The default implementation of this method delegates to BaseLattice.glbAux(BaseLattice), and is thus safe for finite lattices and DCC ones.
        Specified by:
        narrowingAux in interface BaseLattice<A extends AbstractState<A>>
        Overrides:
        narrowingAux in class AnalyzedCFG<A extends AbstractState<A>>
        Parameters:
        other - the other lattice element
        Returns:
        the narrowing between this and other
        Throws:
        SemanticException - if an error occurs during the computation