Skip to content

Remove preprocessing of CProverString.insert for non-String arguments #5035

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

Conversation

romainbrenguier
Copy link
Contributor

@romainbrenguier romainbrenguier commented Aug 19, 2019

We replace the preprocessing of CProverString.insert for characters, booleans etc. and provide models that use String.valueOf and the String version of CProverString.insert instead.
This is too reduce the number of builtin functions the solver has too handle, making it simpler and easier too debug and test, and less likely to have bugs, without reducing its expressive power: we can still get the same behavior as before by combining two function calls.

  • Each commit message has a non-empty body, explaining why the change was made.
  • [na] Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • 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.
  • White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@romainbrenguier romainbrenguier force-pushed the clean-up/constraint-generation branch 2 times, most recently from 1d5dedc to 8c302fa Compare August 19, 2019 09:30
@romainbrenguier romainbrenguier force-pushed the clean-up/constraint-generation branch 2 times, most recently from bc2e893 to 0d71098 Compare August 19, 2019 11:44
@codecov-io
Copy link

codecov-io commented Aug 19, 2019

Codecov Report

Merging #5035 into develop will increase coverage by 0.01%.
The diff coverage is 0%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #5035      +/-   ##
===========================================
+ Coverage    69.53%   69.54%   +0.01%     
===========================================
  Files         1314     1314              
  Lines       108988   108921      -67     
===========================================
- Hits         75786    75751      -35     
+ Misses       33202    33170      -32
Impacted Files Coverage Δ
...c/java_bytecode/java_string_library_preprocess.cpp 96.83% <ø> (-0.06%) ⬇️
...lvers/strings/string_constraint_generator_main.cpp 84.44% <ø> (+1.11%) ⬆️
src/solvers/strings/string_constraint_generator.h 100% <ø> (ø) ⬆️
...ers/strings/string_constraint_generator_insert.cpp 81.08% <0%> (+23.24%) ⬆️

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 153a4b9...2402773. Read the comment docs.

Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

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

✔️
Passed Diffblue compatibility checks (cbmc commit: 0d71098).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/123717057

@romainbrenguier romainbrenguier force-pushed the clean-up/constraint-generation branch from 0d71098 to 3152f67 Compare August 20, 2019 08:02
Use it instead of CProverString.insert because we want to get rid of
this builtin solver function and use a model of StringBuilder.insert instead.
Only the CProverString.insert(int, String) is requiered. The others can
be implemented in Java using calls to that one and String.valueOf.
These can no longer be produced by the java preprocessing, we can thus
drop the functions that where handling it.
No preprocessing of Java methods produce a call to cprover_string_insert
with 7 arguments so this case should be unused.
@romainbrenguier romainbrenguier force-pushed the clean-up/constraint-generation branch from 3152f67 to ea21cca Compare August 20, 2019 17:48
Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

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

⚠️
This PR failed Diffblue compatibility checks (cbmc commit: ea21cca).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/123947553
Status will be re-evaluated on next push.
Common spurious failures include: the cbmc commit has disappeared in the mean time (e.g. in a force-push); the author is not in the list of contributors (e.g. first-time contributors); compatibility was already broken by an earlier merge.

@romainbrenguier romainbrenguier removed the Needs TG approval 🦉 Only merge with explicit approval from test-gen maintainers label Aug 21, 2019
@romainbrenguier
Copy link
Contributor Author

the corresponding test-gen pull request passed CI https://github.com/diffblue/test-gen/pull/3806

@romainbrenguier
Copy link
Contributor Author

java-models-library update now pointing to master

@romainbrenguier romainbrenguier merged commit adf685f into diffblue:develop Aug 21, 2019
Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

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

✔️
Passed Diffblue compatibility checks (cbmc commit: 2402773).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/124071536

@romainbrenguier romainbrenguier deleted the clean-up/constraint-generation branch August 21, 2019 15:06
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.

6 participants