Skip to content

Commit 8c0e263

Browse files
committed
introduce cstrlen_exprt
1 parent ed9dbe4 commit 8c0e263

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+764
-78
lines changed

regression/cprover/basic/assume1.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ assume1.c
33
--text --solve --inline
44
^EXIT=10$
55
^SIGNAL=0$
6-
^ \(\d+\) ∀ ς : state \. true ⇒ SInitial\(ς\)$
6+
^ \(\d+\) ∀ ς : state \. initial_state\(ς\) ⇒ SInitial\(ς\)$
77
^ \(\d+\) S0 = SInitial$
88
^ \(\d+\) S1 = S0$
99
^\(\d+\) ∀ ς : state \. \(S20\(ς\) ∧ ς\(❝main::1::x❞\) ≥ 10\) ⇒ S21\(ς\)$

regression/cprover/basic/basic1.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ basic1.c
33
--text --solve --inline
44
^EXIT=0$
55
^SIGNAL=0$
6-
^ \(\d+\) ∀ ς : state \. true ⇒ SInitial\(ς\)$
6+
^ \(\d+\) ∀ ς : state \. initial_state\(ς\) ⇒ SInitial\(ς\)$
77
^ \(\d+\) S0 = SInitial$
88
^\(\d+\) ∀ ς : state \. S17\(ς\) ⇒ S18\(ς\[❝x❞:=0\]\)$
99
^\(\d+\) ∀ ς : state \. S20\(ς\) ⇒ S21\(ς\[❝x❞:=1\]\)$
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
void my_function1(int *parameter)
2+
__CPROVER_requires(__CPROVER_w_ok(parameter))
3+
__CPROVER_assigns(*parameter) // passes
4+
{
5+
*parameter = 10;
6+
}
7+
8+
void my_function2(int *parameter)
9+
__CPROVER_requires(__CPROVER_w_ok(parameter))
10+
__CPROVER_assigns() // fails
11+
{
12+
*parameter = 10;
13+
}
14+
15+
void my_function3(int *parameter)
16+
__CPROVER_requires(__CPROVER_w_ok(parameter))
17+
// implicit assigns clause fails
18+
{
19+
*parameter = 10;
20+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CORE
2+
check_assigns3.c
3+
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
^\[my_function1\.assigns\.1\] line \d+ assigns clause: SUCCESS$
7+
^\[my_function2\.assigns\.1\] line \d+ assigns clause: REFUTED
8+
^\[my_function3\.assigns\.1\] line \d+ assigns clause: REFUTED
9+
--
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
struct S
2+
{
3+
int x, y;
4+
} global;
5+
6+
void my_function1(void)
7+
__CPROVER_assigns(global) // passes
8+
{
9+
global.x = 10;
10+
global.y = 10;
11+
}
12+
13+
void my_function2(void)
14+
__CPROVER_assigns(global.x) // passes
15+
{
16+
global.x = 10;
17+
}
18+
19+
void my_function3(void)
20+
__CPROVER_assigns(global.y) // passes
21+
{
22+
global.y = 10;
23+
}
24+
25+
void my_function4(void)
26+
__CPROVER_assigns(global.y) // fails
27+
{
28+
global.x = 10;
29+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
KNOWNBUG
2+
check_assigns4.c
3+
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
^\[my_function1\.assigns\.1\] line \d+ assigns clause: SUCCESS$
7+
^\[my_function1\.assigns\.2\] line \d+ assigns clause: SUCCESS$
8+
^\[my_function2\.assigns\.1\] line \d+ assigns clause: SUCCESS$
9+
^\[my_function3\.assigns\.1\] line \d+ assigns clause: SUCCESS$
10+
^\[my_function4\.assigns\.1\] line \d+ assigns clause: REFUTED$
11+
--
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
struct S
2+
{
3+
int x, y;
4+
};
5+
6+
void my_function1(struct S *s)
7+
__CPROVER_assigns(*s) // passes
8+
{
9+
s->x = 10;
10+
s->y = 10;
11+
}
12+
13+
void my_function2(struct S *s)
14+
__CPROVER_assigns(s->x) // passes
15+
{
16+
s->x = 10;
17+
}
18+
19+
void my_function3(struct S *s)
20+
__CPROVER_assigns(s->y) // passes
21+
{
22+
s->y = 10;
23+
}
24+
25+
void my_function4(struct S *s)
26+
__CPROVER_assigns(s->y) // fails
27+
{
28+
s->x = 10;
29+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
KNOWNBUG
2+
check_assigns5.c
3+
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
^\[my_function1\.assigns\.1\] line \d+ assigns clause: SUCCESS$
7+
^\[my_function1\.assigns\.2\] line \d+ assigns clause: SUCCESS$
8+
^\[my_function2\.assigns\.1\] line \d+ assigns clause: SUCCESS$
9+
^\[my_function3\.assigns\.1\] line \d+ assigns clause: SUCCESS$
10+
^\[my_function4\.assigns\.1\] line \d+ assigns clause: REFUTED$
11+
--
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
int global;
2+
_Bool flag;
3+
4+
void my_function1()
5+
__CPROVER_assigns(flag: global) // passes
6+
{
7+
if(flag)
8+
global = 10;
9+
}
10+
11+
void my_function2()
12+
__CPROVER_assigns(flag: global) // fails
13+
{
14+
global = 10;
15+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
check_assigns6.c
3+
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
^\[my_function1\.assigns\.1\] line \d+ assigns clause: SUCCESS$
7+
^\[my_function2\.assigns\.1\] line \d+ assigns clause: REFUTED$
8+
--

0 commit comments

Comments
 (0)