-
Notifications
You must be signed in to change notification settings - Fork 21
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
Custom rewrites #74
Custom rewrites #74
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I have some small comments, and there's definitely room for enhancements in the future.
Maybe something to consider as well is to do a check for the semantics of the lhs and rhs when you build the new rule. Since we are not considering bang-boxes or any fancy logic we just have to calculate the matrix of the lhs and of the rhs and see if they are equal, and we can warn the user if they are trying to create a rewrite rule that doesn't preserve semantics.
We could even use this to automatically find the right scalar factor to scale the graph by when you do the graph replacement.
@jvdwetering I believe I have addressed all of your comments now. Let me know if there is anything else to do for this PR. |
Yes this all looks good, and in any case we can still add stuff to it later of course. |
This PR contains preliminary implementation of custom rewrites. Currently, the rewrites only work with exact phases but we can add support for more general types of phases in the future.