Constant Folding
Closed this issue · 4 comments
bedeio commented
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.
IanBriggs commented
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.
bedeio commented
Very cool, just what I was looking for.
Shall I close this?
mwillsey commented
Let's keep it open until we merge Ian's solution