Class BackwardOptimizedAnalyzedCFG<A extends AbstractState<A>>

    • Constructor Detail

      • BackwardOptimizedAnalyzedCFG

        public BackwardOptimizedAnalyzedCFG​(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
      • BackwardOptimizedAnalyzedCFG

        public BackwardOptimizedAnalyzedCFG​(CFG cfg,
                                            ScopeId id,
                                            AnalysisState<A> singleton,
                                            java.util.Map<Statement,​AnalysisState<A>> exitStates,
                                            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
        exitStates - the exit state for each exit 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
      • BackwardOptimizedAnalyzedCFG

        public BackwardOptimizedAnalyzedCFG​(CFG cfg,
                                            ScopeId id,
                                            StatementStore<A> exitStates,
                                            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
        exitStates - the exit state for each exit 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

      • getUnwindedAnalysisStateBefore

        public AnalysisState<A> getUnwindedAnalysisStateBefore​(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
      • hasPreStateOf

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

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

        public BackwardOptimizedAnalyzedCFG<A> lubAux​(BackwardAnalyzedCFG<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 BackwardAnalyzedCFG<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 BackwardOptimizedAnalyzedCFG<A> glbAux​(BackwardAnalyzedCFG<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 BackwardAnalyzedCFG<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