Purpose of bidirectional rewrite! #222
Answered
by
mwillsey
silversquirl
asked this question in
Q&A
Replies: 1 comment
-
egg will not apply a unidirectional rewrite in both directions. However,
the equivalences found by a rewrite (uni- or bi-directional) are
bidirectional. For example, if your e-graph contains only `x + x` and you
run the rewrite `2 * x => x + x`, nothing will happen. However if both `x +
x` and `2 * x` were in the e-graph to begin with, then it would fire.
…On Tue, Dec 13, 2022 at 5:36 PM Silver ***@***.***> wrote:
rewrite! has a bidirectional variant: rewrite!("name"; "pattern" <=>
"subst")
However, egg will happily apply a regular unidirectional rule in reverse.
What is the purpose of the bidirectional form of rewrite!?
—
Reply to this email directly, view it on GitHub
<#222>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANTPTCMR2OAC4645R6ZR5DWNEQDLANCNFSM6AAAAAAS53Z5HM>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
silversquirl
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
rewrite!
has a bidirectional variant:rewrite!("name"; "pattern" <=> "subst")
However, egg will happily apply a regular unidirectional rule in reverse. What is the purpose of the bidirectional form of
rewrite!
?Beta Was this translation helpful? Give feedback.
All reactions