Skip to content

Refinement of guard based on antecedent of implication statement #6434

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

Conversation

NlightNFotis
Copy link
Contributor

This PR contains a bug fix isolated from #6399, which allows the guard for checks performed
in an implication statement to be refined based on the antecedent part of the statement.

There may be further refactorings/tests added to this PR, so this is a draft for now.

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

@codecov
Copy link

codecov bot commented Nov 3, 2021

Codecov Report

Merging #6434 (e85fa85) into develop (a987c67) will increase coverage by 0.00%.
The diff coverage is 100.00%.

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

@@           Coverage Diff            @@
##           develop    #6434   +/-   ##
========================================
  Coverage    76.00%   76.01%           
========================================
  Files         1527     1527           
  Lines       164463   164464    +1     
========================================
+ Hits        125008   125012    +4     
+ Misses       39455    39452    -3     
Impacted Files Coverage Δ
src/analyses/goto_check.cpp 88.78% <100.00%> (+0.31%) ⬆️
src/ansi-c/scanner.l 61.75% <0.00%> (ø)

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 b002121...4c40cd0. Read the comment docs.

Copy link
Collaborator

@martin-cs martin-cs left a comment

Choose a reason for hiding this comment

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

Thank you!

…her in `goto_check`.

That allows the `guard` expression to be properly instantiated based on the antecedent
expression of the implication statement instead of it inheriting a `true_exprt` as
a `guard`.

This allows checks that are constrained by an expression in the antecedent, such
as pointer checks in the consequent of an implication inside a `__CPROVER_forall`
statement to be correctly bound and checked.
…efinement.

Before this change the division-by-zero check would fail because the antecedent
part of the implication statement wouldn't be used to refine the guard of any
checks performed in the consequent part of the statement.
@NlightNFotis NlightNFotis force-pushed the implication_statement_checks branch from f0ad808 to e85fa85 Compare November 5, 2021 10:32
…ical_op` can handle.

It should only handle `and`, `or` or `==>`.
@NlightNFotis NlightNFotis force-pushed the implication_statement_checks branch from e85fa85 to 4c40cd0 Compare November 5, 2021 10:33
@NlightNFotis NlightNFotis marked this pull request as ready for review November 5, 2021 11:41
@NlightNFotis NlightNFotis merged commit 74963e7 into diffblue:develop Nov 5, 2021
@NlightNFotis NlightNFotis deleted the implication_statement_checks branch November 5, 2021 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants