Class LoopIdentification


  • public class LoopIdentification
    extends java.lang.Object
    Uses algorithm from Wei et al. to identify loops, even irreducible ones. "A New Algorithm for Identifying Loops in Decompilation". Static Analysis Lecture Notes in Computer Science Volume 4634, 2007, pp 170-183 http://link.springer.com/chapter/10.1007%2F978-3-540-74061-2_11 http://www.lenx.100871.net/papers/loop-SAS.pdf Original Implementation: https://github.com/EnSoftCorp/jimple-toolbox-commons
    Author:
    Ben Holland - modifications for general graph use
    • Constructor Summary

      Constructors 
      Constructor Description
      LoopIdentification​(com.ensoftcorp.atlas.core.db.graph.Graph graph, com.ensoftcorp.atlas.core.db.graph.Node root)
      Identify all loop fragments, headers, re-entries, and nesting in the universe graph, applying the tags and attributes in interfaces CFGNode and CFGEdge.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Map<com.ensoftcorp.atlas.core.db.graph.Node,​com.ensoftcorp.atlas.core.db.graph.Node> getInnermostLoopHeaders()  
      com.ensoftcorp.atlas.core.db.set.AtlasSet<com.ensoftcorp.atlas.core.db.graph.Node> getIrreducible()  
      com.ensoftcorp.atlas.core.db.set.AtlasSet<com.ensoftcorp.atlas.core.db.graph.Edge> getLoopbacks()  
      com.ensoftcorp.atlas.core.db.set.AtlasSet<com.ensoftcorp.atlas.core.db.graph.Edge> getReentryEdges()  
      com.ensoftcorp.atlas.core.db.set.AtlasSet<com.ensoftcorp.atlas.core.db.graph.Node> getReentryNodes()  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LoopIdentification

        public LoopIdentification​(com.ensoftcorp.atlas.core.db.graph.Graph graph,
                                  com.ensoftcorp.atlas.core.db.graph.Node root)
        Identify all loop fragments, headers, re-entries, and nesting in the universe graph, applying the tags and attributes in interfaces CFGNode and CFGEdge. NOTE: Handles both natural and irreducible loops
    • Method Detail

      • getReentryNodes

        public com.ensoftcorp.atlas.core.db.set.AtlasSet<com.ensoftcorp.atlas.core.db.graph.Node> getReentryNodes()
      • getIrreducible

        public com.ensoftcorp.atlas.core.db.set.AtlasSet<com.ensoftcorp.atlas.core.db.graph.Node> getIrreducible()
      • getReentryEdges

        public com.ensoftcorp.atlas.core.db.set.AtlasSet<com.ensoftcorp.atlas.core.db.graph.Edge> getReentryEdges()
      • getLoopbacks

        public com.ensoftcorp.atlas.core.db.set.AtlasSet<com.ensoftcorp.atlas.core.db.graph.Edge> getLoopbacks()
      • getInnermostLoopHeaders

        public java.util.Map<com.ensoftcorp.atlas.core.db.graph.Node,​com.ensoftcorp.atlas.core.db.graph.Node> getInnermostLoopHeaders()