Skip to content

Chopper#589

Merged
Felalolf merged 11 commits into
masterfrom
chopper
Jul 25, 2022
Merged

Chopper#589
Felalolf merged 11 commits into
masterfrom
chopper

Conversation

@Felalolf

@Felalolf Felalolf commented Jun 29, 2022

Copy link
Copy Markdown
Contributor

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

@Felalolf Felalolf requested a review from mschwerhoff June 30, 2022 08:28
@Felalolf

Copy link
Copy Markdown
Contributor Author

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

Comment thread src/main/scala/viper/silver/ast/utility/Chopper.scala
@Aurel300

Copy link
Copy Markdown
Member

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

@mschwerhoff mschwerhoff left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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.

@Felalolf Felalolf requested a review from marcoeilers July 22, 2022 14:06

@marcoeilers marcoeilers left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread src/main/scala/viper/silver/ast/utility/Chopper.scala Outdated
Comment thread src/main/scala/viper/silver/ast/utility/Chopper.scala Outdated
Comment thread src/main/scala/viper/silver/ast/utility/Chopper.scala
Comment thread src/main/scala/viper/silver/ast/utility/Chopper.scala
Comment thread src/main/scala/viper/silver/ast/utility/Chopper.scala Outdated
Comment thread src/main/scala/viper/silver/ast/utility/Chopper.scala
Comment thread src/main/scala/viper/silver/ast/utility/Chopper.scala Outdated
@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