Skip to content

Refactored parsing rules for function contracts #6195

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
Jun 23, 2021

Conversation

aalok-thakkar
Copy link

@aalok-thakkar aalok-thakkar commented Jun 22, 2021

The following four changes were made:

  1. cprover_contract renamed to cprover_function_contract.
  2. cprover_contract_sequence renamed to cprover_function_contract_sequence.
  3. cprover_contract_sequence_opt renamed to cprover_function_contract_sequence_opt.
  4. Refactored the assigns clause in cprover_function_contract by creating cprover_contract_assigns_opt.

This was done so we can reuse cprover_contract_assigns_opt for future use in Loop Contracts.

  • 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.
  • 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).
  • 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.

@SaswatPadhi SaswatPadhi added aws Bugs or features of importance to AWS CBMC users Code Contracts Function and loop contracts labels Jun 22, 2021
@codecov
Copy link

codecov bot commented Jun 22, 2021

Codecov Report

Merging #6195 (d242154) into develop (0002950) will increase coverage by 7.92%.
The diff coverage is n/a.

❗ Current head d242154 differs from pull request most recent head a2705f1. Consider uploading reports for the commit a2705f1 to get more accurate results
Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #6195      +/-   ##
===========================================
+ Coverage    67.40%   75.32%   +7.92%     
===========================================
  Files         1157     1456     +299     
  Lines        95236   161128   +65892     
===========================================
+ Hits         64197   121376   +57179     
- Misses       31039    39752    +8713     
Flag Coverage Δ
cproversmt2 ?
regression ?
unit ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/util/mathematical_expr.cpp 50.00% <0.00%> (-50.00%) ⬇️
src/util/string_container.cpp 52.94% <0.00%> (-47.06%) ⬇️
src/solvers/prop/prop.cpp 42.85% <0.00%> (-41.76%) ⬇️
src/solvers/flattening/boolbv_member.cpp 53.65% <0.00%> (-38.65%) ⬇️
src/cpp/cpp_storage_spec.cpp 65.00% <0.00%> (-35.00%) ⬇️
src/util/cmdline.h 66.66% <0.00%> (-33.34%) ⬇️
src/solvers/strings/array_pool.h 66.66% <0.00%> (-33.34%) ⬇️
src/solvers/strings/string_refinement.h 66.66% <0.00%> (-33.34%) ⬇️
...rs/strings/string_concatenation_builtin_function.h 0.00% <0.00%> (-33.34%) ⬇️
src/cbmc/c_test_input_generator.cpp 60.00% <0.00%> (-30.33%) ⬇️
... and 1435 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 b31f952...a2705f1. Read the comment docs.

@aalok-thakkar aalok-thakkar changed the title refactored cprover_contract to cprover_function_contract, and created… refactored cprover_contract Jun 22, 2021
@SaswatPadhi SaswatPadhi changed the title refactored cprover_contract Refactored parsing rules for function contracts Jun 22, 2021
@SaswatPadhi SaswatPadhi marked this pull request as ready for review June 22, 2021 23:39
@SaswatPadhi SaswatPadhi requested a review from feliperodri June 22, 2021 23:42
Copy link
Collaborator

@feliperodri feliperodri left a comment

Choose a reason for hiding this comment

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

Changes LGTM, but we should explain why they are necessary in the commit messages.

1. Renamed cprover_contract to cprover_function_contract.
2. Renamed cprover_contract_sequence to cprover_function_contract_sequence.
3. Renamed cprover_contract_sequence_opt to cprover_function_contract_sequence_opt.
4. Created cprover_contract_assigns_opt and added it to cprover_function_contract.

This allows us to reuse the assigns clause for loop contracts in the future.
@aalok-thakkar aalok-thakkar force-pushed the refactor-cprover-contract branch from d242154 to a2705f1 Compare June 23, 2021 17:54
@kroening kroening merged commit 3c62abb into diffblue:develop Jun 23, 2021
@SaswatPadhi SaswatPadhi deleted the refactor-cprover-contract branch June 23, 2021 19:01
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 Code Contracts Function and loop contracts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants