Skip to content

Commit

Permalink
change name remove_node_silent to remove_edges_around.
Browse files Browse the repository at this point in the history
  • Loading branch information
Stevengre committed Nov 26, 2024
1 parent f960d53 commit 5c76cfc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pyk/src/pyk/kcfg/kcfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -760,13 +760,13 @@ def create_node(self, cterm: CTerm) -> KCFG.Node:
return node

def remove_node(self, node_id: NodeIdLike) -> None:
self.remove_node_silent(node_id)
node_id = self._resolve(node_id)
self._nodes.pop(node_id)
self._deleted_nodes.add(node_id)
self._created_nodes.discard(node_id)
self.remove_edges_around(node_id)

def remove_node_silent(self, node_id: NodeIdLike) -> None:
def remove_edges_around(self, node_id: NodeIdLike) -> None:
node_id = self._resolve(node_id)

self._edges = {k: s for k, s in self._edges.items() if k != node_id and node_id not in s.target_ids}
Expand Down
2 changes: 1 addition & 1 deletion pyk/src/pyk/kcfg/minimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def _is_mergeable(x: KCFG.Edge | KCFG.MergedEdge, y: KCFG.Edge | KCFG.MergedEdge
continue
for e in p:
# TODO: remove the split and edges, then safely remove the nodes.
self.kcfg.remove_node_silent(e.source.id)
self.kcfg.remove_edges_around(e.source.id)

# Create A -|MergedEdge|-> Merged_Bi -|Split|-> Bi, if one edge partition covers all the splits
if len(edge_partitions) == 1:
Expand Down

0 comments on commit 5c76cfc

Please sign in to comment.