egraphs-good/snake-egg

Constant Folding

Closed this issue · 4 comments

Any plans to allow for constant folding or the definition of other types of analyses from Python?

Happy to contribute, but for a full PR think I would need some guidance.

I've done some constant folding with snake egg on my branch here.
When creating the egraph on the python side you can hand it an eval function.
This eval function takes in an operator and a argument list then returns a value if constant folding can occur, and None if it cannot.

My project using this has the snake_egg related files in here.

I can make a PR, but it may take a bit.

Very cool, just what I was looking for.

Shall I close this?

Let's keep it open until we merge Ian's solution

Closed by #3.