File tree Expand file tree Collapse file tree 3 files changed +48
-0
lines changed
jbmc/regression/jbmc/nondet_propagation1 Expand file tree Collapse file tree 3 files changed +48
-0
lines changed Original file line number Diff line number Diff line change
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
+ --
Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments