Class CFGWithAnalysisResults<A extends AbstractState<A,​H,​V>,​H extends HeapDomain<H>,​V extends ValueDomain<V>>

    • Constructor Detail

      • CFGWithAnalysisResults

        public CFGWithAnalysisResults​(CFG cfg,
                                      AnalysisState<A,​H,​V> singleton)
        Builds the control flow graph, storing the given mapping between nodes and fixpoint computation results.
        Parameters:
        cfg - the original control flow graph
        singleton - an instance of the AnalysisState containing the abstract state of the analysis that was executed, used to retrieve top and bottom values
      • CFGWithAnalysisResults

        public CFGWithAnalysisResults​(CFG cfg,
                                      AnalysisState<A,​H,​V> singleton,
                                      java.util.Map<Statement,​AnalysisState<A,​H,​V>> entryStates,
                                      java.util.Map<Statement,​AnalysisState<A,​H,​V>> results)
        Builds the control flow graph, storing the given mapping between nodes and fixpoint computation results.
        Parameters:
        cfg - the original control flow graph
        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
    • Method Detail

      • getId

        public java.lang.String getId()
        Yields a string meant to identify this specific result, based on how it has been produced. This method might return null.
        Returns:
        the identifier of this result
      • setId

        public void setId​(java.lang.String id)
        Sets the string meant to identify this specific result, based on how it has been produced.
        Parameters:
        id - the identifier of this result (might be null)
      • getAnalysisStateBefore

        public final AnalysisState<A,​H,​V> getAnalysisStateBefore​(Statement st)
                                                                      throws SemanticException
        Yields the computed result before a given statement (entry state).
        Parameters:
        st - the statement
        Returns:
        the result computed before the given statement
        Throws:
        SemanticException - if the lub operator fails
      • getAnalysisStateAfter

        public final AnalysisState<A,​H,​V> getAnalysisStateAfter​(Statement st)
        Yields the computed result at a given statement (exit state).
        Parameters:
        st - the statement
        Returns:
        the result computed at the given statement
      • lessOrEqual

        public boolean lessOrEqual​(CFGWithAnalysisResults<A,​H,​V> other)
                            throws SemanticException
        Description copied from interface: Lattice
        Yields true if and only if this lattice element is in relation with (usually represented through ≤) the given one. This operation is not commutative.
        Specified by:
        lessOrEqual in interface Lattice<A extends AbstractState<A,​H,​V>>
        Parameters:
        other - the other lattice element
        Returns:
        true if and only if that condition holds
        Throws:
        SemanticException - if an error occurs during the computation
      • top

        public CFGWithAnalysisResults<A,​H,​V> 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.
        Specified by:
        top in interface Lattice<A extends AbstractState<A,​H,​V>>
        Returns:
        the top element
      • isTop

        public boolean isTop()
        Description copied from interface: Lattice
        Yields true if and only if this object represents the top of the lattice. The default implementation of this method uses reference equality between this and the value returned by Lattice.top(), thus assuming that the top element is a singleton. If this is not the case, override this method accordingly to provide a coherent test.
        Specified by:
        isTop in interface Lattice<A extends AbstractState<A,​H,​V>>
        Returns:
        true if this is the top of the lattice
      • bottom

        public CFGWithAnalysisResults<A,​H,​V> 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.
        Specified by:
        bottom in interface Lattice<A extends AbstractState<A,​H,​V>>
        Returns:
        the bottom element
      • isBottom

        public boolean isBottom()
        Description copied from interface: Lattice
        Yields true if and only if this object represents the bottom of the lattice. The default implementation of this method uses reference equality between this and the value returned by Lattice.bottom(), thus assuming that the bottom element is a singleton. If this is not the case, override this method accordingly to provide a coherent test.
        Specified by:
        isBottom in interface Lattice<A extends AbstractState<A,​H,​V>>
        Returns:
        true if this is the bottom of the lattice
      • toDot

        protected DotCFG toDot​(java.util.function.Function<Statement,​java.lang.String> labelGenerator)
        Description copied from class: Graph
        Converts this graph to a DotGraph instance.
        Overrides:
        toDot in class CFG
        Parameters:
        labelGenerator - the generator that the DotGraph will use to enrich node labels
        Returns:
        the converted DotGraph
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object