For a number of reasons which are generally summed up by this issue, I often need to work with both egglog::EGraphs and egraph_serialize::EGraphs. It would be great to have an API-supported, stable way of translating between Values in an EGraph and EClass IDs in a serialized EGraph. As @saulshanabrook pointed out to me, it seems like the process of serialization uses a Value's index into the hashcons to generate its corresponding EClass ID, so that's a hacky way of going back and forth:
https://github.com/egraphs-good/egglog/blob/0da32092999b558486b521b5a106a523d032ffd4/src/serialize.rs#L104-L105
However, it would give me peace of mind to have a way of doing this that's library-supported!
For a number of reasons which are generally summed up by this issue, I often need to work with both
egglog::EGraph
s andegraph_serialize::EGraph
s. It would be great to have an API-supported, stable way of translating between Values in an EGraph and EClass IDs in a serialized EGraph. As @saulshanabrook pointed out to me, it seems like the process of serialization uses a Value's index into the hashcons to generate its corresponding EClass ID, so that's a hacky way of going back and forth: https://github.com/egraphs-good/egglog/blob/0da32092999b558486b521b5a106a523d032ffd4/src/serialize.rs#L104-L105However, it would give me peace of mind to have a way of doing this that's library-supported!
Thanks all!