catgrad icon indicating copy to clipboard operation
catgrad copied to clipboard

e-graph dictionaries

Open chadbrewbaker opened this issue 2 years ago • 2 comments

It would be nice to have a more comprehensive dictionary of e-graph rules for FinOrd and combinatorial species.

My shelved PR for egg that needs dusted off and finished. I implemented most of the combinatorial species bijections from Brent Yorgey's papers and most FinOrd rules from Jr. High algebra. https://github.com/chadbrewbaker/egg/blob/finset/tests/finset.rs

Willsey's thesis has code for generating these equality saturation dictionaries: https://digital.lib.washington.edu/researchworks/bitstream/handle/1773/47423/Willsey_washington_0250E_22746.pdf?sequence=1

His Ruler code for generating equality saturation lists: https://github.com/uwplse/ruler

His equality saturation compiler for tensors https://github.com/uwplse/tensat

Great 217 line implementation of combinatorial species. My minds eye has an APL like intermediate language for functions over small finite sets you can lift into for automation. https://github.com/akc/spe/blob/master/Math/Spe.hs

chadbrewbaker avatar Dec 18 '23 17:12 chadbrewbaker

I haven't taken a look at the hypergraph implementation at all, but I did want to mention that I have been working on Python bindings for the egglog library, which is the successor to the egg library.

If you have any Qs about it happy to help in any way I can, I have been interested in trying out this sort of thing using it for a while, so it's exciting to see this library!

saulshanabrook avatar Dec 18 '23 21:12 saulshanabrook

I think it would be interesting to do an optimization step using egglog on the compiled reverse pass. I haven't implemented hypergraph rewriting yet, so I don't do it on the combinatorial structure. FYI, the actual datastructure code lives here: https://github.com/statusfailed/open-hypergraphs/ so might want to move this discussion there!

statusfailed avatar Dec 19 '23 11:12 statusfailed