Closed oflatt closed 6 months ago
I realized that the rules in this PR are not quite right I have an idea to fix it, marking as a draft for now.
The version I just pushed seems good There may be some saturation issues lingering when you try to substitute the same thing twice
Marked as ready- added another cyclic graph test
@rtjoa is right on both counts. New plan:
This PR adds new substitution rules that perform a substitution, copying all equalities to a new context. However, the main challenge is that cycles can occur when performing this copying. This PR solves the issue by detecting these cycles and unioning the two resulting contexts.
It can therefore copy over cycles to the new equivalent relation as well, and figure out when two contexts are equivalent due to cycles in the original egraph.