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:
ComponentGraphA frozen
ComponentGraphretaining structured control regions.- Parameters:
nodes (tuple[ComponentNode, ...])
data_edges (tuple[DataEdge, ...])
control_edges (tuple[ControlEdge, ...])
state_bindings (tuple[StateBinding, ...])
entry_points (tuple[NodeRef, ...])
region_nodes (tuple[RegionNode, ...])
operations (tuple[ComponentNode | RegionNode, ...])
metadata (Mapping[str, object])
effect (StateContract)
Methods
Promote an ordinary graph while retaining supplied structure. |
|
Return the first node with the requested component ID. |
|
Raise when this graph or one of its nested bodies is invalid. |
|
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:
nodes (tuple[ComponentNode, ...])
data_edges (tuple[DataEdge, ...])
control_edges (tuple[ControlEdge, ...])
state_bindings (tuple[StateBinding, ...])
entry_points (tuple[NodeRef, ...])
region_nodes (tuple[RegionNode, ...])
operations (tuple[ComponentNode | RegionNode, ...])
metadata (Mapping[str, object])
effect (StateContract)
- Return type:
None
- classmethod StructuredGraph.from_graph(graph, *, region_nodes=(), metadata=None, effect=None)[source]#
Promote an ordinary graph while retaining supplied structure.
- Parameters:
graph (ComponentGraph)
region_nodes (tuple[RegionNode, ...])
metadata (Mapping[str, object] | None)
effect (StateContract | None)
- Return type:
- StructuredGraph.node_by_id(component_id)#
Return the first node with the requested component ID.
- Parameters:
component_id (str)
- Return type:
- StructuredGraph.validate()[source]#
Raise when this graph or one of its nested bodies is invalid.
ComponentGraphdeliberately 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