Skip to content

Commit c5c8e62

Browse files
committed
Add regression tests for simplification of singleton intervals
1 parent 8e82b4d commit c5c8e62

File tree

4 files changed

+67
-0
lines changed

4 files changed

+67
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
CORE
2+
--trace
3+
singleton_interval_simp_neg.c
4+
^VERIFICATION FAILED$
5+
^\[main\.assertion\.1\] line \d expected failure: paths where x is unbounded explored: FAILURE$
6+
^\[main\.assertion\.2\] line \d+ expected failure: paths where 0 \<= x \<= 15 explored: FAILURE$
7+
^\[main\.assertion\.3\] line \d+ expected success: paths where x \<= 15 explored: SUCCESS$
8+
y=-6 \(11111111 11111111 11111111 11111010\)
9+
x=14 \(00000000 00000000 00000000 00001110\)
10+
y=34 \(00000000 00000000 00000000 00100010\)
11+
^EXIT=10$
12+
^SIGNAL=0$
13+
--
14+
--
15+
This tests the negative case of the simplification of the singleton interval
16+
(i.e when the presented interval *is* the *not* the singleton interval -
17+
the set of possible values that the bounded variable can take has cardinality
18+
> 1).
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
CORE
2+
--trace
3+
singleton_interval_simp.c
4+
^VERIFICATION FAILED$
5+
^\[main\.assertion\.1\] line \d+ expected failure: only paths where x == 15 explored: FAILURE$
6+
^\[main\.assertion\.2\] line \d+ expected failure: only paths where x == 15 explored: FAILURE$
7+
x=15 \(00000000 00000000 00000000 00001111\)
8+
y=35 \(00000000 00000000 00000000 00100011\)
9+
^EXIT=10$
10+
^SIGNAL=0$
11+
--
12+
--
13+
This tests the positive case of the simplification of the singleton interval
14+
(i.e when the presented interval *is* the singleton interval)
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Positive test for singleton interval simplification.
2+
// Notice that the sequence of the inequalities in this
3+
// expression is different to the one in
4+
// `singleton_interval_in_assume_7690.c`.
5+
6+
int main()
7+
{
8+
int x;
9+
__CPROVER_assume(x >= 15 && x <= 15);
10+
int y = x + 20;
11+
12+
__CPROVER_assert(
13+
y != 35, "expected failure: only paths where x == 15 explored");
14+
__CPROVER_assert(
15+
y == 34, "expected failure: only paths where x == 15 explored");
16+
return 0;
17+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Negative test for singleton interval simplification.
2+
3+
int main()
4+
{
5+
int x;
6+
int y = x + 20;
7+
8+
__CPROVER_assert(
9+
y != -6, "expected failure: paths where x is unbounded explored");
10+
11+
__CPROVER_assume(x >= 0 && x <= 15);
12+
__CPROVER_assert(
13+
y != 34, "expected failure: paths where 0 <= x <= 15 explored");
14+
15+
int z = x + 20;
16+
__CPROVER_assert(z != 36, "expected success: paths where x <= 15 explored");
17+
return 0;
18+
}

0 commit comments

Comments
 (0)