-
Notifications
You must be signed in to change notification settings - Fork 54
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
Add serialization support #171
Conversation
/// Return the inner values and sorts. | ||
/// Only eq_container_sort need to implement this method, | ||
fn inner_values(&self, value: &Value) -> Vec<(&ArcSort, Value)> { | ||
let _ = value; | ||
vec![] | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this so that we can properly handle e-classes inside of collections. If we just use extract
(what I tried previously) then it will only give us a particular e-node from a collection, instead of referencing the full e-class. So instead provide a native way to traverse the inner values.
While there are definitely some benefits to snapshot testing, I'm not ready to commit to it with this PR. Can you please back it out for now? Otherwise the PR looks great! |
Thanks! Sure, I just removed the tests. |
This PR adds serialization support to the
egraph-serialize
format.It pulls some ideas and code from the viz pr (#147) around requirements for the serialization format.
I also started using the insta library for snapshot testing, to verify that certain examples are serialized properly. So far, I just tried to manually look over them to make sure they seem sensible.
Once the viz work is redone on top of this, it will also be easier to quickly verify the results.
The choice of how to determine the node IDs is not the most straightforward one, but conforms to certain properties that were useful for the graphviz work, which would use these directly (since in graphviz you can't actually point to a cluster, you have to point to nodes).
Link to some relevant convo on zulip around how to serialize.