Metatheory.jl
Metatheory.jl copied to clipboard
`cached_ids` not implemented?
Hi,
I noticed that cached_ids in line 18 of search.jl is currently returning all the classes of the e-graph, and there is some code inside the body that got commented out. I'm currently trying to do some batch simplification for a program synthesis application and am experiencing very poor saturation performance, with the majority of the time spent on the "Search" part according to the report. So I'm wondering, could this be the main cause? If so, can this be fixed in the future?
Thanks!
I got stuck there and never got the cache to work. Have to revisit it completely. It should improve search performance significantly
@MrVPlusOne this is a very stupid optimization that I didn't consider. If the pattern to be searched is a literal, we just know where it is due to the egraph hashcons.
function cached_ids(g::EGraph, p::Pattern)# ::Vector{Int64}
collect(keys(g.classes))
end
function cached_ids(g::EGraph, p) # p is a literal
[lookup(g, ENodeLiteral(p))]
end
Same happens if the pattern is a ground term (no variables). So it can only reside in a single eclass.
Any ideas on this one?
I'm actually quite busy with my Ph.D. graduation lately, so I probably won't have the bandwidth to work on this. Feel free to close the issue if you have other plans for MetaTheory!
Implemented in #177