Skip to content
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

[depends: #472] Variable Sensitivity Domain #708

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
129 commits
Select commit Hold shift + click to select a range
08a2f8a
Fix constant propagator.
May 22, 2017
956225f
disable two-way propagation for now
danpoe Jan 30, 2017
1b13114
Addressing constant domain review comments by Daniel Poetzl.
May 24, 2017
e2fdcbf
constant propagator fix
danpoe Feb 15, 2017
3178f1b
Add is_bottom() and is_top() to ai_domain_baset and derived domains.
May 23, 2017
5606ce5
Use is_bottom() to catch unreachable functions.
May 23, 2017
7cee75e
Refactor goto-analyzer so that task, analysis, domain and output can …
Dec 16, 2016
5f6ecbe
Remove the special case handling of --show-intervals.
Sep 9, 2016
93b8f8c
Add support for dependency graph display.
May 22, 2017
d0b728a
Program simplification now removes unused instructions.
May 22, 2017
427580d
Catch exceptions thrown in doit() in goto analyzer.
Dec 19, 2016
ce669c3
Fix merging issues in goto analyzer.
May 22, 2017
8db8121
Fix whitespace to match coding guidelines
danpoe Jan 25, 2017
7193056
Whitespace fixes in goto-analyzer.
May 22, 2017
cb54f29
regression test changes
danpoe Feb 3, 2017
42e603c
Addressing goto analyzer review comments by Daniel Poetzl.
May 24, 2017
74170fd
option to ignore unresolved functions in the constant propagator
danpoe Feb 10, 2017
ec808bd
Test that requires is_bottom() and is_top().
May 23, 2017
f1c62f2
Improve status output.
May 23, 2017
7ca4e94
enable failed tests printer for goto-analyzer regression tests
danpoe Feb 22, 2017
ca7d8ab
enable assertions in is_threadedt
danpoe Feb 24, 2017
3565cc6
Update the use of ai_simplify for the introduction of ai_simplify_lhs.
Jun 15, 2017
5abec1e
Check in of basic variable sensitivity framework.
Feb 14, 2017
29b5a82
Added constant_abstract_value implementation
Feb 17, 2017
1eae6e0
Use variable in the constant_propogation checks
Feb 17, 2017
341b619
Adding debug guarded output to the variable sensitivity domain
Feb 21, 2017
b10f621
Better stub for assigning to non-trivial symbol
Feb 21, 2017
e922362
Created skeleton classes for the array, pointer, struct
Feb 21, 2017
b5fda65
Adding a 2 element implemention of sturct abstract object
Feb 21, 2017
b6ab6e6
Modifications to struct_abstract_object
Feb 22, 2017
d4cb43d
Readded broken protected
Feb 22, 2017
a3654e3
Implementation of simplify
Feb 22, 2017
2d8cb48
Don't use static for the map as means wrong this is captured
Feb 22, 2017
e562e9d
Added handler for logical == expression
Feb 22, 2017
5257140
Cleaned up the variable sensitivity framework
Feb 23, 2017
292673b
Corrected the logic for non-trivial assigns
Feb 23, 2017
c41d65f
Fixied potential dangling pointer in the struct abstract oject
Feb 23, 2017
e26e7c3
Basic implementations for abstract pointer and abstract array
Feb 23, 2017
57c1e1b
Moved the logic for resolving logical expressions into abstract_value
Feb 23, 2017
df28677
Fixed bug that would have occured for struct/pointer/array assigns
Feb 24, 2017
44b69ed
Removed the requirement on two operands
Feb 24, 2017
f2323f2
Simplify the expression before storing
Feb 24, 2017
af2c1d3
Fixed issue where writing to a top value
Feb 27, 2017
0b8bff4
Add previously written design documentation to the relevant parts of …
Feb 28, 2017
4717f58
Improve the documentation of various methods.
Feb 28, 2017
6175996
Give a generic implementation of assume.
Feb 28, 2017
4a294f3
Enable the use of assume for branches.
Feb 28, 2017
12f8d7e
Basic implementation of the sensitive pointer
Feb 27, 2017
8471785
Fixing comments in pointer_abstract_object
Feb 27, 2017
de8af33
Adding merge state
Feb 28, 2017
28b0139
Supporting stack when writing
Feb 28, 2017
92698fc
Changed the pointer abstract object to store an expression
Feb 28, 2017
5492310
Implementing a configurable abstract object factory
Feb 28, 2017
70ae194
Fixed crash bug in writing to dereference of pointer to pointer
Feb 28, 2017
6c89bf2
Improved exception message for unreasonable write
Feb 28, 2017
079eed9
Checking in a demo script containg the things that currently work
Feb 28, 2017
c0c7c0d
Added writing to pointer to demo
Feb 28, 2017
1843fec
Added flags so the factory reads the flags correctly
Feb 28, 2017
847a2af
Enable pointer sensitivity in the factory
Feb 28, 2017
23e19cc
Added documentation to the demo script
Feb 28, 2017
80f7153
Fixing up formatting
Mar 2, 2017
175e807
Add simplification of the left hand side of assignments.
Feb 28, 2017
dc82227
Remove incorrect comment.
Feb 28, 2017
1209922
Review comments and TODOs.
Feb 28, 2017
4cbf595
Mark unreachable assertions as satisfied.
Mar 1, 2017
d7893d6
Document various of the key ideas behind how goto-analyze works.
Mar 2, 2017
b6e03bd
Renamed methods to provide a more consistent interface
Mar 6, 2017
e6064b6
Protect top and bottom as much as possible.
Mar 6, 2017
d17f3a7
Output should be const-clean.
Mar 6, 2017
90fcdc9
Implementing sensitive struct abstract object
danpoe Feb 27, 2017
cd53637
If anything is assigned the value bottom, the whole domain should be …
Mar 6, 2017
96eef7d
A missing case in the factory code means that constant assertions wer…
Mar 6, 2017
0d147a3
Fix overwrite for CLONE and MERGE
Mar 8, 2017
20b2936
In abstract objects the state should be private and merge_state prote…
Mar 9, 2017
6ff3ee7
Enforced const interface for abstract objects
Mar 9, 2017
e25d082
Fix crash
Mar 9, 2017
4a38df0
Minimal reproducer for struct problem
Mar 9, 2017
7db370c
Use the correct abstract object when performing a transform
Mar 17, 2017
4e5a3ad
Corrected merge action in the abstract enviroment
Mar 17, 2017
01dbc41
Correct struct write for unknown component
Mar 17, 2017
b83a34b
Correcting type check in struct abstract object
Mar 17, 2017
41cb817
Fix for crash
Mar 7, 2017
ca9d708
Basic implementation of the constant_array_abstract_object
Mar 10, 2017
9b47072
Array initialization now works with the abstract object
Mar 15, 2017
b23b7de
Added merge_state to constant_array_abstract_object
Mar 16, 2017
006b812
Adding function header comments
Mar 16, 2017
1b5c81e
Removed unnecessary copies
Mar 17, 2017
af4a943
Updating the demo script
Mar 17, 2017
3cbc98b
Adding output function to struct
Mar 23, 2017
e453bef
Made verify stricter
Mar 23, 2017
0187b77
Fixed bug where top wasn't being cleared
Mar 23, 2017
d466c89
Bug fixes for the array abstract object
Mar 23, 2017
987ec23
Corrected and simplified constructor for the pointer abstract object
Mar 23, 2017
f1436e5
Corrected implementation of flow sensitivity
Mar 24, 2017
edacc16
Tidy up includes
Mar 27, 2017
06f5a58
Correcting implemenations of the write methods for pointer and struct
Mar 28, 2017
21cc2dc
Refactor the ai_simplify into a lhs function
Mar 28, 2017
b1e2cc6
Corrected constructing object for failed evaluation
Mar 28, 2017
6a305a5
Fixing constant propogation test
Mar 28, 2017
aafe2fa
Linting fixes
Mar 28, 2017
a8f1ae7
Modified lambda to compile under Windows compiler.
Mar 29, 2017
c49b533
Improved the removing top elements in map merge
Apr 19, 2017
6297a05
Modified code to not crash when writing to an pointer arithmetic on lhs
Apr 5, 2017
12f78b4
Adding tests for reading and writing to/from ararys through points
Apr 7, 2017
fdc1f82
Fixed bug when doing a merge write to a pointer
Apr 11, 2017
e334806
Reworked the double dispatch of the merge
Apr 21, 2017
be2a296
Removing default copy constructors
Apr 21, 2017
d726007
Replacing map based switch statments with chained if/elses
Apr 24, 2017
2d055ea
Explained why top must be used as the else clause in eval
Apr 24, 2017
7cf1446
Don't make copies unnecessarily when merging
Apr 25, 2017
2772300
Using enable_shared_from_this to eliminate naked pointers
Apr 25, 2017
c84f11b
Adding unit tests for merging of abstract objects
Apr 25, 2017
d8341af
Fixed bugs revealed by unit tests
Apr 25, 2017
f90bf00
Adding unit tests for constant abstract object.
Apr 25, 2017
b8a0c78
Adding tests for constant array
Apr 27, 2017
3b05fe3
Adding unit tests for the struct abstract object
Apr 28, 2017
b2ef738
Corrected merge methods for pointer and struct
Apr 28, 2017
c96f418
Rewriting the constant_abstract_value::merge using behaviour driven d…
Apr 28, 2017
ca525bd
Replaced assert with __CPROVER_assert
May 2, 2017
0f51650
Use Behaviour Driven Design testing for abstract object merge
May 5, 2017
6191fb2
Struct and array AO unit tests using behaviour driven design
May 5, 2017
430f934
Corrected guard on specialised merge
May 5, 2017
66561d7
Made pointer to array name consistent
May 5, 2017
deba2a3
Constant array reading from top handled correctly
May 5, 2017
b1ac428
Completed test suite for full struct and constant array AOs
May 5, 2017
d4afa61
Correctly set up the enviroment before running tests
May 9, 2017
f7f3db0
Extracted out logic for when to use a 2 value merge
May 11, 2017
bb4f378
Improved comment in the LHS simplify
May 16, 2017
8601e81
Fixed ai_simplify in variable sensitivity domain to use new interface
Jun 15, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions regression/goto-analyzer/constant_assertions_01/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include <assert.h>

int nondet_int (void);

int main (int argc, char **argv)
{
int x = nondet_int();
int y = nondet_int();

__CPROVER_assert(0, "0");
__CPROVER_assert(0 && 1, "0 && 1");
__CPROVER_assert(0 || 0, "0 || 0");
__CPROVER_assert(0 && x, "0 && x");
__CPROVER_assert(y && 0, "y && 0");

return 0;
}
12 changes: 12 additions & 0 deletions regression/goto-analyzer/constant_assertions_01/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
CORE
main.c
--verify --variable
^\[main.assertion.1\] file main.c .* 0: Failure \(if reachable\)$
^\[main.assertion.2\] file main.c .* 0 && 1: Failure \(if reachable\)$
^\[main.assertion.3\] file main.c .* 0 || 0: Failure \(if reachable\)$
^\[main.assertion.4\] file main.c .* 0 && x: Failure \(if reachable\)$
^\[main.assertion.5\] file main.c .* y && 0: Failure \(if reachable\)$
^EXIT=0$
^SIGNAL=0$
--
^warning: ignoring
17 changes: 17 additions & 0 deletions regression/goto-analyzer/constant_assertions_02/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include <assert.h>

int nondet_int (void);

int main (int argc, char **argv)
{
int x = nondet_int();
int y = nondet_int();

__CPROVER_assert(1, "1");
__CPROVER_assert(0 || 1, "0 || 1");
__CPROVER_assert(1 && 1, "1 && 1");
__CPROVER_assert(1 || x, "1 || x");
__CPROVER_assert(y || 1, "y || 1");

return 0;
}
12 changes: 12 additions & 0 deletions regression/goto-analyzer/constant_assertions_02/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
CORE
main.c
--verify --variable
^\[main\.assertion\.1\] file main\.c .* 1: Success
^\[main\.assertion\.2\] file main\.c .* 0 || 1: Success
^\[main\.assertion\.3\] file main\.c .* 1 && 1: Success
^\[main\.assertion\.4\] file main\.c .* 1 || x: Success
^\[main\.assertion\.5\] file main\.c .* y || 1: Success
^EXIT=0$
^SIGNAL=0$
--
^warning: ignoring
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
int main()
{
int i, j=20;

if (j==20)
{
int x=1,y=2,z;
z=x+y;
assert(z==3);
__CPROVER_assert(z==3, "z==3");
}

}
10 changes: 5 additions & 5 deletions regression/goto-analyzer/constant_propagation_01/test.desc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FUTURE
constant_propagation1.c
--constants --simplify out.goto
CORE
main.c
--variable --simplify out.gb
^EXIT=0$
^SIGNAL=0$
^SIMPLIFIED: assert: 1, assume: 0, goto: 2, assigns: 5, function calls: 0$
^UNMODIFIED: assert: 0, assume: 0, goto: 0, assigns: 12, function calls: 2$
^Simplified: assert: 1, assume: 0, goto: 1, assigns: 5, function calls: 0$
^Unmodified: assert: 0, assume: 0, goto: 0, assigns: 12, function calls: 2$
--
^warning: ignoring
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
#include <assert.h>

int main()
{
int i=0, j=2;

if (i<50)
if (i==0)
{
i++;
j++;
}
assert(j!=3);
__CPROVER_assert(j!=3, "j!=3");
}
3 changes: 0 additions & 3 deletions regression/goto-analyzer/constant_propagation_02/original

This file was deleted.

81 changes: 0 additions & 81 deletions regression/goto-analyzer/constant_propagation_02/simplified

This file was deleted.

10 changes: 5 additions & 5 deletions regression/goto-analyzer/constant_propagation_02/test.desc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FUTURE
constant_propagation_02.c
--constants --simplify out.goto
CORE
main.c
--variable --simplify out.gb
^EXIT=0$
^SIGNAL=0$
^SIMPLIFIED: assert: 1, assume: 0, goto: 2, assigns: 6, function calls: 0$
^UNMODIFIED: assert: 0, assume: 0, goto: 0, assigns: 11, function calls: 2$
^Simplified: assert: 1, assume: 0, goto: 1, assigns: 6, function calls: 0$
^Unmodified: assert: 0, assume: 0, goto: 0, assigns: 11, function calls: 2$
--
^warning: ignoring
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
#include <assert.h>

int main()
{
int i=0, j=2;

if (i==0)
if (i==0)
{
i++;
j++;
}
assert(j!=3);
__CPROVER_assert(j==3, "j==3");
}
10 changes: 5 additions & 5 deletions regression/goto-analyzer/constant_propagation_03/test.desc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FUTURE
constant_propagation_03.c
--constants --simplify out.goto
CORE
main.c
--variable --simplify out.gb
^EXIT=0$
^SIGNAL=0$
^SIMPLIFIED: assert: 1, assume: 0, goto: 2, assigns: 6, function calls: 0$
^UNMODIFIED: assert: 0, assume: 0, goto: 0, assigns: 11, function calls: 2$
^Simplified: assert: 1, assume: 0, goto: 1, assigns: 6, function calls: 0$
^Unmodified: assert: 0, assume: 0, goto: 0, assigns: 11, function calls: 2$
--
^warning: ignoring
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
#include <assert.h>

int main()
{
int i=0, j=2;

if (i==0)
if (i<50)
{
i++;
j++;
}
assert(j==3);
__CPROVER_assert(j==3, "j==3");
}
10 changes: 5 additions & 5 deletions regression/goto-analyzer/constant_propagation_04/test.desc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FUTURE
constant_propagation_04.c
--constants --simplify out.goto
CORE
main.c
--variable --simplify out.gb
^EXIT=0$
^SIGNAL=0$
^SIMPLIFIED: assert: 1, assume: 0, goto: 2, assigns: 6, function calls: 0$
^UNMODIFIED: assert: 0, assume: 0, goto: 0, assigns: 11, function calls: 2$
^Simplified: assert: 1, assume: 0, goto: 1, assigns: 6, function calls: 0$
^Unmodified: assert: 0, assume: 0, goto: 0, assigns: 11, function calls: 2$
--
^warning: ignoring
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
#include <assert.h>

int main()
{
int i=0, j=2;

if (i<50)
if (i<50)
{
i++;
j++;
}
assert(j==3);
__CPROVER_assert(j!=3, "j!=3");
}
8 changes: 4 additions & 4 deletions regression/goto-analyzer/constant_propagation_05/test.desc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FUTURE
constant_propagation_05.c
--constants --verify
CORE
main.c
--variable --verify
^EXIT=0$
^SIGNAL=0$
^\[main.assertion.1\] file constant_propagation_05.c line 12 function main, assertion j!=3: FAILURE (if reachable)$
^\[main\.assertion\.1\] .* j!=3: Failure \(if reachable\)$
--
^warning: ignoring

This file was deleted.

13 changes: 13 additions & 0 deletions regression/goto-analyzer/constant_propagation_06/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

int main()
{
int i=0, j=2;

while (i<50)
{
i++;
j++;
}
__CPROVER_assert(i<51, "i<51");
}

15 changes: 4 additions & 11 deletions regression/goto-analyzer/constant_propagation_06/test.desc
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
FUTURE
constant_propagation_06.c
--intervals --verify
CORE
main.c
--variable --verify
^EXIT=0$
^SIGNAL=0$
^\[main.assertion.1\] file constant_propagation_06.c line 8 function main, assertion i>=10: SUCCESS$
^\[main.assertion.2\] file constant_propagation_06.c line 11 function main, assertion i!=30: SUCCESS$
^\[main.assertion.3\] file constant_propagation_06.c line 14 function main, assertion i!=15: UNKNOWN$
^\[main.assertion.4\] file constant_propagation_06.c line 17 function main, assertion 0: SUCCESS$
^\[main.assertion.5\] file constant_propagation_06.c line 20 function main, assertion j>=10: SUCCESS$
^\[main.assertion.6\] file constant_propagation_06.c line 23 function main, assertion i>=j: UNKNOWN$
^\[main.assertion.7\] file constant_propagation_06.c line 26 function main, assertion i>=11: SUCCESS$
^\[main.assertion.8\] file constant_propagation_06.c line 29 function main, assertion j<100: SUCCESS$
^\[main.assertion.1\] .* i\s*<\s*51: Unknown$
--
^warning: ignoring
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <assert.h>

int main()
{
signed int i;
Expand All @@ -17,7 +17,7 @@ int main()
j = j + 1;
i = i + 1;
}
assert(!(i < 2));
__CPROVER_assert(!(i < 2), "!(i < 2)");
}
}
return 0;
Expand Down
9 changes: 5 additions & 4 deletions regression/goto-analyzer/constant_propagation_07/test.desc
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FUTURE
constant_propagation_07.c
--constants --verify
KNOWNBUG
main.c
--variable --simplify out.gb
^EXIT=0$
^SIGNAL=0$
^\[main.assertion.1\] file constant_propagation_07.c line 12 function main, assertion i<51: UNKNOWN$
^Simplified: assert: 1, assume: 0, goto: 3, assigns: 10, function calls: 0$
^Unmodified: assert: 0, assume: 0, goto: 1, assigns: 10, function calls: 2$
--
^warning: ignoring
Loading