Dataflow Software Stack  032db78
Master Thesis of Mathijs Saey at the VUB
 All Classes Namespaces Files Functions Variables Pages
Namespaces
IGR Namespace Reference

DVM Intermediate Graph Representation. More...

Namespaces

 dot
 IGR dot parser.
 
 graph
 Complete program.
 
 literal
 Literal definitions.
 
 node
 Node definitions.
 
 port
 Port definitions.
 
 subgraph
 SubGraph definitions.
 
 traverse
 IGR Traversals.
 

Functions

Graph
def getSubGraphs
 Get a list of all the non-compound subgraphs in the program. More...
 
def getSubGraph
 Get a subgraph by name. More...
 
def removeSubGraph
 Remove a subgraph from the program. More...
 
Subgraphs
def createGeneralSubGraph
 Create a new subgraph. More...
 
def createSubGraph
 Create a subgraph and add it to the program graph. More...
 
def createCompoundSubGraph
 Create a subgraph for a compound node. More...
 
Nodes
def createNode
 Create a node, add it to it's subgraph and return it. More...
 
def createOperationNode
 Create an operation node. More...
 
def createCompoundNode
 Create a Compound node. More...
 
def createCallNode
 Create a call node. More...
 
def createConstantNode
 Create a constant node. More...
 
Edges and Literals
def addLiteral
 Add a literal to a port. More...
 
def connect
 Connect 2 ports with an implicit edge. More...
 

Detailed Description

DVM Intermediate Graph Representation.

Author
Mathijs Saey

This python module contains the DVM intermediate form, called Intermediate Graph Representation (IGR).

The general idea behind IGR is that it doesn't know anything about the outside world. It is only a graph representation that can be modified by both the front and the backend. However, IGR should not depend on either the front or backend, instead, IGR should be rich enough to work with a variety of front and backends.

This module should be considerd a stable frontend of the module, external modules (such as parsers) should only use these functions to create and modify the IGR.

This module also exports 2 functions, dot::dot() and traverse::traverse()

Function Documentation

def IGR.getSubGraphs ( )

Get a list of all the non-compound subgraphs in the program.

Returns
All the non compound subgraphs in the program.
def IGR.getSubGraph (   name)

Get a subgraph by name.

Parameters
nameThe name of the subgraph we want to retrieve.
Returns
The subgraph
def IGR.removeSubGraph (   subGraph)

Remove a subgraph from the program.

This only works for subgraphs that are not a part of a compound node. Care should be taken to avoid calling this method while iterating over the subgraph list.

Parameters
subGraphA reference to the subgraph to remove.
def IGR.createGeneralSubGraph (   name,
  inputs,
  outputs,
  isFunc 
)

Create a new subgraph.

Parameters
inputsThe amount of inputs the subgraph accepts
outputsThe amount of data the subgraph returns
Returns
The subgraph. It's entry and exit fields should be used to access parameters and return values of this subgraph.
def IGR.createSubGraph (   name,
  inputs,
  outputs 
)

Create a subgraph and add it to the program graph.

def IGR.createCompoundSubGraph ( )

Create a subgraph for a compound node.

def IGR.createNode (   constructor,
  subGraph,
  arguments = [] 
)

Create a node, add it to it's subgraph and return it.

Parameters
constructorThe constructor to create the node.
subGraphThe subgraph that contains this node.
argumentsThe arguments to pass to the constructor (not including the subgraph)
def IGR.createOperationNode (   subGraph,
  operation 
)

Create an operation node.

Parameters
subGraphThe subGraph that this node is part of
operationThe operation that this node performs
def IGR.createCompoundNode (   type,
  subGraph,
  subGraphs 
)

Create a Compound node.

Parameters
typeThe type of the compound node (e.g. forAll)
subGraphThe subgraph this node belongs too
subGraphssThe subgraphs that are part of this compound node
def IGR.createCallNode (   subGraph,
  function 
)

Create a call node.

Parameters
subGraphthe subgraph this node belongs to
inputsthe amount of inputs this
def IGR.createConstantNode (   subGraph,
  value 
)

Create a constant node.

Parameters
subGraphThe subgraph this node belongs to
valueThe value of this subgraph
def IGR.addLiteral (   value,
  dstNode,
  dstPort 
)

Add a literal to a port.

Parameters
valueThe value of the literal
dstNodeThe node that the literal targets
dstPortThe idx of the port on this node
def IGR.connect (   srcNode,
  srcPort,
  dstNode,
  dstPort 
)

Connect 2 ports with an implicit edge.

Parameters
srcNodeThe node that provides data
srcPortThe idx of the output port on src
dstNodeThe node that accepts the data
dstPortThe idx of the port on dst that accepts the data.