Skip to content

Commit 0a5c1eb

Browse files
author
Daniel Kroening
authored
Merge pull request #167 from lucasccordeiro/aisimplifier
Aisimplifier
2 parents ce65160 + e375c41 commit 0a5c1eb

File tree

13 files changed

+118
-2
lines changed

13 files changed

+118
-2
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#include <assert.h>
2+
3+
int main(){
4+
int x;
5+
if (x > 0) {
6+
if (x < 20) {
7+
assert(x > -10 && x < 100);
8+
}
9+
}
10+
return 0;
11+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
intervals2.c
3+
--intervals
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^\[main.assertion.1\] file intervals2.c line 7 function main, assertion x > -10 && x < 100: SUCCESS$
7+
--
8+
^warning: ignoring
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#include <assert.h>
2+
3+
int main(){
4+
int x;
5+
if (x > 0) {
6+
if (x < 20) {
7+
assert(x > -10 || x < 100);
8+
}
9+
}
10+
return 0;
11+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
intervals3.c
3+
--intervals
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^\[main.assertion.1\] file intervals3.c line 7 function main, assertion x > -10 || x < 100: SUCCESS$
7+
--
8+
^warning: ignoring
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//#include <assert.h>
2+
3+
int main()
4+
{
5+
int i;
6+
7+
if(i>0)
8+
if(i<3)
9+
assert(i>=1 && i<=2);
10+
11+
return 0;
12+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
intervals4.c
3+
--intervals
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^\[main.assertion.1\] file intervals4.c line 9 function main, assertion i >= 1 && i <= 2: SUCCESS$
7+
--
8+
^warning: ignoring
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//#include <assert.h>
2+
3+
int main()
4+
{
5+
int i;
6+
7+
if(i>0)
8+
if(i<3)
9+
assert(i>=1 || i<=2);
10+
11+
return 0;
12+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
intervals5.c
3+
--intervals
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^\[main.assertion.1\] file intervals5.c line 9 function main, assertion i >= 1 || i <= 2: SUCCESS$
7+
--
8+
^warning: ignoring
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#include <assert.h>
2+
3+
int main(){
4+
int x;
5+
if (x > 0) {
6+
if (x < 20) {
7+
assert(x < -10 || x > 100);
8+
}
9+
}
10+
return 0;
11+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
intervals6.c
3+
--intervals
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^\[main.assertion.1\] file intervals6.c line 7 function main, assertion x < -10 || x > 100: UNKNOWN$
7+
--
8+
^warning: ignoring
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#include <assert.h>
2+
3+
int main(){
4+
int x;
5+
if (x > 0) {
6+
if (x < 20) {
7+
assert(x < -10 && x > 100);
8+
}
9+
}
10+
return 0;
11+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
intervals7.c
3+
--intervals
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^\[main.assertion.1\] file intervals7.c line 7 function main, assertion x < -10 && x > 100: UNKNOWN$
7+
--
8+
^warning: ignoring

src/analyses/interval_domain.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ bool interval_domaint::merge(
148148
if(bottom) { *this=b; return true; }
149149

150150
bool result=false;
151-
151+
152152
for(int_mapt::iterator it=int_map.begin();
153153
it!=int_map.end(); ) // no it++
154154
{
@@ -293,7 +293,7 @@ void interval_domaint::assume_rec(
293293
if(lhs.id()==ID_symbol && rhs.id()==ID_constant)
294294
{
295295
irep_idt lhs_identifier=to_symbol_expr(lhs).get_identifier();
296-
296+
297297
if(is_int(lhs.type()) && is_int(rhs.type()))
298298
{
299299
mp_integer tmp;

0 commit comments

Comments
 (0)