saealib.core.StructuredGraph#

class saealib.core.StructuredGraph(*, nodes, data_edges=(), control_edges=(), state_bindings=(), entry_points=(), region_nodes=(), operations=(), metadata=<factory>, effect=<factory>)[source]#

Bases: ComponentGraph

A frozen ComponentGraph retaining structured control regions.

Parameters:

Methods

__init__

from_graph

Promote an ordinary graph while retaining supplied structure.

node_by_id

Return the first node with the requested component ID.

validate

Raise when this graph or one of its nested bodies is invalid.

well_formedness

Collect structural and graph-level diagnostics without raising.

Method Details

StructuredGraph.__init__(*, nodes, data_edges=(), control_edges=(), state_bindings=(), entry_points=(), region_nodes=(), operations=(), metadata=<factory>, effect=<factory>)#
Parameters:
Return type:

None

classmethod StructuredGraph.from_graph(graph, *, region_nodes=(), metadata=None, effect=None)[source]#

Promote an ordinary graph while retaining supplied structure.

Parameters:
Return type:

StructuredGraph

StructuredGraph.node_by_id(component_id)#

Return the first node with the requested component ID.

Parameters:

component_id (str)

Return type:

ComponentNode

StructuredGraph.validate()[source]#

Raise when this graph or one of its nested bodies is invalid.

ComponentGraph deliberately keeps its structural checks diagnostic- based. Structured control, however, is consumed directly by the structured runtime, so its operation tree must be complete and lowered before a plan can be created.

Return type:

None

StructuredGraph.well_formedness()#

Collect structural and graph-level diagnostics without raising.

Return type:

DiagnosticBag