equip.analysis.graph package

Submodules

equip.analysis.graph.dominators

Dominator tree

copyright:
  1. 2014 by Romain Gaucher (@rgaucher)
license:

Apache 2, see LICENSE for more details.

class equip.analysis.graph.dominators.DominatorTree(cfg)[source]

Bases: object

Handles the dominator trees (dominator/post-dominator), and the computation of the dominance frontier.

build()[source]
cfg

Returns the CFG used for computing the dominator trees.

dom

Returns the dict containing the mapping of each node to its immediate dominator.

frontier

Returns the dict containing the mapping of each node to its dominance frontier (a set).

post_dom

Returns the dict containing the mapping of each node to its immediate post-dominator.

print_tree(post_dom=False)[source]

equip.analysis.graph.graphs

Graph data structures

copyright:
  1. 2014 by Romain Gaucher (@rgaucher)
license:

Apache 2, see LICENSE for more details.

class equip.analysis.graph.graphs.DiGraph(multiple_edges=True)[source]

Bases: object

A simple directed-graph structure.

add_edge(edge)[source]
add_node(node)[source]
edges
has_node(node)[source]
in_degree(node)[source]
in_edges(node)[source]
inverse()[source]

Returns a copy of this graph where all edges have been reversed

make_add_edge(source=None, dest=None, kind=None, data=None)[source]
make_add_node(kind=None, data=None)[source]
static make_edge(source=None, dest=None, kind=None, data=None)[source]
static make_node(kind=None, data=None)[source]
multiple_edges
nodes
out_degree(node)[source]
out_edges(node)[source]
remove_edge(edge)[source]
remove_node(node)[source]
to_dot()[source]
class equip.analysis.graph.graphs.Edge(source=None, dest=None, kind=None, data=None)[source]

Bases: object

GLOBAL_COUNTER = 0
data
dest
gid
inverse()[source]
inversed
kind
source
class equip.analysis.graph.graphs.Node(kind=None, data=None)[source]

Bases: object

GLOBAL_COUNTER = 0
data
gid
kind

equip.analysis.graph.io

Outputs the graph structures

copyright:
  1. 2014 by Romain Gaucher (@rgaucher)
license:

Apache 2, see LICENSE for more details.

class equip.analysis.graph.io.DotConverter(graph)[source]

Bases: object

add_edge(edge)[source]
add_node(node)[source]
get_node_id(node)[source]
static process(graph)[source]
run()[source]

equip.analysis.graph.traversals

DFS/BFS and some other utils

copyright:
  1. 2014 by Romain Gaucher (@rgaucher)
license:

Apache 2, see LICENSE for more details.

class equip.analysis.graph.traversals.EdgeVisitor[source]

Bases: object

visit(edge)[source]
class equip.analysis.graph.traversals.Walker(graph, visitor, backwards=False)[source]

Bases: object

Traverses edges in the graph in DFS.

graph
traverse(root)[source]
visitor
equip.analysis.graph.traversals.dfs_postorder_nodes(graph, root)[source]

Module contents

equip.analysis.graph

Graph based operators.

copyright:
  1. 2014 by Romain Gaucher (@rgaucher)
license:

Apache 2, see LICENSE for more details.