You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to also make the variant a variable in egglog? For example:
(datatype Shape
(Shape2D i64i64)
)
(datatype MatrixOp
(Matrix String Shape) ; (<name> <nrows> <ncols>)
(MatrixTranspose MatrixOp Shape)
)
(let ma (Matrix "a" (Shape2D 510)))
(let mb (Matrix "b" (Shape2D 1015)))
(let mc (Matrix "c" (Shape2D 152)))
(function shape-of (MatrixOp) Shape)
(rewrite
(shape-of (?variant ?op ?s)) ; notice here the variant does is also a variable
?s
)
I'm sure there is no support for exactly what I wrote above. But is there any construct within egglog that can achieve the same goal: 1 rewrite rule can apply to many variants of a datatype?
The text was updated successfully, but these errors were encountered:
Not exactly, but the solution I would recommend would be to rewrite those variants into different constructors of the same type... Like for this example:
If you want to keep the alternative construct you have above, you could also do that, but just rewrite it to this form so that you can apply the rewrite uniformly.
Is it possible to also make the variant a variable in egglog? For example:
I'm sure there is no support for exactly what I wrote above. But is there any construct within egglog that can achieve the same goal: 1 rewrite rule can apply to many variants of a datatype?
The text was updated successfully, but these errors were encountered: