-
Notifications
You must be signed in to change notification settings - Fork 54
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
Auto Demand Rewrite Conditions #387
Comments
The fact that you have to manually demand rule conditions came up as a confusion on the Zulip recently: https://egraphs.zulipchat.com/#narrow/stream/375765-egg.2Fegglog/topic/Simple.20simplification.20with.20conditionals.2E/near/451613621 |
I'm certain that auto-demanding every rewrite would cause performance problems in eggcc. |
We may want explicit syntax for some of this, see !/? in this paper |
This proposal does not handle |
Here is a concrete example of @yihozhang's point:
In this case we can't demand the conditions because |
One thing I find myself often doing is having to "demand" the values I am conditioning against in rewrite rule. For example, you can see the manual version of this in the matrix example:
In order to match on the conditional, we first must add
nrows
andncols
to the graph.I was thinking, what if we made this automatic when desugarring a rewrite with equality conditions? This could be done by adding another rule that matches on the left hand side of the rewrite and adds all expressions that are part of equality conditions in the actions of that rule.
For example, currently, the rewrite above desugars to something like:
What if it also added this rule when desugarring:
Do you think this would ever be a problem to automatically introduce these extra demand rules? (I mean in examples we know about, not in the abstract). It could also be behind a rewrite flag to turn it on or off...
EDIT: Keeping track of every time this comes up
The text was updated successfully, but these errors were encountered: