-
Notifications
You must be signed in to change notification settings - Fork 84
Add option for manual restarting of globals #573
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 all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
4b7df8b
Add option for restarting unknowns belonging to global variables sele…
jerhard b7d195e
Add test for manual restarting
jerhard 37aefd6
Add test for manual restarting of globals when reads and writes occur…
jerhard 1e20f20
Change global_from_name to globals_from_names working on a list, remo…
jerhard c501575
Issue warning if both automatic and manual restarting are active inst…
jerhard f9d0124
Remove unnecessary debug printout
jerhard 253a44c
Add logic for destabilize_front, handling superstable to destabilize_…
jerhard 7fcc4b2
Reformat code for user-triggered global restarting
jerhard 83dab64
Collect varinfos instead of Cil.globals for manually restarted globals
jerhard 2e6f194
Reuse Printable.String instead of creating a new module for it
jerhard dd8cf51
Annotate that earlyglobs is reason for imprecision
jerhard e7d591e
Comment that check is a hack to determine whether unknown relates to …
jerhard f5ee094
Allow manual restarting of functions
jerhard 3589663
Add test case for manual restarting of function with partial contexts
jerhard 2e688a2
Fix json in diff so to restart function foo
jerhard ebb9b60
Change call to destabilize to destabilize_normal.
jerhard 2f98aa0
Manual restarting: check whether unkown is a leaf, and warn if it is …
jerhard 293ba9e
Add pretty printing of unknown in printout.
jerhard 6afc783
Manual global restarting: Warn about globals that should be restarted…
jerhard 2a1665b
Move contents from cilUtil to varQuery
jerhard 8268dc0
Move documentation comment to .mli file
jerhard ac4cb98
Rename option incremental.restart_globs.globs to incremental.restart.…
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| type t = | ||
| Global of Cil.varinfo | ||
| | Node of { node : Node.t; fundec : Cil.fundec option; } | ||
| val compare : t -> t -> int | ||
| type 'v f = 'v -> unit | ||
|
|
||
| (** Takes a [Cil.file] and a list of names of globals.contents | ||
| Returns a list of [VarQuery.t]s of globals whose [vname] is contained in the argument list, | ||
| and the list of names for which no global with the name could be found. *) | ||
| val varqueries_from_names : Cil.file -> string list -> t list * string list |
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
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
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
9 changes: 9 additions & 0 deletions
9
tests/incremental/04-manual-restart/01-restart_manual_simple.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,9 @@ | ||
| #include <assert.h> | ||
|
|
||
| int g = 4; | ||
|
|
||
| int main() { | ||
| int x = g; | ||
| assert(x == 4); | ||
| return 0; | ||
| } |
13 changes: 13 additions & 0 deletions
13
tests/incremental/04-manual-restart/01-restart_manual_simple.json
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 @@ | ||
| { | ||
| "exp": { | ||
| "earlyglobs": true | ||
| }, | ||
| "incremental": { | ||
| "restart": { | ||
| "sided": { | ||
| "enabled": false | ||
| }, | ||
| "list": [] | ||
| } | ||
| } | ||
| } |
29 changes: 29 additions & 0 deletions
29
tests/incremental/04-manual-restart/01-restart_manual_simple.patch
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,29 @@ | ||
| diff --git tests/incremental/04-manual-restart/01-restart_manual_simple.c tests/incremental/04-manual-restart/01-restart_manual_simple.c | ||
| index cbfb0ba70..aa83393ac 100644 | ||
| --- tests/incremental/04-manual-restart/01-restart_manual_simple.c | ||
| +++ tests/incremental/04-manual-restart/01-restart_manual_simple.c | ||
| @@ -1,9 +1,9 @@ | ||
| #include <assert.h> | ||
|
|
||
| -int g = 4; | ||
| +int g = 5; | ||
|
|
||
| int main() { | ||
| int x = g; | ||
| - assert(x == 4); | ||
| + assert(x == 4); //FAIL | ||
| return 0; | ||
| } | ||
| diff --git tests/incremental/04-manual-restart/01-restart_manual_simple.json tests/incremental/04-manual-restart/01-restart_manual_simple.json | ||
| index dbdb1d651..d66a6cf36 100644 | ||
| --- tests/incremental/04-manual-restart/01-restart_manual_simple.json | ||
| +++ tests/incremental/04-manual-restart/01-restart_manual_simple.json | ||
| @@ -7,7 +7,7 @@ | ||
| "sided": { | ||
| "enabled": false | ||
| }, | ||
| - "list": [] | ||
| + "list": ["g"] | ||
| } | ||
| } | ||
| } |
16 changes: 16 additions & 0 deletions
16
tests/incremental/04-manual-restart/02-read_write_global.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,16 @@ | ||
| int g = 0; | ||
|
|
||
| void foo(){ | ||
| g = 1; | ||
| } | ||
|
|
||
| void bar(){ | ||
| int x = g; | ||
| assert(x % 2 == 0); // UNKNOWN (imprecision caused by earlyglobs) | ||
| } | ||
|
|
||
| int main(){ | ||
| foo(); | ||
| bar(); | ||
| return 0; | ||
| } |
19 changes: 19 additions & 0 deletions
19
tests/incremental/04-manual-restart/02-read_write_global.json
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,19 @@ | ||
| { | ||
| "exp": { | ||
| "earlyglobs": true | ||
| }, | ||
| "ana": { | ||
| "int": { | ||
| "interval": true, | ||
| "congruence": true | ||
| } | ||
| }, | ||
| "incremental": { | ||
| "restart": { | ||
| "sided": { | ||
| "enabled": false | ||
| }, | ||
| "list": [] | ||
| } | ||
| } | ||
| } |
34 changes: 34 additions & 0 deletions
34
tests/incremental/04-manual-restart/02-read_write_global.patch
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,34 @@ | ||
| diff --git tests/incremental/04-manual-restart/02-read_write_global.c tests/incremental/04-manual-restart/02-read_write_global.c | ||
| index 8a93caabe..521322dd0 100644 | ||
| --- tests/incremental/04-manual-restart/02-read_write_global.c | ||
| +++ tests/incremental/04-manual-restart/02-read_write_global.c | ||
| @@ -1,12 +1,12 @@ | ||
| int g = 0; | ||
|
|
||
| void foo(){ | ||
| - g = 1; | ||
| + g = 2; | ||
| } | ||
|
|
||
| void bar(){ | ||
| int x = g; | ||
| - assert(x % 2 == 0); // UNKNOWN (imprecision caused by earlyglobs) | ||
| + assert(x % 2 == 0); | ||
| } | ||
|
|
||
| int main(){ | ||
| diff --git tests/incremental/04-manual-restart/02-read_write_global.json tests/incremental/04-manual-restart/02-read_write_global.json | ||
| index 33dd19da4..0820029df 100644 | ||
| --- tests/incremental/04-manual-restart/02-read_write_global.json | ||
| +++ tests/incremental/04-manual-restart/02-read_write_global.json | ||
| @@ -13,7 +13,9 @@ | ||
| "sided": { | ||
| "enabled": false | ||
| }, | ||
| - "list": [] | ||
| + "list": [ | ||
| + "g" | ||
| + ] | ||
| } | ||
| } | ||
| } |
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,11 @@ | ||
| #include <assert.h> | ||
| int foo(int x){ | ||
| return x; | ||
| } | ||
|
|
||
| int main(){ | ||
| int x = 12; | ||
| int y = foo(x); | ||
| assert(x == y); | ||
| return 0; | ||
| } |
17 changes: 17 additions & 0 deletions
17
tests/incremental/04-manual-restart/03-partial_contexts.json
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 @@ | ||
| { | ||
| "ana": { | ||
| "base": { | ||
| "context": { | ||
| "int": false | ||
| } | ||
| } | ||
| }, | ||
| "incremental": { | ||
| "restart": { | ||
| "sided": { | ||
| "enabled": false | ||
| }, | ||
| "list": [] | ||
| } | ||
| } | ||
| } |
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.