GroundedFunctionNetwork API

The central class for the program analysis component of Delphi is the GroundedFunctionNetwork, which represents a bipartite graph that encodes information about computational relationships between variables in code.

Additionally, the ForwardInfluenceBlanket class is provided to facilitate model comparison

class GroundedFunctionNetwork(G, scope_tree, outputs)[source]

Representation of a GrFN model as a DiGraph with a set of input nodes and currently a single output. The DiGraph is composed of variable nodes and function nodes. Function nodes store an actual Python function with the expected set of ordered input arguments that correspond to the variable inputs of that node. Variable nodes store a value. This value can be any data type found in Python. When no value exists for a variable the value key will be set to None. Importantly only function nodes can be children or parents of variable nodes, and the reverse is also true. Both variable and function nodes can be inputs, but the output will always be a variable node.

Constructors

GroundedFunctionNetwork.from_fortran_src(...)

Create a GroundedFunctionNetwork instance from a string with raw Fortran code.

GroundedFunctionNetwork.from_fortran_file(...)

Builds GrFN object from a Fortran program.

GroundedFunctionNetwork.from_python_src(...)

GroundedFunctionNetwork.from_python_file(...)

Builds GrFN object from Python file.

Export

GroundedFunctionNetwork.to_CAG()

Export to a Causal Analysis Graph (CAG) PyGraphviz AGraph object.

Execution

GroundedFunctionNetwork.run(inputs)

Executes the GrFN over a particular set of inputs and returns the result.

Model Analysis

Sensitivity Analysis

ForwardInfluenceBlanket.run(inputs, covers)

Executes the FIB over a particular set of inputs and returns the result. :param inputs: Input set where keys are the names of input nodes in the GrFN and each key points to a set of input values (or just one).