Skip to content

Add self-referential nodes to egraph #240

Answered by mwillsey
silversquirl asked this question in Q&A
Discussion options

You must be logged in to vote

Yes! You cannot directly make a cycle, but you can do it with a union. Here is some (un-parsed) code to demonstrate:

let x = egraph.add(Leaf("x"));
let node = egraph.add(Node(x, x));
egraph.union(x, node);

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by silversquirl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants