-
Notifications
You must be signed in to change notification settings - Fork 273
Allow simplification of singleton interval. #7761
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
NlightNFotis
merged 4 commits into
diffblue:develop
from
NlightNFotis:simplify_interval_domain
Jun 22, 2023
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
ff0b9f6
Allow simplification of singleton interval.
NlightNFotis 8e82b4d
Fix recognition of quantifier bounds in case of previous simplificati…
NlightNFotis c5c8e62
Add regression tests for simplification of singleton intervals
NlightNFotis de8b169
Simplify handling of expression matching and clarify comment in else …
NlightNFotis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
regression/cbmc/simplify_singleton_interval_7690/negative_test.desc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
CORE | ||
--trace | ||
singleton_interval_simp_neg.c | ||
^VERIFICATION FAILED$ | ||
^\[main\.assertion\.1\] line \d expected failure: paths where x is unbounded explored: FAILURE$ | ||
^\[main\.assertion\.2\] line \d+ expected failure: paths where 0 \<= x \<= 15 explored: FAILURE$ | ||
^\[main\.assertion\.3\] line \d+ expected success: paths where x \<= 15 explored: SUCCESS$ | ||
y=-6 \(11111111 11111111 11111111 11111010\) | ||
x=14 \(00000000 00000000 00000000 00001110\) | ||
y=34 \(00000000 00000000 00000000 00100010\) | ||
^EXIT=10$ | ||
^SIGNAL=0$ | ||
-- | ||
-- | ||
This tests the negative case of the simplification of the singleton interval | ||
(i.e when the presented interval *is* the *not* the singleton interval - | ||
the set of possible values that the bounded variable can take has cardinality | ||
> 1). |
14 changes: 14 additions & 0 deletions
14
regression/cbmc/simplify_singleton_interval_7690/positive_test.desc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
CORE | ||
--trace | ||
singleton_interval_simp.c | ||
^VERIFICATION FAILED$ | ||
^\[main\.assertion\.1\] line \d+ expected failure: only paths where x == 15 explored: FAILURE$ | ||
^\[main\.assertion\.2\] line \d+ expected failure: only paths where x == 15 explored: FAILURE$ | ||
x=15 \(00000000 00000000 00000000 00001111\) | ||
y=35 \(00000000 00000000 00000000 00100011\) | ||
^EXIT=10$ | ||
^SIGNAL=0$ | ||
-- | ||
-- | ||
This tests the positive case of the simplification of the singleton interval | ||
(i.e when the presented interval *is* the singleton interval) |
17 changes: 17 additions & 0 deletions
17
regression/cbmc/simplify_singleton_interval_7690/singleton_interval_simp.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Positive test for singleton interval simplification. | ||
// Notice that the sequence of the inequalities in this | ||
// expression is different to the one in | ||
// `singleton_interval_in_assume_7690.c`. | ||
|
||
int main() | ||
{ | ||
int x; | ||
__CPROVER_assume(x >= 15 && x <= 15); | ||
int y = x + 20; | ||
|
||
__CPROVER_assert( | ||
y != 35, "expected failure: only paths where x == 15 explored"); | ||
__CPROVER_assert( | ||
y == 34, "expected failure: only paths where x == 15 explored"); | ||
return 0; | ||
} |
18 changes: 18 additions & 0 deletions
18
regression/cbmc/simplify_singleton_interval_7690/singleton_interval_simp_neg.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Negative test for singleton interval simplification. | ||
|
||
int main() | ||
{ | ||
int x; | ||
int y = x + 20; | ||
|
||
__CPROVER_assert( | ||
y != -6, "expected failure: paths where x is unbounded explored"); | ||
|
||
__CPROVER_assume(x >= 0 && x <= 15); | ||
__CPROVER_assert( | ||
y != 34, "expected failure: paths where 0 <= x <= 15 explored"); | ||
|
||
int z = x + 20; | ||
__CPROVER_assert(z != 36, "expected success: paths where x <= 15 explored"); | ||
return 0; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
⛏️ The commit message looks split between title and body...