Skip to content

Goto analyzer #472

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

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
02080c8
Make evaluation and/or simplification of conditions/expressions an ai…
Sep 8, 2016
92d684f
Implement domain_simplify for intervals.
Dec 16, 2016
07b147b
Refactor goto-analyzer so that task, analysis, domain and output can …
Dec 16, 2016
603dae2
Remove the special case handling of --show-intervals.
Sep 9, 2016
b316e28
Implement domain_simplify for the constant domain.
Sep 9, 2016
c089455
Add output_json to the dependence_graph abstract domain.
Nov 1, 2016
39e9d9f
Add utility function for remove_unreachable.
Dec 16, 2016
1a0e40c
Catch exceptions thrown in doit() in goto analyzer.
Dec 19, 2016
1a4a859
Fix merging issues in goto analyzer
danpoe Jan 22, 2017
5b66759
Fix whitespace to match coding guidelines
danpoe Jan 25, 2017
a220929
Fix constant propagator
danpoe Jan 25, 2017
cfd909d
disable two-way propagation for now
danpoe Jan 30, 2017
8ca0691
regression test changes
danpoe Feb 3, 2017
f678bd8
Addressing goto analyzer review comments
danpoe Feb 3, 2017
3e69c76
option to ignore unresolved functions in the constant propagator
danpoe Feb 10, 2017
3202ac7
use ai function output in goto-instrument
danpoe Feb 10, 2017
e73e0dc
more status output
danpoe Feb 15, 2017
fce4f71
constant propagator fix
danpoe Feb 15, 2017
1ef5df0
add is_bottom() and is_top() to ai_domain_baset
danpoe Feb 17, 2017
ce789ee
enable failed tests printer for goto-analyzer regression tests
danpoe Feb 22, 2017
8f4aa80
enable assertions in is_threadedt
danpoe Feb 24, 2017
58bfe6d
fixed merging issue
danpoe Apr 4, 2017
fcd0c0a
fixed compilation error in debug mode
danpoe Apr 5, 2017
e183ffb
fixed merging issue
danpoe May 5, 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
7 changes: 7 additions & 0 deletions regression/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,10 @@ DIRS = ansi-c \

test:
$(foreach var,$(DIRS), $(MAKE) -C $(var) test || exit 1;)

clean:
@for dir in *; do \
if [ -d "$$dir" ]; then \
$(MAKE) -C "$$dir" clean; \
fi; \
done;
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#include <assert.h>

int main()
{
Expand Down
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
--constants --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,4 +1,3 @@
#include <assert.h>

int main()
{
Expand Down
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
--constants --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,4 +1,3 @@
#include <assert.h>

int main()
{
Expand Down
8 changes: 4 additions & 4 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
main.c
--constants --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: 2, 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,4 +1,3 @@
#include <assert.h>

int main()
{
Expand Down
8 changes: 4 additions & 4 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
main.c
--constants --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: 2, 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,4 +1,3 @@
#include <assert.h>

int main()
{
Expand Down
4 changes: 2 additions & 2 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
main.c
--constants --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\] file main.c line 12 function main, assertion j!=3: Failure (if reachable)$
--
^warning: ignoring
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++;
}
assert(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
--constants --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\] file main.c line 11 function main, assertion i\s*<\s*51: Unknown$
--
^warning: ignoring
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#include <assert.h>

int main()
{
signed int i;
signed int j;
i = 0;
if(!(i >= 2))
if(!(i >= 2))
{
j = j + 1;
i = i + 1;
Expand Down
7 changes: 4 additions & 3 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
main.c
--constants --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: 4, assigns: 10, function calls: 0$
^Unmodified: assert: 0, assume: 0, goto: 1, assigns: 10, function calls: 2$
--
^warning: ignoring
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <assert.h>

int main()
{
int a[2];
Expand Down
9 changes: 4 additions & 5 deletions regression/goto-analyzer/constant_propagation_08/test.desc
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
FUTURE
constant_propagation_08.c
--intervals --verify
main.c
--constants --simplify out.gb
^EXIT=0$
^SIGNAL=0$
^\[main.assertion.1\] file constant_propagation_08.c line 12 function main, assertion i<50: UNKNOWN$
^\[main.assertion.2\] file constant_propagation_08.c line 13 function main, assertion i<51: UNKNOWN$
^\[main.assertion.3\] file constant_propagation_08.c line 14 function main, assertion i<52: SUCCESS$
^Simplified: assert: 1, assume: 0, goto: 2, assigns: 5, function calls: 0$
^Unmodified: assert: 0, assume: 0, goto: 4, assigns: 13, function calls: 2$
--
^warning: ignoring
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <assert.h>

int main()
{
int a[2]={0,0};
Expand Down
8 changes: 4 additions & 4 deletions regression/goto-analyzer/constant_propagation_09/test.desc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FUTURE
constant_propagation_09.c
--intervals --verify
main.c
--constants --simplify out.gb
^EXIT=0$
^SIGNAL=0$
******** Function main
^\[main.assertion.1\] file constant_propagation_09.c line 12 function main, assertion j<52: UNKNOWN$
^Simplified: assert: 1, assume: 0, goto: 3, assigns: 4, 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,4 +1,4 @@
#include <assert.h>

int main()
{
int a[2]={0,0};
Expand Down
7 changes: 3 additions & 4 deletions regression/goto-analyzer/constant_propagation_10/test.desc
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
FUTURE
constant_propagation_10.c
--constants --simplify out.goto
main.c
--constants --verify
^EXIT=0$
^SIGNAL=0$
^SIMPLIFIED: assert: 1, assume: 0, goto: 4, assigns: 10, function calls: 0$
^UNMODIFIED: assert: 0, assume: 0, goto: 1, assigns: 10, function calls: 2$
^\[main.assertion.1\] file main.c line 10 function main, assertion a\[0\]==2: Failure$
--
^warning: ignoring
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <assert.h>

int main()
{
int a[2]={0,0};
Expand Down
8 changes: 4 additions & 4 deletions regression/goto-analyzer/constant_propagation_11/test.desc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FUTURE
constant_propagation_11.c
--constants --simplify out.goto
main.c
--constants --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: 4, assigns: 13, function calls: 2$
^Simplified: assert: 1, assume: 0, goto: 0$
^Unmodified: assert: 0, assume: 0, goto: 0$
--
^warning: ignoring
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <assert.h>

int main()
{
int i=0, y;
Expand Down
8 changes: 4 additions & 4 deletions regression/goto-analyzer/constant_propagation_12/test.desc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FUTURE
constant_propagation_12.c
--constants --simplify out.goto
main.c
--constants --simplify out.gb
^EXIT=0$
^SIGNAL=0$
^SIMPLIFIED: assert: 1, assume: 0, goto: 3, assigns: 4, function calls: 0$
^UNMODIFIED: assert: 0, assume: 0, goto: 0, assigns: 11, function calls: 2$
^Simplified: assert: 1, assume: 0, goto: 1, assigns: 4, function calls: 0$
^Unmodified: assert: 0, assume: 0, goto: 2, assigns: 11, function calls: 2$
--
^warning: ignoring
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <assert.h>

int main()
{
int i=0, y;
Expand Down
4 changes: 2 additions & 2 deletions regression/goto-analyzer/constant_propagation_13/test.desc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FUTURE
constant_propagation_13.c
main.c
--constants --verify
^EXIT=0$
^SIGNAL=0$
^\[main.assertion.1\] file constant_propagation_13.c line 10 function main, assertion a\[0\]==2: FAILURE$
^\[main.assertion.1\] file main.c line 9 function main, assertion y==0: Failure (if reachable)$
--
^warning: ignoring
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <assert.h>

int main()
{
int a[2]={0,0};
Expand Down
8 changes: 4 additions & 4 deletions regression/goto-analyzer/constant_propagation_14/test.desc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FUTURE
constant_propagation_14.c
--constants --simplify out.goto
main.c
--constants --verify
^EXIT=0$
^SIGNAL=0$
^SIMPLIFIED: assert: 1, assume: 0, goto: 0$
^UNKNOWN: assert: 0, assume: 0, goto: 0$
^\[main.assertion.1\] file main.c line 11 function main, assertion a\[0\]==1 || a\[0\]==2: Success$
^\[main.assertion.2\] file main.c line 12 function main, assertion a\[0\]==1 && a\[0\]==2: Failure$
--
^warning: ignoring
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <assert.h>

int main()
{
int a[2]={0,0};
Expand Down
Loading