Skip to content

Commit 42a2c73

Browse files
committed
Additional unbounded-array test that should continue to pass
This test passes without nondet-propagation, and should continue to pass if/when it is merged.
1 parent 8334ac8 commit 42a2c73

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed
Binary file not shown.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
andNot_Pass.class
3+
--depth 1600 --java-unwind-enum-static --java-max-vla-length 48 --unwind 4 --max-nondet-string-length 100 --function andNot_Pass.main
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
VERIFICATION SUCCESSFUL
7+
--
8+
--
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
class BitSet {
2+
boolean bits[];
3+
public BitSet()
4+
{
5+
int size = org.cprover.CProver.nondetInt();
6+
org.cprover.CProver.assume(size >= 0);
7+
bits = new boolean[size];
8+
}
9+
public void set(int i)
10+
{
11+
org.cprover.CProver.assume(i < bits.length);
12+
bits[i] = true;
13+
}
14+
public boolean get(int i)
15+
{
16+
if(i < bits.length)
17+
return bits[i];
18+
return false;
19+
}
20+
public void andNot(BitSet other)
21+
{
22+
for (int i = 0; i < bits.length; i++) {
23+
bits[i] = bits[i] && !other.get(i);
24+
}
25+
}
26+
}
27+
28+
public class andNot_Pass {
29+
public static void main(String args[]) {
30+
BitSet b1 = new BitSet();
31+
b1.set(1);
32+
b1.set(2);
33+
BitSet b2 = new BitSet();
34+
b2.set(0);
35+
b2.set(2);
36+
b1.andNot(b2);
37+
38+
assert(!b1.get(0));
39+
}
40+
}

0 commit comments

Comments
 (0)