Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cached_ids not implemented? #69

Closed
MrVPlusOne opened this issue Aug 28, 2021 · 7 comments
Closed

cached_ids not implemented? #69

MrVPlusOne opened this issue Aug 28, 2021 · 7 comments

Comments

@MrVPlusOne
Copy link
Contributor

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!

@0x0f0f0f
Copy link
Member

I got stuck there and never got the cache to work. Have to revisit it completely. It should improve search performance significantly

@0x0f0f0f
Copy link
Member

@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.

@0x0f0f0f
Copy link
Member

0x0f0f0f commented Sep 12, 2021

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

@0x0f0f0f
Copy link
Member

0x0f0f0f commented Sep 12, 2021

Same happens if the pattern is a ground term (no variables). So it can only reside in a single eclass.

@0x0f0f0f
Copy link
Member

Any ideas on this one?

@MrVPlusOne
Copy link
Contributor Author

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!

@0x0f0f0f
Copy link
Member

Implemented in #177

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants