Skip to content

Correctly handle SMT solver errors in loop acceleration code #5948

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

Merged
merged 1 commit into from
Mar 22, 2021

Conversation

SaswatPadhi
Copy link
Contributor

@SaswatPadhi SaswatPadhi commented Mar 17, 2021

Related to #5944 and #5947.

This PR correctly handles SMT solver failures in loop acceleration routines. Earlier these errors were silently ignored, and were being treated as UNSAT.

  • Each commit message has a non-empty body, explaining why the change was made.
  • Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • NA The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • NA My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • NA White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@SaswatPadhi SaswatPadhi changed the title Acceleration smt fix Correctly handle SMT solver errors in loop acceleration code Mar 17, 2021
@feliperodri feliperodri added aws Bugs or features of importance to AWS CBMC users bugfix labels Mar 17, 2021
@SaswatPadhi SaswatPadhi marked this pull request as draft March 17, 2021 16:33
@SaswatPadhi SaswatPadhi force-pushed the acceleration_smt_fix branch from 72c0f7d to 7f7806b Compare March 17, 2021 18:02
@SaswatPadhi
Copy link
Contributor Author

Build failures would be resolved after fa657ac is merged.

@SaswatPadhi SaswatPadhi marked this pull request as ready for review March 17, 2021 18:04
@SaswatPadhi SaswatPadhi force-pushed the acceleration_smt_fix branch from 7f7806b to 1c941a8 Compare March 17, 2021 18:51
@codecov
Copy link

codecov bot commented Mar 17, 2021

Codecov Report

Merging #5948 (449cab0) into develop (867168c) will increase coverage by 0.77%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #5948      +/-   ##
===========================================
+ Coverage    74.24%   75.01%   +0.77%     
===========================================
  Files         1431     1431              
  Lines       155290   155281       -9     
===========================================
+ Hits        115290   116485    +1195     
+ Misses       40000    38796    -1204     
Impacted Files Coverage Δ
src/ansi-c/ansi_c_declaration.h 95.06% <0.00%> (-2.72%) ⬇️
src/goto-instrument/accelerate/scratch_program.cpp 65.95% <0.00%> (-1.46%) ⬇️
src/ansi-c/c_typecheck_base.cpp 78.23% <0.00%> (-0.87%) ⬇️
src/ansi-c/expr2c.cpp 68.62% <0.00%> (-0.15%) ⬇️
src/ansi-c/c_typecheck_expr.cpp 75.29% <0.00%> (-0.15%) ⬇️
src/ansi-c/parser.y 77.72% <0.00%> (-0.05%) ⬇️
src/ansi-c/c_typecheck_base.h 100.00% <0.00%> (ø)
src/ansi-c/ansi_c_convert_type.h 100.00% <0.00%> (ø)
src/ansi-c/parser_static.inc 96.58% <0.00%> (+0.12%) ⬆️
src/ansi-c/c_typecheck_code.cpp 77.91% <0.00%> (+0.28%) ⬆️
... and 27 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update efc313d...449cab0. Read the comment docs.

@SaswatPadhi SaswatPadhi force-pushed the acceleration_smt_fix branch from 1c941a8 to 760bfc1 Compare March 21, 2021 23:57
@SaswatPadhi
Copy link
Contributor Author

@kroening @thomasspriggs I have addressed your comments now. Could you please take another look?

Thanks.

@SaswatPadhi SaswatPadhi force-pushed the acceleration_smt_fix branch from 760bfc1 to c0b731c Compare March 22, 2021 16:26
`check_sat` in scratch_programt was treating UNSAT and ERROR as the same. This was causing SMT solver errors to be silently ignored, and be treated as UNSAT results instead.
@SaswatPadhi SaswatPadhi force-pushed the acceleration_smt_fix branch from c0b731c to 449cab0 Compare March 22, 2021 16:28
switch((*checker)())
{
case decision_proceduret::resultt::D_ERROR:
throw "error running the SMT solver";
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a structure exception you could throw instead of a raw string?

@feliperodri feliperodri merged commit 8cfcfdb into diffblue:develop Mar 22, 2021
@SaswatPadhi SaswatPadhi deleted the acceleration_smt_fix branch March 22, 2021 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aws Bugs or features of importance to AWS CBMC users bugfix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants