egraphs-good / egglog

egraphs + datalog!
https://egraphs-good.github.io/egglog/
MIT License
400 stars 45 forks source link

Refactor `print_function` to use a new function called `dump_function` #366

Closed gussmith23 closed 4 months ago

gussmith23 commented 4 months ago

On the Rust side, I would like to have access to the functions printed by print_function. @oflatt suggested a simple refactor, adding a dump_function function which dumps the Term objects, and then refactoring print_function to use dump_function. Then I can use dump_function to achieve my own goal.

Feel free to assign to me.

gussmith23 commented 4 months ago

Turns out this is actually done! EGraph::function_to_dag.

Opened an issue to document the function: #367

saulshanabrook commented 4 months ago

Oh cool! There is an open issue in the Python bindings to expose print function, but I wasn't sure if I could get at the data. Nice to know that it's possible https://github.com/egraphs-good/egglog-python/issues/124