Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support write MergedEdge during proof #4689

Closed
wants to merge 6 commits into from

Conversation

Stevengre
Copy link
Contributor

@Stevengre Stevengre commented Nov 21, 2024

  • updating the to_dict & from_dict method for MergedEdge
  • expanding the to_dict_no_nodes method to include merged edges.

@rv-jenkins rv-jenkins changed the base branch from master to develop November 21, 2024 11:58
@@ -264,18 +264,36 @@ class MergedEdge(EdgeLike):
edges: tuple[KCFG.Edge, ...]

def to_dict(self) -> dict[str, Any]:

def _merged_edge_to_dict(edge: KCFG.Edge) -> dict[str, Any]:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def _merged_edge_to_dict(edge: KCFG.Edge) -> dict[str, Any]:
def merged_edge_to_dict(edge: KCFG.Edge) -> dict[str, Any]:

(The functions is only visible from to_dict anyways.)

}

@staticmethod
def from_dict(dct: dict[str, Any], nodes: Mapping[int, KCFG.Node]) -> KCFG.Successor:

def _merged_edge_from_dict(dct: dict[str, Any]) -> KCFG.Edge:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def _merged_edge_from_dict(dct: dict[str, Any]) -> KCFG.Edge:
def merged_edge_from_dict(dct: dict[str, Any]) -> KCFG.Edge:

Comment on lines +116 to +117
def _make_edge_dicts(*edges: Iterable) -> list[dict[str, Any]]:
def _make_edge_dict(i: int, j: int, depth: int = 1, rules: tuple[str, ...] = ()) -> dict[str, Any]:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two functions can be on the same level.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def _make_edge_dicts(*edges: Iterable) -> list[dict[str, Any]]:
def _make_edge_dict(i: int, j: int, depth: int = 1, rules: tuple[str, ...] = ()) -> dict[str, Any]:
def make_edge_dicts(*edges: Iterable) -> list[dict[str, Any]]:
def make_edge_dict(i: int, j: int, depth: int = 1, rules: tuple[str, ...] = ()) -> dict[str, Any]:

@Stevengre Stevengre closed this Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants