Skip to content

Aisimplifier #173

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 69 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
8242f43
support the conjunction of clauses in the assert statement
Jul 11, 2016
e6b00b4
implement make clean for the Makefile in the goto-analyzer regression…
Jul 14, 2016
21da31e
add additional comments related to merge and eval operations
Jul 14, 2016
a140338
add a new test case to goto-analyzer regression suite
Jul 14, 2016
2476a87
add verification options to the goto-analyzer tool
Jul 15, 2016
e1b03de
add static_simplifier basic infrastructure
Jul 15, 2016
f0d65eb
refactor static_analyzer
Jul 18, 2016
1c26254
simplify guards in assert, assume, and goto instructions
Jul 19, 2016
862c181
check whether we should simplify the goto-program before showing it
Jul 19, 2016
b765371
add new test cases for constant propagation
Jul 25, 2016
d972859
replace constants in the goto-anlyzer
Jul 25, 2016
f28cca3
update test desc to the new command-line options of goto-analyzer
Jul 25, 2016
a19382e
apply constant propagation before simplifying guards
Jul 27, 2016
3e12d2c
add new test cases related to the constant propagation
Jul 27, 2016
29b327f
improve support for equality in the constant propagator
Jul 27, 2016
19b520a
clean up the merge operator in the constant propagator
Jul 27, 2016
debcc95
clean up the merge operator in the constant propagator
Jul 27, 2016
1dccbde
add test cases related to constant propagation
Jul 27, 2016
50c9fc1
check whether the guard has been evaluated to TRUE by propagating con…
Jul 27, 2016
c5878af
add new test case for checking constant propagation
Jul 28, 2016
e0a1532
update test case
Jul 28, 2016
a81e039
do not propogate constants when dealing with loops
Jul 28, 2016
9134a60
remove debug flag
Jul 28, 2016
fdc6962
add test cases related to constant propagation
Jul 28, 2016
1a0f178
handle ID_ge and ID_gt in the ai_analysis
Jul 28, 2016
44c65a6
add new test cases for constant propagation
Jul 28, 2016
5da9abb
improve the simplifier results
Jul 29, 2016
f1bf538
update test case
Jul 29, 2016
90f4d7a
update test case
Jul 29, 2016
4edda4c
fix the constant propagator merge operator
Jul 29, 2016
1a14672
fix the constant propagator transform operator for goto expressions
Jul 29, 2016
c071f34
create static_verifiert class
Jul 29, 2016
c6236ea
create static_analysert class
Jul 29, 2016
0541104
fix the constant propagator merge operator
Jul 29, 2016
73cf9ec
add static analyser class
Aug 1, 2016
099b7ba
fix merge operator
Aug 1, 2016
ffe822d
refactor constant-propagation and intervals command-line options
Aug 2, 2016
04d03fd
make sure the references are correct in the simplify_guards
Aug 2, 2016
d22cde4
add dump-goto option to write the simplified program
Aug 2, 2016
7b6a489
improve command-line option
Aug 2, 2016
697cd9f
remove has_assertion() check
Aug 3, 2016
68c6aea
update source_location to constant expressions
Aug 4, 2016
1874066
remove ID_C_cformat once we propagate the constant
Aug 5, 2016
b1d4414
remove ID_C_cformat once we propagate the constant
Aug 5, 2016
ee707af
remove skip statements after propagating constants
Aug 5, 2016
a381a39
remove unreachable statements after propagating constants
Aug 5, 2016
6e13fa7
we do not support C/Pthreads yet
Aug 8, 2016
f388ead
simplify guard if it evaluates to false during constant propagation
Aug 8, 2016
19f776d
add a simple test case to simplify array
Aug 8, 2016
2a055d9
add new test cases
Aug 8, 2016
2cffa80
clean up the code
Aug 8, 2016
8c73cd7
check for expression in the interval analysis
Aug 8, 2016
93cc841
we have to handle symbol expression
Aug 8, 2016
6323484
add initial support for propagating constants through arrays
Aug 10, 2016
42b301c
add new test cases related to constant propagation through arrays
Aug 10, 2016
becdce5
initialise arrays in the constant propagator
Aug 10, 2016
3f227a6
test case to check arrays initialisation in the constant propagator
Aug 10, 2016
a49821c
add new test cases to the constant propagator
Aug 11, 2016
8eff586
add new test cases to the constant propagator
Aug 11, 2016
3845ead
fix merge operator
Aug 11, 2016
2b69ca0
fix merge operator
Aug 12, 2016
67aa621
add new test case
Aug 12, 2016
539bfe3
write C program for debug purposes in CEGIS
lucasccordeiro Sep 20, 2016
4be3d20
add test case for CEGIS in control
lucasccordeiro Sep 20, 2016
87691a2
write simplified C program to a file
lucasccordeiro Sep 20, 2016
eed17a9
add support for simplyfing multi-threaded programs
lucasccordeiro Sep 20, 2016
eda17fa
add new test case
lucasccordeiro Sep 20, 2016
5396801
remove unused files
lucasccordeiro Sep 20, 2016
531f198
add test case constant_propagation_21
lucasccordeiro Sep 20, 2016
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
5 changes: 5 additions & 0 deletions regression/goto-analyzer/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,8 @@ show:
vim -o "$$dir/*.java" "$$dir/*.out"; \
fi; \
done;

clean:
find . -name *.*~ | xargs rm -f
find . -name *.out | xargs rm -f
rm -f tests.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include <assert.h>

int main()
{
int i, j=20;

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

}
9 changes: 9 additions & 0 deletions regression/goto-analyzer/constant_propagation_01/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CORE
constant_propagation1.c
--constant-propagation --simplify
^EXIT=0$
^SIGNAL=0$
^SIMPLIFIED: assert: 1, assume: 0, goto: 0$
^UNKNOWN: assert: 0, assume: 0, goto: 0$
--
^warning: ignoring
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include <assert.h>

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

if (i==0)
{
i++;
j++;
}
assert(j!=3);
}
9 changes: 9 additions & 0 deletions regression/goto-analyzer/constant_propagation_02/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CORE
constant_propagation_02.c
--constant-propagation --simplify
^EXIT=0$
^SIGNAL=0$
^SIMPLIFIED: assert: 1, assume: 0, goto: 0$
^UNKNOWN: assert: 0, assume: 0, goto: 0$
--
^warning: ignoring
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include <assert.h>

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

if (i==0)
{
i++;
j++;
}
assert(j==3);
}
9 changes: 9 additions & 0 deletions regression/goto-analyzer/constant_propagation_03/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CORE
constant_propagation_03.c
--constant-propagation --simplify
^EXIT=0$
^SIGNAL=0$
^SIMPLIFIED: assert: 1, assume: 0, goto: 0$
^UNKNOWN: assert: 0, assume: 0, goto: 0$
--
^warning: ignoring
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include <assert.h>

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

if (i<50)
{
i++;
j++;
}
assert(j==3);
}
9 changes: 9 additions & 0 deletions regression/goto-analyzer/constant_propagation_04/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CORE
constant_propagation_04.c
--constant-propagation --simplify
^EXIT=0$
^SIGNAL=0$
^SIMPLIFIED: assert: 1, assume: 0, goto: 0$
^UNKNOWN: assert: 0, assume: 0, goto: 0$
--
^warning: ignoring
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include <assert.h>

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

if (i<50)
{
i++;
j++;
}
assert(j!=3);
}
8 changes: 8 additions & 0 deletions regression/goto-analyzer/constant_propagation_05/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CORE
constant_propagation_05.c
--constant-propagation --verify
^EXIT=0$
^SIGNAL=0$
^\[main.assertion.1\] file constant_propagation_05.c line 12 function main, assertion j!=3: FAILURE$
--
^warning: ignoring
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#include <assert.h>

int main()
{
int i, j=20;

if(i>=20)
assert(i>=10); // success

if(i>=10 && i<=20)
assert(i!=30); // success

if(i>=10 && i<=20)
assert(i!=15); // fails

if(i<1 && i>10)
assert(0); // success

if(i>=10 && j>=i)
assert(j>=10); // success

if(i>=j)
assert(i>=j); // unknown

if(i>10)
assert(i>=11); // success

if(i<=100 && j<i)
assert(j<100); // success
}
15 changes: 15 additions & 0 deletions regression/goto-analyzer/constant_propagation_06/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
CORE
constant_propagation_06.c
--constant-propagation --intervals --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$
--
^warning: ignoring
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include <assert.h>

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

while (i<50)
{
i++;
j++;
}
assert(i<51);
}

