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

Use ordered set to track declared macros, avoid double-declarations #807

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

marcoeilers
Copy link
Contributor

No description provided.

Comment on lines +429 to +432
for (m <- macros) {
if (!_declaredFreshMacros.contains(m))
prover.declare(m)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am bit afraid that using InsertionOrderedSet may hurt performance quite a lot. From what I gathered, this data structure is very inneficient and this may hurt us if the lists are very big.

I wonder if we really are making use of the fact that _declaredFreshMacros only stores once each value. If that is not necessary, could we keep the implementation using a vector and keep this check? ((!_declaredFreshMacros.contains(m)))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure the Vectors will do much better; checking many times if a vector contains a specific value isn't going to be efficient either, right. We just need a good InsertionOrderedSet implementation. But I made a PR for now to just add perform the check.

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

Successfully merging this pull request may close these issues.

2 participants