Class CallGraphBasedAnalysis<A extends it.unive.lisa.analysis.AbstractState<A>>

  • Type Parameters:
    A - The AbstractState of the analysis
    All Implemented Interfaces:
    it.unive.lisa.interprocedural.InterproceduralAnalysis<A>
    Direct Known Subclasses:
    ContextBasedAnalysis

    public abstract class CallGraphBasedAnalysis<A extends it.unive.lisa.analysis.AbstractState<A>>
    extends java.lang.Object
    implements it.unive.lisa.interprocedural.InterproceduralAnalysis<A>
    An interprocedural analysis based on a call graph.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected it.unive.lisa.program.Application app
      The application.
      protected it.unive.lisa.interprocedural.callgraph.CallGraph callgraph
      The call graph used to resolve method calls.
      protected it.unive.lisa.interprocedural.OpenCallPolicy policy
      The policy to evaluate results of open calls.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      it.unive.lisa.analysis.AnalysisState<A> getAbstractResultOf​(it.unive.lisa.program.cfg.statement.call.OpenCall call, it.unive.lisa.analysis.AnalysisState<A> entryState, it.unive.lisa.analysis.lattices.ExpressionSet[] parameters, it.unive.lisa.analysis.StatementStore<A> expressions)  
      void init​(it.unive.lisa.program.Application app, it.unive.lisa.interprocedural.callgraph.CallGraph callgraph, it.unive.lisa.interprocedural.OpenCallPolicy policy)  
      boolean needsCallGraph()  
      it.unive.lisa.analysis.AnalysisState<A> prepareEntryStateOfEntryPoint​(it.unive.lisa.analysis.AnalysisState<A> entryState, it.unive.lisa.program.cfg.CFG cfg)
      Prepare and entry state for the analysis of a method by renaming parameters.
      it.unive.lisa.program.cfg.statement.call.Call resolve​(it.unive.lisa.program.cfg.statement.call.UnresolvedCall call, java.util.Set<it.unive.lisa.type.Type>[] types, it.unive.lisa.analysis.symbols.SymbolAliasing aliasing)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface it.unive.lisa.interprocedural.InterproceduralAnalysis

        fixpoint, getAbstractResultOf, getAnalysisResultsOf, getFixpointResults, returnsVoid, scope, unscope
    • Field Detail

      • callgraph

        protected it.unive.lisa.interprocedural.callgraph.CallGraph callgraph
        The call graph used to resolve method calls.
      • app

        protected it.unive.lisa.program.Application app
        The application.
      • policy

        protected it.unive.lisa.interprocedural.OpenCallPolicy policy
        The policy to evaluate results of open calls.
    • Constructor Detail

      • CallGraphBasedAnalysis

        protected CallGraphBasedAnalysis()
        Builds the analysis.
      • CallGraphBasedAnalysis

        protected CallGraphBasedAnalysis​(CallGraphBasedAnalysis<A> other)
        Builds the analysis by copying the given one.
        Parameters:
        other - the original analysis to copy
    • Method Detail

      • needsCallGraph

        public boolean needsCallGraph()
        Specified by:
        needsCallGraph in interface it.unive.lisa.interprocedural.InterproceduralAnalysis<A extends it.unive.lisa.analysis.AbstractState<A>>
      • init

        public void init​(it.unive.lisa.program.Application app,
                         it.unive.lisa.interprocedural.callgraph.CallGraph callgraph,
                         it.unive.lisa.interprocedural.OpenCallPolicy policy)
                  throws it.unive.lisa.interprocedural.InterproceduralAnalysisException
        Specified by:
        init in interface it.unive.lisa.interprocedural.InterproceduralAnalysis<A extends it.unive.lisa.analysis.AbstractState<A>>
        Throws:
        it.unive.lisa.interprocedural.InterproceduralAnalysisException
      • resolve

        public it.unive.lisa.program.cfg.statement.call.Call resolve​(it.unive.lisa.program.cfg.statement.call.UnresolvedCall call,
                                                                     java.util.Set<it.unive.lisa.type.Type>[] types,
                                                                     it.unive.lisa.analysis.symbols.SymbolAliasing aliasing)
                                                              throws it.unive.lisa.interprocedural.callgraph.CallResolutionException
        Specified by:
        resolve in interface it.unive.lisa.interprocedural.InterproceduralAnalysis<A extends it.unive.lisa.analysis.AbstractState<A>>
        Throws:
        it.unive.lisa.interprocedural.callgraph.CallResolutionException
      • prepareEntryStateOfEntryPoint

        public it.unive.lisa.analysis.AnalysisState<A> prepareEntryStateOfEntryPoint​(it.unive.lisa.analysis.AnalysisState<A> entryState,
                                                                                     it.unive.lisa.program.cfg.CFG cfg)
                                                                              throws it.unive.lisa.analysis.SemanticException
        Prepare and entry state for the analysis of a method by renaming parameters.
        Parameters:
        entryState - the initial entry state
        cfg - the CFG of the method
        Returns:
        the entry state with the right parameter binding
        Throws:
        it.unive.lisa.analysis.SemanticException - if the analysis fails
      • getAbstractResultOf

        public it.unive.lisa.analysis.AnalysisState<A> getAbstractResultOf​(it.unive.lisa.program.cfg.statement.call.OpenCall call,
                                                                           it.unive.lisa.analysis.AnalysisState<A> entryState,
                                                                           it.unive.lisa.analysis.lattices.ExpressionSet[] parameters,
                                                                           it.unive.lisa.analysis.StatementStore<A> expressions)
                                                                    throws it.unive.lisa.analysis.SemanticException
        Specified by:
        getAbstractResultOf in interface it.unive.lisa.interprocedural.InterproceduralAnalysis<A extends it.unive.lisa.analysis.AbstractState<A>>
        Throws:
        it.unive.lisa.analysis.SemanticException