9 changes: 9 additions & 0 deletions regression/goto-analyzer/constant_propagation_07/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CORE
constant_propagation_07.c
--constant-propagation --verify
^EXIT=0$
^SIGNAL=0$
^\[main.assertion.1\] file constant_propagation_07.c line 12 function main, assertion i<50: UNKNOWN$
^\[main.assertion.2\] file constant_propagation_07.c line 13 function main, assertion i<51: SUCCESS$
--
^warning: ignoring
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include <assert.h>

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

while (i<=50)
{
i++;
j++;
}
assert(i<50);
assert(i<51);
assert(i<52);
}

10 changes: 10 additions & 0 deletions regression/goto-analyzer/constant_propagation_08/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
CORE
constant_propagation_08.c
--constant-propagation --intervals --verify
^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$
--
^warning: ignoring
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include <assert.h>

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

while (i<=50)
{
i++;
j++;
}
assert(j<52);
}

9 changes: 9 additions & 0 deletions regression/goto-analyzer/constant_propagation_09/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CORE
constant_propagation_09.c
--constant-propagation --intervals --verify
^EXIT=0$
^SIGNAL=0$
******** Function main
^\[main.assertion.1\] file constant_propagation_09.c line 12 function main, assertion j<52: UNKNOWN$
--
^warning: ignoring
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#include <assert.h>
int main()
{
signed int i;
signed int j;
i = 0;
if(!(i >= 2))
{
j = j + 1;
i = i + 1;
if(!(i >= 2))
{
j = j + 1;
i = i + 1;
if(!(i >= 2))
{
j = j + 1;
i = i + 1;
}
assert(!(i < 2));
}
}
return 0;
}

9 changes: 9 additions & 0 deletions regression/goto-analyzer/constant_propagation_10/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CORE
constant_propagation_10.c
--constant-propagation --simplify
^EXIT=0$
^SIGNAL=0$
^SIMPLIFIED: assert: 1, assume: 0, goto: 0$
^UNKNOWN: assert: 0, assume: 0, goto: 0$
--
^warning: ignoring
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include <assert.h>
int main()
{
int a[2];
int i;
i = 0;

if (i==0)
a[0]=1;
else
a[1]=2;

assert(a[0]==1 || a[1]==2);

return 0;
}

9 changes: 9 additions & 0 deletions regression/goto-analyzer/constant_propagation_11/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CORE
constant_propagation_10.c
--constant-propagation --simplify
^EXIT=0$
^SIGNAL=0$
^SIMPLIFIED: assert: 1, assume: 0, goto: 0$
^UNKNOWN: assert: 0, assume: 0, goto: 0$
--
^warning: ignoring
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include <assert.h>
int main()
{
int a[2]={0,0};

if (a[0]==0)
a[0]=1;

assert(a[0]==0);

return 0;
}

9 changes: 9 additions & 0 deletions regression/goto-analyzer/constant_propagation_12/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CORE
constant_propagation_12.c
--constant-propagation --simplify
^EXIT=0$
^SIGNAL=0$
^SIMPLIFIED: assert: 1, assume: 0, goto: 0$
^UNKNOWN: assert: 0, assume: 0, goto: 0$
--
^warning: ignoring
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include <assert.h>
int main()
{
int a[2]={0,0};
int i, y;

if (a[0]==0)
a[0]=1;

assert(a[0]==2);

return 0;
}

8 changes: 8 additions & 0 deletions regression/goto-analyzer/constant_propagation_13/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CORE
constant_propagation_13.c
--constant-propagation --verify
^EXIT=0$
^SIGNAL=0$
^\[main.assertion.1\] file constant_propagation_13.c line 10 function main, assertion a\[0\]==2: FAILURE$
--
^warning: ignoring
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include <assert.h>
int main()
{
int a[2]={0,0};

if (a[0]==0)
a[0]=1;

assert(a[0]==1 /*|| a[0]==2*/);

return 0;
}

9 changes: 9 additions & 0 deletions regression/goto-analyzer/constant_propagation_14/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CORE
constant_propagation_14.c
--constant-propagation --simplify
^EXIT=0$
^SIGNAL=0$
^SIMPLIFIED: assert: 1, assume: 0, goto: 0$
^UNKNOWN: assert: 0, assume: 0, goto: 0$
--
^warning: ignoring
Loading