Report quantifier instantiations#587
Merged
Merged
Conversation
Member
|
A longer-term goal perhaps, but it would be great if we could show this visually in the IDE, e.g. by colouring heavily instantiated quantifiers more red? |
mschwerhoff
approved these changes
Jan 20, 2022
mschwerhoff
left a comment
Contributor
There was a problem hiding this comment.
Looks good, thank you
Member
Author
|
@bobismijnnaam this is the feature. We could try it on your programs during the hackathon, if you wish. |
|
Is the "--numberOfParallelVerifiers 1" option mandatory? I tried it without this flag and the output seemed sensible. The number don't have to be exact, as long as they're proportional. |
Member
Author
|
Without |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR makes Silicon recognize and log Z3's quantifier instantiation reports instead of crashing.
When
smt.qi.profileistrue, Z3 periodically reports to stdout a summary of the instantiations of each quantifier. The report is printed at least eachsmt.qi.profile_freq=<n>instantiations and its format is described here. It's not as precise and detailed as the axiom profiler, but it's much quicker to obtain and easier to interpret.How to report quantifier instantiations
Run Silicon with
./silicon.sh --numberOfParallelVerifiers 1 --z3Args '"smt.qi.profile=true smt.qi.profile_freq=10000"' prog.vpr. The output will look like the following:From the reported quantifier instantiations we can see that the quantifier at line 736 has been instantiated 5906 times, reaching the maximum instantiation depth 9 and cost 10. So, it's a pretty good suspect when looking for matching loops.
Indeed, the quantifier on line 736 had a clear matching loop. After fixing it:
Additionally, running Silicon multiple times with
--z3RandomizeSeedsgives an idea of how stable the quantifier instantiations are.