:py:mod:`raesl.compile.instantiating.edge_building` =================================================== .. py:module:: raesl.compile.instantiating.edge_building .. autoapi-nested-parse:: Edge building for the instantiated output graph. Reference: https://ratio-case.gitlab.io/docs/reference/esl_reference/dependency-derivations.html Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: raesl.compile.instantiating.edge_building.EdgeStore raesl.compile.instantiating.edge_building.EdgeFactory Functions ~~~~~~~~~ .. autoapisummary:: raesl.compile.instantiating.edge_building._generate_evbc raesl.compile.instantiating.edge_building._get_component_behavior_dependency raesl.compile.instantiating.edge_building._get_paths_between_all raesl.compile.instantiating.edge_building._get_paths raesl.compile.instantiating.edge_building._get_function_behavior_dependency .. py:class:: EdgeStore Edge storage with multiple categories for quicker access to specific subsets. .. py:attribute:: categories :value: ['edges'] .. py:method:: clear() Clear all edge categories. .. py:method:: add(edge: ragraph.edge.Edge, *args) Add node to :obj:`self.nodes` and any other specified maps in args. .. py:method:: consume(edges: Iterable[ragraph.edge.Edge], *args) Add any edges from an iterable to given categories. .. py:class:: EdgeFactory(diag_store: raesl.compile.diagnostics.DiagnosticStore, node_store: Optional[raesl.compile.instantiating.node_building.NodeStore] = None) .. py:method:: _add(edge: ragraph.edge.Edge, *args) Proxy for :obj:`EdgeStore.add`. .. py:method:: _consume(edges: Iterable[ragraph.edge.Edge], *args) Proxy for :obj:`EdgeStore.consume`. .. py:method:: _make(cat: str) -> List[ragraph.edge.Edge] Make an edge category if it is still empty and return it for quick access. .. py:method:: make_edges(node_store: Optional[raesl.compile.instantiating.node_building.NodeStore] = None) -> List[ragraph.edge.Edge] Derive edges from a :obj:`NodeStore` object. .. py:method:: _make_evf() Compute functional dependencies between variable nodes. .. py:method:: _make_evb() Compute logical dependencies between variables for behavior specs. .. py:method:: _make_evd() Compute design dependencies between variables. .. py:method:: _make_ecf() Compute function dependencies between component nodes. .. py:method:: _make_ecb() Compute logical dependencies between components. .. py:method:: _make_ecd() Create design dependencies between components. .. py:method:: _make_eft() Create traceability dependencies between function specifications. .. py:method:: _make_eff() Creating all functional dependencies between between goals and transforms. .. py:method:: _make_efb() Compute behavior dependencies between goal- and transformation specs. .. py:method:: _make_ehb() Creating logical dependencies between behavior specifications. .. py:method:: _make_ehc() Creating coordination dependencies between behavior specifications. .. py:method:: _make_edc() Create coordination dependencies between design specifications. .. py:method:: _make_enc() Create coordination dependencies between needs. .. py:method:: _make_erc() Create coordination dependencies between relations. .. py:method:: _make_mcf() Compute mapping relations between components and functions. .. py:method:: _make_mcv() Create mapping relations between components and variables. .. py:method:: _make_mcb() Create mapping dependencies between components and behavior specs. .. py:method:: _make_mfb() Create mapping dependencies between function specs and behavior specs. .. py:method:: _make_mbv() Create mapping relations between behavior specifications and variables. .. py:method:: _make_mcd() Create mapping relations between components and design requirements. .. py:method:: _make_mcr() Create mapping relations between components and relations. .. py:method:: _make_mfv() Construct mapping dependencies between function specs and variables. .. py:method:: _make_mfd() Construct mapping dependencies between function specs and design specs. .. py:method:: _make_mfr() Create mapping dependencies between functions specs and relation specs. .. py:method:: _make_mbd() Create mapping dependencies between behavior requirements and design specifications. .. py:method:: _make_mbr() Create mapping dependencies between behavior requirements and relation specifications. .. py:method:: _make_mvd() Create mapping dependencies between variables and design specifications. .. py:method:: _make_mvr() Create mapping relations between variables and relation specifications. .. py:method:: _make_mdr() Create mapping dependencies between design specs and relation specs. .. py:method:: _make_mnx() Create mapping dependencies between needs and all other elements. .. py:function:: _generate_evbc(behavior: ragraph.node.Node, case: Dict[str, Any], nodes: Dict[str, ragraph.node.Node]) -> Generator[ragraph.edge.Edge, None, None] Compute logical dependencies between variables for a behavior case specification. :param behavior: Behavior specification that contains the case from which the logical dependencies must be derived. :param case: The case from which the logical dependencies must be derived. :param nodes: Dictionary of node name to Node object. :Yields: Corresponding edges. .. py:function:: _get_component_behavior_dependency(nodes: Dict[str, ragraph.node.Node], src: ragraph.node.Node, trg: ragraph.node.Node, ev_dict: Dict[Tuple[ragraph.node.Node, ragraph.node.Node], List[ragraph.edge.Edge]], vf_dict: Dict[str, List[ragraph.node.Node]]) -> Optional[ragraph.edge.Edge] Check if two component nodes have a behavior dependency. :param nodes: Dictionary from node to node name. :param src: The source node for which the dependency must be checked. :param trg: THe target node for which the dependency must be checked. :param ev_dict: Dictionary of node pairs to list of edges. :param vf_dict: Dictionary of variable name to function spec nodes. :returns: An Edge if a behavior dependency exists. Otherwise None. .. py:function:: _get_paths_between_all(srcs=List[Node], trgs=List[Node], edges=List[Edge]) -> List[List[str]] Compute paths between nodes. Based on depth first search. :param srcs: List of starting nodes of paths. :param trgs: Set of ending nodes of path. :param edges: List of edges between nodes. :Yields: List of lists of node names. .. py:function:: _get_paths(src: ragraph.node.Node, edge_dct: Dict[ragraph.node.Node, Dict[ragraph.node.Node, ragraph.edge.Edge]], trgs: Set[ragraph.node.Node], visited: List[ragraph.node.Node] = []) -> List[List[str]] Collection all paths (list of node names) between the source node and the set of target nodes. :param src: The source nodes where all paths should start. :param edge_dct: Dictionary of Node to Node to Edge. Contains the edges to be considered when searching for paths. :param trgs: Set of node where the paths should end. :param visited: List of nodes already visited. Required to prevent running in cycles. :returns: List of lists of node names. .. py:function:: _get_function_behavior_dependency(nodes: Dict[str, ragraph.node.Node], src: ragraph.node.Node, trg: ragraph.node.Node, ev_dict: Dict[Tuple[ragraph.node.Node, ragraph.node.Node], ragraph.edge.Edge], vf_dict: Dict[str, List[ragraph.node.Node]]) -> Optional[ragraph.edge.Edge] Check if two function spec nodes have a behavior dependency. :param nodes: Dictionary from node to node name. :param src: The source node for which the dependency must be checked. :param trg: THe target node for which the dependency must be checked. :param ev_dict: Dictionary of node pairs to edge. :param vf_dict: Dictionary of variable names to function specs. :returns: An Edge if a behavior dependency exists. Otherwise None.