Skip to content

Commit 1d94b74

Browse files
committed
state encoding part II
1 parent d388e15 commit 1d94b74

File tree

195 files changed

+3739
-360
lines changed

Some content is hidden

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

195 files changed

+3739
-360
lines changed

regression/cprover/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
default: tests.log
1+
default: test-no-p
22

33
include ../../src/config.inc
44
include ../../src/common
55

66
test:
77
@../test.pl -e -p -c '../../../src/cprover/cprover'
88

9-
tests.log:
10-
@../test.pl -e -p -c '../../../src/cprover/cprover'
9+
test-no-p:
10+
@../test.pl -e -c '../../../src/cprover/cprover'
1111

1212
clean:
1313
$(RM) tests.log

regression/cprover/arrays/array1.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
array1.c
3-
--text --solve
3+
--text --solve --inline
44
^EXIT=10$
55
^SIGNAL=0$
66
^\(\d+\) ∀ ς : state \. S20\(ς\) ⇒ S21\(ς\[element_address\(❝array❞, 1\):=10\]\)$

regression/cprover/arrays/array2.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
array2.c
3-
--text --solve
3+
--text --solve --inline
44
^EXIT=10$
55
^SIGNAL=0$
66
^\(\d+\) ∀ ς : state \. \(S23\(ς\) ∧ ς\(❝main::1::i❞\) = ς\(❝main::1::j❞\)\) ⇒ S24\(ς\)$
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
int array[10] = { 0, 1, 2, 3, 4 };
2+
3+
int main()
4+
{
5+
__CPROVER_assert(array[0l] == 0, "property 1"); // passes
6+
__CPROVER_assert(array[1l] == 1, "property 2"); // passes
7+
return 0;
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
array_literal1.c
3+
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^\[main\.assertion\.1\] line \d+ property 1: SUCCESS$
7+
^\[main\.assertion\.2\] line \d+ property 2: SUCCESS$
8+
--
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
int array[] = {'a', 'b', 'c', 'd', 'e', 'f'};
2+
3+
int main()
4+
{
5+
int i;
6+
if(i >= 0 && i <= 5)
7+
__CPROVER_assert(array[i] == 'a' + i, "property 1"); // passes
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
int array[10];
2+
3+
int main()
4+
{
5+
__CPROVER_array_set(array, 123);
6+
__CPROVER_assert(array[5l] == 123, "property 1"); // passes
7+
return 0;
8+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
KNOWNBUG
2+
array_set1.c
3+
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^\[main\.assertion\.1\] line \d+ property 1: SUCCESS$
7+
--

regression/cprover/arrays/iterate_over_array2.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ iterate_over_array2.c
33
--safety
44
^EXIT=0$
55
^SIGNAL=0$
6-
^\[find_zero\.pointer\.1\] line \d+ pointer safe: SUCCESS$
6+
^\[find_zero\.pointer\.1\] line \d+ pointer .* safe: SUCCESS$
77
--
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
KNOWNBUG
2+
aws_hash_table_clear_contract.c
3+
-I aws-c-common/include aws-c-common/source/hash_table.c
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
--
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Function: aws_hash_table_clear
2+
// Source: source/hash_table.c
3+
4+
#include <aws/common/hash_table.h>
5+
6+
// void aws_hash_table_clear(struct aws_hash_table *map)
7+
8+
int main()
9+
{
10+
struct aws_hash_table *map;
11+
12+
aws_hash_table_clear(map);
13+
14+
return 0;
15+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
KNOWNBUG
2+
aws_hash_table_eq_contract.c
3+
-I aws-c-common/include aws-c-common/source/hash_table.c
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
--
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Function: aws_hash_table_eq
2+
// Source: source/hash_table.c
3+
4+
#include <aws/common/hash_table.h>
5+
6+
// bool aws_hash_table_eq(
7+
// const struct aws_hash_table *a,
8+
// const struct aws_hash_table *b,
9+
// aws_hash_callback_eq_fn *value_eq)
10+
11+
int main()
12+
{
13+
const struct aws_hash_table *a;
14+
const struct aws_hash_table *b;
15+
aws_hash_callback_eq_fn *value_eq;
16+
17+
aws_hash_table_eq(a, b, value_eq);
18+
19+
return 0;
20+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
KNOWNBUG
2+
aws_hash_table_foreach_contract.c
3+
-I aws-c-common/include aws-c-common/source/hash_table.c
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
--
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Function: aws_hash_table_foreach
2+
// Source: source/hash_table.c
3+
4+
#include <aws/common/hash_table.h>
5+
6+
// int aws_hash_table_foreach(
7+
// struct aws_hash_table *map,
8+
// int (*callback)(void *context, struct aws_hash_element *pElement),
9+
// void *context)
10+
11+
int main()
12+
{
13+
struct aws_hash_table *map;
14+
int (*callback)(void *context, struct aws_hash_element *pElement);
15+
void *context;
16+
17+
aws_hash_table_foreach(map, callback, context);
18+
19+
return 0;
20+
}

regression/cprover/aws-c-common/todo/aws_hash_table_clear_contract.c

Lines changed: 0 additions & 6 deletions
This file was deleted.

regression/cprover/aws-c-common/todo/aws_hash_table_eq_contract.c

Lines changed: 0 additions & 6 deletions
This file was deleted.

regression/cprover/aws-c-common/todo/aws_hash_table_foreach.desc

Lines changed: 0 additions & 6 deletions
This file was deleted.

regression/cprover/aws-c-common/todo/aws_hash_table_foreach_contract.c

Lines changed: 0 additions & 6 deletions
This file was deleted.

regression/cprover/basic/assume1.desc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
assume1.c
3-
--text --solve
3+
--text --solve --inline
44
^EXIT=10$
55
^SIGNAL=0$
66
^ \(\d+\) ∀ ς : state \. true ⇒ SInitial\(ς\)$
@@ -9,7 +9,7 @@ assume1.c
99
^\(\d+\) ∀ ς : state \. \(S20\(ς\) ∧ ς\(❝main::1::x❞\) ≥ 10\) ⇒ S21\(ς\)$
1010
^\(\d+\) ∀ ς : state \. S21\(ς\) ⇒ \(ς\(❝main::1::x❞\) ≥ 5\)$
1111
^\(\d+\) ∀ ς : state \. S22\(ς\) ⇒ \(ς\(❝main::1::x❞\) ≥ 15\)$
12-
^\(\d+\) ∀ ς : state \. S24\(ς\) ⇒ S25\(ς\[❝return'❞:=nondet::S25\]\)$
12+
^\(\d+\) ∀ ς : state \. S24\(ς\) ⇒ S25\(ς\[❝return'❞:=nondet::S25-0\]\)$
1313
^\[main\.assertion\.1\] line \d+ property 1: SUCCESS$
1414
^\[main\.assertion\.2\] line \d+ property 2: REFUTED$
1515
--

regression/cprover/basic/basic1.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
basic1.c
3-
--text --solve
3+
--text --solve --inline
44
^EXIT=0$
55
^SIGNAL=0$
66
^ \(\d+\) ∀ ς : state \. true ⇒ SInitial\(ς\)$

regression/cprover/basic/basic2.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
basic2.c
3-
--text --solve
3+
--text --solve --inline
44
^EXIT=0$
55
^SIGNAL=0$
66
^\(\d+\) ∀ ς : state \. S17\(ς\) ⇒ S18\(ς\[❝x❞:=0\]\)$

regression/cprover/basic/basic3.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
basic3.c
3-
--text --solve
3+
--text --solve --inline
44
^EXIT=0$
55
^SIGNAL=0$
66
\(\d+\) ∀ ς : state \. S17\(ς\) ⇒ S18\(ς\[❝x❞:=0\]\)

regression/cprover/basic/basic4.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
basic4.c
3-
--text --solve
3+
--text --solve --inline
44
^EXIT=10$
55
^SIGNAL=0$
66
^\(\d+\) ∀ ς : state \. S17\(ς\) ⇒ S18\(ς\[❝x❞:=0\]\)$

regression/cprover/basic/basic5.desc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
CORE
22
basic5.c
3-
--text --solve
3+
--text --solve --inline
44
^EXIT=10$
55
^SIGNAL=0$
66
^\(\d+\) ∀ ς : state \. S21\(ς\) ⇒ S22\(ς\[❝main::1::c1❞:=ς\(❝main::1::x❞\) ≥ 10\]\)$
7-
^\(\d+\) S23 = S22$
7+
^\(\d+\) ∀ ς : state \. S22\(ς\) ⇒ S23\(enter_scope_state\(ς, ❝main::1::c2❞\)\)$
88
^\(\d+\) ∀ ς : state \. S23\(ς\) ⇒ S24\(ς\[❝main::1::c2❞:=ς\(❝main::1::x❞\) ≥ 5\]\)$
99
^\(\d+\) ∀ ς : state \. S24\(ς\) ⇒ \(ς\(❝main::1::c1❞\) ⇒ ς\(❝main::1::c2❞\)\)$
1010
^\(\d+\) S25 = S24$

regression/cprover/basic/basic6.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
basic6.c
3-
--text --solve
3+
--text --solve --inline
44
^EXIT=0$
55
^SIGNAL=0$
66
^\(23\) ∀ ς : state \. S20\(ς\) ⇒ S21\(ς\[❝x❞:=1\]\)$

regression/cprover/basic/extern1.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
struct S
2+
{
3+
int x, y;
4+
};
5+
6+
extern struct S some_struct;
7+
8+
int main()
9+
{
10+
// should fail
11+
__CPROVER_assert(some_struct.x == some_struct.y, "property 1");
12+
return 0;
13+
}

regression/cprover/basic/extern1.desc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CORE
2+
extern1.c
3+
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
^\[main\.assertion\.1\] line \d+ property 1: REFUTED$
7+
--

regression/cprover/basic/nondet1.desc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
CORE
22
nondet1.c
3-
--text --solve
3+
--text --solve --inline
44
^EXIT=10$
55
^SIGNAL=0$
6-
^\(\d+\) ∀ ς : state \. S21\(ς\) ⇒ S22\(ς\[❝main::1::x❞:=nondet::S22\]\)$
6+
^\(\d+\) ∀ ς : state \. S21\(ς\) ⇒ S22\(ς\[❝main::1::x❞:=nondet::S22-0\]\)$
77
^\(\d+\) ∀ ς : state \. S22\(ς\) ⇒ \(ς\(❝main::1::x❞\) = 20\)$
88
^\(\d+\) S23 = S22$
9-
^\(\d+\) ∀ ς : state \. S23\(ς\) ⇒ S24\(ς\[❝main::1::y❞:=nondet::S24\]\)$
9+
^\(\d+\) ∀ ς : state \. S23\(ς\) ⇒ S24\(ς\[❝main::1::y❞:=nondet::S24-0\]\)$
1010
^\(\d+\) ∀ ς : state \. S24\(ς\) ⇒ \(ς\(❝main::1::x❞\) = ς\(❝main::1::y❞\)\)$
1111
^\(\d+\) S25 = S24$
1212
^\(\d+\) ∀ ς : state \. S25\(ς\) ⇒ S26\(ς\[❝return'❞:=0\]\)$

regression/cprover/branching/branching1.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
branching1.c
3-
--text --solve
3+
--text --solve --inline
44
^EXIT=10$
55
^SIGNAL=0$
66
^\(\d+\) ∀ ς : state \. \(S20\(ς\) ∧ ¬\(ς\(❝main::1::x❞\) ≥ 5\)\) ⇒ S21T\(\ς\)$

regression/cprover/branching/branching2.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
branching2.c
3-
--text --solve
3+
--text --solve --inline
44
^EXIT=10$
55
^SIGNAL=0$
66
^\(\d+\) ∀ ς : state \. \(S21\(ς\) ∧ ¬\(ς\(❝main::1::a❞\) ≥ 5\)\) ⇒ S22T\(ς\)$

regression/cprover/cstrings/cstring_is_memory_safe1.desc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ cstring_is_memory_safe1.c
33
--safety
44
^EXIT=10$
55
^SIGNAL=0$
6-
^\[main\.pointer\.1\] line \d+ pointer safe: SUCCESS$
7-
^\[main\.pointer\.2\] line \d+ pointer safe: REFUTED$
6+
^\[main\.pointer\.1\] line \d+ pointer p safe: SUCCESS$
7+
^\[main\.pointer\.2\] line \d+ pointer .* safe: REFUTED$
88
--

regression/cprover/cstrings/cstring_is_memory_safe2.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ cstring_is_memory_safe2.c
33
--safety
44
^EXIT=0$
55
^SIGNAL=0$
6-
^\[main\.pointer\.1\] line \d+ pointer safe: SUCCESS$
6+
^\[main\.pointer\.1\] line \d+ pointer .* safe: SUCCESS$
77
--

regression/cprover/cstrings/cstring_is_memory_safe3.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ cstring_is_memory_safe3.c
33
--safety
44
^EXIT=0$
55
^SIGNAL=0$
6-
^\[main\.pointer\.1\] line \d+ pointer safe: SUCCESS$
6+
^\[main\.pointer\.1\] line \d+ pointer .* safe: SUCCESS$
77
--
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const char *HEX_CHARS = "0123456789abcdef";
2+
3+
int main()
4+
{
5+
unsigned char input;
6+
char output;
7+
8+
output = HEX_CHARS[input & 0xf];
9+
10+
return 0;
11+
}

regression/cprover/aws-c-common/todo/aws_hash_table_eq.desc renamed to regression/cprover/cstrings/string_literal2.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CORE
2-
aws_hash_table_eq_contract.c
2+
string_literal2.c
33
--safety
44
^EXIT=0$
55
^SIGNAL=0$
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
int main()
2+
{
3+
char *p = "0123";
4+
__CPROVER_assert(__CPROVER_r_ok(p), "property 1"); // passes
5+
__CPROVER_assert(__CPROVER_w_ok(p), "property 2"); // fails
6+
return 0;
7+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
string_literal3.c
3+
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
^\[main\.assertion\.1\] line \d+ property 1: SUCCESS$
7+
^\[main\.assertion\.2\] line \d+ property 2: REFUTED$
8+
--
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
int main()
2+
{
3+
char *p = "0123";
4+
__CPROVER_assert(__CPROVER_OBJECT_SIZE(p) == 5, "property 1"); // passes
5+
__CPROVER_assert(__CPROVER_LIVE_OBJECT(p), "property 2"); // passes
6+
return 0;
7+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
CORE
2+
string_literal4.c
3+
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
--

regression/cprover/float/basic-float1.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
basic-float1.c
3-
--text --solve
3+
--text --solve --inline
44
^EXIT=0$
55
^SIGNAL=0$
66
^\(\d+\) ∀ ς : state \. S20\(ς\) ⇒ S21\(ς\[❝main::1::f❞:=floatbv_typecast\(1, floatbv\[32\], ς\(❝__CPROVER_rounding_mode❞\)\)\]\)$

0 commit comments

Comments
 (0)