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

Chopper #589

Merged
merged 11 commits into from
Jul 25, 2022
Merged

Chopper #589

merged 11 commits into from
Jul 25, 2022

Conversation

Felalolf
Copy link
Contributor

@Felalolf Felalolf commented Jun 29, 2022

Adds the chop function, which splits an input Viper program into several Viper programs.

@Felalolf
Copy link
Contributor Author

@mschwerhoff I do not know who usually reviews silver PRs, so for now I just added you as a reviewer.

@Aurel300
Copy link
Member

@Felalolf @mschwerhoff What is the status of this? Can this make it for the July release?

Copy link
Contributor

@mschwerhoff mschwerhoff left a comment

Choose a reason for hiding this comment

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

I don't have time for a thorough review, but stumbled over a few things:

  • The formatting of method and class signatures doesn't seem consistent, if it spans multiple lines: indentation, and whether or not the opening/closing parentheses are on the same line as the first/last parameter
  • I saw what looked like a depth-first search, and we already have
    def dfs(block: Block[S, E], index: Int = 0): Int = {
    . Maybe factor out an unify?
  • I saw what looked like a stronges connected component algorithm, and we already have a library for that -
    libraryDependencies += "org.jgrapht" % "jgrapht-core" % "1.5.0", // Graphs
    - which is used to identify SCCs in function call graphs. Would be nice to reuse the former.
  • I didn't see any high-level description of the chopper. Would be great to have more documentation, to avoid creating another "type checker & resolver" that nobody except Uri understands ... who left a while ago.

However, if the majority feels adding the chopper to the next release is important, I won't object.

@Felalolf
Copy link
Contributor Author

@mschwerhoff I tried to make the formatting more consistent. Furthermore, I added a high-level description of the chopper. I do not think that I can just use the existing DFS algorithm because the chopper always computes additional information on top of the dfs traversal order. The strongly connected component algorithm can probably be replaced. However, I would first want to evaluate performance differences since my implementation should be rather optimized as it exploits details of the specific domain. Furthermore, such a refactoring would require quite some time that I do not have available right now.

Copy link
Contributor

@marcoeilers marcoeilers left a comment

Choose a reason for hiding this comment

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

LGTM, just added some comments/questions about the documentation.

@Felalolf Felalolf merged commit e541c76 into master Jul 25, 2022
@jcp19 jcp19 deleted the chopper branch July 25, 2022 17:33
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.

5 participants