Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Empty E-Classes #11

Open
saulshanabrook opened this issue Apr 26, 2024 · 0 comments
Open

Support Empty E-Classes #11

saulshanabrook opened this issue Apr 26, 2024 · 0 comments

Comments

@saulshanabrook
Copy link
Member

Currently, e-graphs with empty e-classes cannot be referred to as children in the serialization format.

This is problematic when trying to serialize some edge cases from egglog, that were brought up by @oflatt in egraphs-good/egglog#368, namely:

  1. Using delete to create an empty e-class (example).
  2. Serializing a large e-graph with the max parameters set so that some e-nodes are stripped out to make a more manageable size graph.

There are a few ways we discussed resolving this:

  1. Allowing each child in the children vec to be optional.
  2. Changing the op itself to be optional.

With option 1, you just point to a null node ID if you are looking to represent an e-class that is empty. In option 2, you would point to a node in that e-class that has a null op.

The advantage of option 2 is that you can still represent the e-class. So if two nodes point to the same null e-class that is shown in the serialized format, while in option one, they will both just be null and that won't be clear.

Similarily, with option 2, you can still represent the typ of the empty e-class, because it will have an ID, while in option 1, you can't.

Either way, we should also support this when converting to graphviz. One way to do that might be to make an actual node within a cluster for the empty one, but just make it invisible or small. So you can still see the e-class and the arrows pointing to it, but there is no node inside.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant