egraphs-good / egglog

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

Display bound variables in serialized e-graph #376

Open saulshanabrook opened 3 months ago

saulshanabrook commented 3 months ago

Currently variables created with let bindings don't show up in the e-graph. Previously, they had shown as constants unified with their values.

I believe @oflatt had suggested instead treating them like metadata on e-classes. Seems like a nice idea! So we could modify the e-class to somehow show all the labels at the top. There is a place in graphviz to add a cluster label. Previously I had added types to it, so we could use that instead for labels.

We would also have to modify the serialization format to store the labels.