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

Mergeable heuristic in KCFGSemantics for merging node #4612

Closed
wants to merge 2 commits into from

Conversation

Stevengre
Copy link
Contributor

This is a simple PR for merging nodes, offering a semantics-level heuristic to partition nodes that can be merged.

@ehildenb
Copy link
Member

I don't think it makes sense to merge this without also having some tests of it somehow. Do you have an example of IMP node merging worknig, or another simple definition?

@Stevengre
Copy link
Contributor Author

I tested this on an actual Solidity program a few days ago. However, this PR primarily introduces an interface to define the heuristic, which can't be tested without the merge_node function. Since the new interface results in many test changes, I plan to submit a separate PR for those.

@@ -34,6 +34,11 @@ def custom_step(self, c: CTerm) -> KCFGExtendResult | None: ...

"""Implement a custom semantic step."""

@abstractmethod
def is_mergeable(self, c1: CTerm, c2: CTerm) -> bool: ...
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This PR only introduces an interface. Its semantics will be determined by the merge_node function, which will be provided in another PR.

@ehildenb
Copy link
Member

ehildenb commented Sep 4, 2024

Well we can wait for the merging funcitonality to be ready to go, and merged, then merge this new interface and some tests of it with the node merging. This will trigger needed changes downstream, because each of the downstream semantics will have to now implement this interface, and we don't know if it's fully working yet.

Once #4617 and #4621 are merged, we can then have this PR introduce both the merge_nodes predicate, the main algorithm for merging KCFG nodes, and some tests over one of the semantics.

@Stevengre
Copy link
Contributor Author

Thank you for your suggestion! I'll follow your advice.

@Stevengre Stevengre mentioned this pull request Sep 6, 2024
@ehildenb ehildenb mentioned this pull request Sep 17, 2024
@ehildenb
Copy link
Member

Subsumed by: #4628

@ehildenb ehildenb closed this Sep 17, 2024
@ehildenb ehildenb deleted the mergeable-heuristic branch September 17, 2024 12:56
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