6 why3 ide -C ../../why3-smt-realize.conf -P cvc4r bv-smtlib-realization.why
15 goal size_pos : size > 0
17 (* Conversions from/to integers *)
21 lemma two_power_size_val : two_power_size = pow2 size
22 lemma max_int_val : t'maxInt = two_power_size - 1
24 lemma to_uint_extensionality :
25 forall v,v':t. t'int v = t'int v' -> v = v'
27 lemma to_int_extensionality:
28 forall v,v':t. to_int v = to_int v' -> v = v'
30 lemma to_uint_bounds : forall v:t. 0 <= t'int v < two_power_size
32 lemma to_uint_of_int :
33 forall i. 0 <= i < two_power_size -> t'int (of_int i) = i
35 lemma Of_int_zero: zeros = of_int 0
37 lemma Of_int_ones: ones = of_int t'maxInt
39 goal nth_out_of_bound:
40 forall x n. size <= n <= t'maxInt -> nth x n = False
42 goal Nth_zero: forall n:int. 0 <= n < size -> nth zeros n = False
45 (forall n. ult n size_bv -> nth_bv ones n = True) &&
46 forall n. 0 <= n < size -> ult (of_int n) size_bv && nth ones n = True
48 (** Bitwise operators *)
51 forall v1 v2:t, n:int. 0 <= n < size ->
52 nth (bw_and v1 v2) n = andb (nth v1 n) (nth v2 n)
55 forall v1 v2:t, n:int. 0 <= n < size ->
56 nth (bw_or v1 v2) n = orb (nth v1 n) (nth v2 n)
59 forall v1 v2:t, n:int. 0 <= n < size ->
60 nth (bw_xor v1 v2) n = xorb (nth v1 n) (nth v2 n)
63 forall v:t, n:int. 0 <= n < size ->
64 nth (bw_not v) n = notb (nth v n)
67 forall b:t,n s:int. 0 <= s -> 0 <= n -> n+s < size ->
68 nth (lsr b s) n = nth b (n+s)
71 forall b:t,n s:int. 0 <= s -> 0 <= n -> n+s >= size ->
72 nth (lsr b s) n = False
74 goal lsr_zero: forall x. lsr x 0 = x
77 forall b:t,n s:int. 0 <= s -> 0 <= n < size -> n+s < size ->
78 nth (asr b s) n = nth b (n+s)
81 forall b:t,n s:int. 0 <= s -> 0 <= n < size -> n+s >= size ->
82 nth (asr b s) n = nth b (size-1)
84 goal asr_zero: forall x. asr x 0 = x
87 forall b:t,n s:int. 0 <= s <= n < size ->
88 nth (lsl b s) n = nth b (n-s)
91 forall b:t,n s:int. 0 <= n < s ->
92 nth (lsl b s) n = False
94 goal lsl_zero: forall x. lsl x 0 = x
96 use int.EuclideanDivision
98 goal Nth_rotate_right :
99 forall v n i. 0 <= i < size -> 0 <= n ->
100 nth (rotate_right v n) i = nth v (mod (i + n) size)
102 goal Nth_rotate_left :
103 forall v n i. 0 <= i < size -> 0 <= n ->
104 nth (rotate_left v n) i = nth v (mod (i - n) size)
107 (* comparison operators *)
109 goal ult_spec: forall x y. ult x y <-> Int.(<) (t'int x) (t'int y)
111 goal ule_spec: forall x y. ule x y <-> Int.(<=) (t'int x) (t'int y)
113 goal ugt_spec: forall x y. ugt x y <-> Int.(>) (t'int x) (t'int y)
115 goal uge_spec: forall x y. uge x y <-> Int.(>=) (t'int x) (t'int y)
117 goal slt_spec: forall x y. slt x y <-> Int.(<) (to_int x) (to_int y)
119 goal sle_spec: forall x y. sle x y <-> Int.(<=) (to_int x) (to_int y)
121 goal sgt_spec: forall x y. sgt x y <-> Int.(>) (to_int x) (to_int y)
123 goal sge_spec: forall x y. sge x y <-> Int.(>=) (to_int x) (to_int y)
125 (** Arithmetic operators *)
128 forall v1 v2. t'int (add v1 v2) = mod (Int.(+) (t'int v1) (t'int v2)) two_power_size
129 goal to_uint_add_bounded:
131 t'int v1 + t'int v2 < two_power_size ->
132 t'int (add v1 v2) = t'int v1 + t'int v2
135 forall v1 v2. t'int (sub v1 v2) = mod (Int.(-) (t'int v1) (t'int v2)) two_power_size
136 goal to_uint_sub_bounded:
138 0 <= t'int v1 - t'int v2 < two_power_size ->
139 t'int (sub v1 v2) = t'int v1 - t'int v2
142 forall v. t'int (neg v) = mod (Int.(-_) (t'int v)) two_power_size
145 forall v1 v2. t'int (mul v1 v2) = mod (Int.( * ) (t'int v1) (t'int v2)) two_power_size
146 goal to_uint_mul_bounded:
148 t'int v1 * t'int v2 < two_power_size ->
149 t'int (mul v1 v2) = t'int v1 * t'int v2
152 forall v1 v2. t'int (udiv v1 v2) = div (t'int v1) (t'int v2)
155 forall v1 v2. t'int (urem v1 v2) = mod (t'int v1) (t'int v2)
159 t'int (lsr_bv v n) = div (t'int v) (pow2 ( t'int n ))
163 t'int (lsl_bv v n) = mod (Int.( * ) (t'int v) (pow2 (t'int n))) two_power_size
167 goal eq_sub_equiv: forall a b i n:t.
168 eq_sub a b (t'int i) (t'int n)
169 <-> eq_sub_bv a b i n
171 goal Extensionality: forall x y : t [x == y]. x == y -> x = y
175 theory BVConverter_Check
177 use bv.BVConverter_32_64
179 goal toSmall_to_uint :
180 forall x. in_range x -> BV64.t'int x = BV32.t'int (toSmall x)
183 forall x. BV32.t'int x = BV64.t'int (toBig x)