File tree 3 files changed +27
-6
lines changed
3 files changed +27
-6
lines changed Original file line number Diff line number Diff line change
1
+ typedef __CPROVER_fixedbv [64 ][32 ] __plant_typet ;
2
+ extern __plant_typet A0 , A1 ;
3
+
4
+ int main (void ) {
5
+ __CPROVER_assume (A0 == (__plant_typet )0.125 );
6
+ __CPROVER_assume (A1 == (__plant_typet )0.015625 );
7
+
8
+ const __plant_typet XXX1a = A0 * A1 ;
9
+ const __plant_typet XXX2a = (__plant_typet )-1 * XXX1a ;
10
+ const __plant_typet XXX2b = -0.001953125 ;
11
+ __CPROVER_assert (XXX2a == XXX2b , "" );
12
+ return 0 ;
13
+ }
Original file line number Diff line number Diff line change
1
+ CORE
2
+ main.c
3
+
4
+ ^EXIT=0$
5
+ ^SIGNAL=0$
6
+ ^VERIFICATION SUCCESSFUL$
7
+ --
8
+ ^warning: ignoring
Original file line number Diff line number Diff line change @@ -53,15 +53,15 @@ bvt boolbvt::convert_mult(const exprt &expr)
53
53
std::size_t fraction_bits=
54
54
to_fixedbv_type (expr.type ()).get_fraction_bits ();
55
55
56
- // do a sign extension by fraction_bits bits
57
- bv=bv_utils.sign_extension (bv, bv.size ()+fraction_bits);
58
-
59
56
for (exprt::operandst::const_iterator it=operands.begin ()+1 ;
60
57
it!=operands.end (); it++)
61
58
{
62
59
if (it->type ()!=expr.type ())
63
60
throw " multiplication with mixed types" ;
64
61
62
+ // do a sign extension by fraction_bits bits
63
+ bv=bv_utils.sign_extension (bv, bv.size ()+fraction_bits);
64
+
65
65
bvt op=convert_bv (*it);
66
66
67
67
if (op.size ()!=width)
@@ -70,10 +70,10 @@ bvt boolbvt::convert_mult(const exprt &expr)
70
70
op=bv_utils.sign_extension (op, bv.size ());
71
71
72
72
bv=bv_utils.signed_multiplier (bv, op);
73
- }
74
73
75
- // cut it down again
76
- bv.erase (bv.begin (), bv.begin ()+fraction_bits);
74
+ // cut it down again
75
+ bv.erase (bv.begin (), bv.begin ()+fraction_bits);
76
+ }
77
77
78
78
return bv;
79
79
}
You can’t perform that action at this time.
0 commit comments