-
Notifications
You must be signed in to change notification settings - Fork 275
Add array trace printing to incremental SMT2 decision procedure #7078
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
Add array trace printing to incremental SMT2 decision procedure #7078
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #7078 +/- ##
===========================================
+ Coverage 77.85% 77.87% +0.01%
===========================================
Files 1574 1574
Lines 181245 181392 +147
===========================================
+ Hits 141109 141252 +143
- Misses 40136 40140 +4
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
df6f4d6
to
6b9cf96
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we please have some unit tests for the error conditions both for the map and for arrays? I can think of the following that may not be tested:
- Identifier type in map is different to type in parse tree
- Identifier not in the map
- Multiple instances of the identifier in the map (with different same/types?) -- Does it matter if there is duplication and the types are the same?
- Array size wrong or unspecified
- Multiple responses from the solver
- Error in parsing sub-expression of select (e.g. index is good but value has wrong type?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
So that the sort of identifiers can be used for further validation.
src/solvers/smt2_incremental/smt2_incremental_decision_procedure.cpp
So that the value of the index can be fetched when building traces based on requesting the index identifier.
So that writes to arrays can be shown in traces.
6b9cf96
to
076e040
Compare
Identifiers in the parse tree do not have types(sorts). This is the whole reason the identifier map is needed for the validation. Therefore the sorts in the map cannot mismatch the (missing) sorts in the parse tree.
Added.
The identifier is used as the key in the unordered map. Therefore the same one cannot be inserted twice.
Is this the check on
Which part of this PR does this comment apply to? Extra unrequested responses from the solver could be a potential issue for any part of the new back end which is fetching responses from the solver. Extra responses would not be fetched until the decision procedure issues another command expecting a response. At which point the buffered response will be fetched and the subsequent validation will fail due to the response being of a different nature from that expected.
The parser isn't special cased for select. Is this referring to |
076e040
to
787b3c1
Compare
I notice there are (now) unit tests for trying to parse SMT output that is invalid, but I was thinking here of unit tests for mismatches. E.g., trying to parse the value of an identifier which is in the map as a
For some reason I had in mind this was using a map that supports multiple values... my mistake.
Looks like it's covered. Other cases I can think of would be catching errors in different parts of the code (e.g. somehow we had the wrong size somewhere), but this would be overly defensive.
My text here was utterly incomplete - sorry. Your comment addresses some of the possible scenarios - the one I had in mind was whether it is possible for any of the information to change between calls to the solver to solve/get_value in a way that might cause issues? On deeper thought I suspect the answer is that due to the SSA/symex/etc. this is not possible, so we can be confident in the implementation here.
This seems to be addressed now? I did notice that we at times optimistically continue once one error may have been detected (e.g. |
d76d010
to
0f7b21c
Compare
This PR includes the functionality from #7066 , but with the additional fixes required to support traces where individual elements of an array are written to.