-
Notifications
You must be signed in to change notification settings - Fork 82
Unsound congruence domain arithmetic #1587
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
Changes from 5 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
dfaf8a9
Add creduce script for both branches dead
sim642 36525a9
Add reduced congruence both branches dead test
sim642 2fc8d3f
Merge branch 'master' into congruence-hardness-unsound-branches
jerhard 74f3649
Congruence sub: handle treatment of sub by computing congruence class…
jerhard 5f1b020
Congruence bug in subtraction: Fix testcase such that it still catche…
jerhard 98977b1
CongruenceDomain.sub: Handle case when second operand of subtraction …
jerhard 829b2bd
CongruenceDomain: Implement sub idependently of add.
jerhard d181989
Merge branch 'master' into congruence-hardness-unsound-branches
jerhard 96bb532
Add test case for unreached fixpoint due to bug in congruences showin…
jerhard 958b827
Add test for sub operation for congruence.
jerhard b84844b
CongruenceDomain.sub: Handle case precisely where two signed numbers …
jerhard f947dcc
Add unknown annotation to assert in test case.
jerhard 7a3d072
Add comment to test that assert was required to expose fixpoint error.
jerhard 3c27e68
Congruences: Add testing for overflow in subtraction where result it …
jerhard a1963da
Congruencedomain.sub: Check also for upper bound overflow for signed
jerhard 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
gcc -c -Werror=implicit-function-declaration ./bad.c | ||
|
||
GOBLINTDIR="/home/simmo/dev/goblint/sv-comp/goblint" | ||
OPTS="--conf $GOBLINTDIR/conf/svcomp.json --set ana.specification $GOBLINTDIR/../sv-benchmarks/c/properties/unreach-call.prp bad.c --enable pre.enabled" | ||
LOG="goblint.log" | ||
|
||
$GOBLINTDIR/goblint $OPTS -v &> $LOG | ||
|
||
grep -F "Both branches dead" $LOG |
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
21 changes: 21 additions & 0 deletions
21
tests/regression/37-congruence/15-congruence-hardness-unsound-branches.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,21 @@ | ||
// PARAM: --enable ana.int.congruence --enable ana.int.interval | ||
// reduced (via creduce and manually) from sv-benchmarks/c/hardness-nfm22/hardness_codestructure_dependencies_file-70.c | ||
|
||
#include <goblint.h> | ||
|
||
main() { | ||
int a; | ||
unsigned c = 1; | ||
if (a) | ||
c = 4; | ||
|
||
// The following condition evaluated to "both branches dead", due to a bug in the congruence domain. | ||
// --- Even though the condition is true the concrete. | ||
if (c + (c + 2)) | ||
a = 1; | ||
|
||
// Check that this is reachable. | ||
// That is, check that not both branches of previous condition are dead. | ||
__goblint_check(1); | ||
return 0; | ||
} |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.