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

Explore the "zero problem"; cut down on constants #23

Open
ninehusky opened this issue Oct 26, 2024 · 1 comment
Open

Explore the "zero problem"; cut down on constants #23

ninehusky opened this issue Oct 26, 2024 · 1 comment

Comments

@ninehusky
Copy link
Owner

I'm referring to the problem of adding constants like zero into the egraph. Once we add zero along with other constants, we derive lots of non-helpful rules like: (a + 1 + 1) ~> (a + 2). Once we reach a large enough size, we need a way of not putting terms into the egraph of that form. This will also cut down on the number of eclasses.

In a way, we want e-classes to be "general"; they should represent the shape of some computation rather than some concrete value. For example, an example like (a + b) is far more valuable than (a + 1 + 1 + 2 + 3 + 4).

@ninehusky
Copy link
Owner Author

Now that we have conditions, it might be worth it to remove constants from being generated entirely. You can encode something like (a * 2) ~> (a + a) with if b = 2 then (a * b) ~> (a + a). This cuts down on the number of terms we need to enumerate.

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

No branches or pull requests

1 participant