-
Notifications
You must be signed in to change notification settings - Fork 34
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
Avoiding double QI across (pop) #702
Comments
It does this for assertions that are directly asserted on the Viper-level, but not for intermediate assertions that come up durng symbolic execution (those aren't assumed after being asserted).
Yes, interesting idea, we should definitely try that out.
Huh, I didn't know that. Is this documented somewhere or did you read the code? |
Neither. I just noticed from some stack traces of Z3 that the solver performs simplifications while parsing, so I think that it's at that point that the early quantifications are triggered. The proposed modification of the encoding doesn't help if QI is not the bottleneck. For example, I don't see any benefit when applying it on the first SMT file shown below. Version 1 takes 62s and version 2 (with the modified encoding) takes 54s. The number of reported QI in the second version is indeed half (30000 instead of 60000), but that's not enough to cut the verification time in half. Interestingly, increasing the complexity of the formula in the quantifier seems to increase the difference in the verification time between the two versions. SMT filesVersion 1:
Version 2:
StatisticsStats version 1 (on a different run):
Stats version 2 (on a different run):
|
Here is an hand-crafted example where QI seems to be the true bottleneck. In this case, the modified encoding takes 44% less time. Version 1: 45s
Version 2: 25s, or 44% time less
|
@marcoeilers Does Silicon encode
assert <expr>; ...
to some SMT2 where<expr>
is repeated twice, with a pop in between?If so, I suspect that the following can be more efficient for QI-heavy programs, up to 2 times faster in the best case, because quantifiers that match on
<expr>
should just be instantiated once before the push instead of twice across the pop. This because (as far as I understand) Z3's parser performs the "early" instantiations even before reaching a check-sat. (Orthogonally, for non-trivial<expr>
the SMT2 code gets a bit shorter and the parser has to work a bit less.)The text was updated successfully, but these errors were encountered: