@@ -3476,7 +3476,7 @@ void smt2_convt::convert_with(const with_exprt &expr)
3476
3476
{
3477
3477
std::size_t s=expr.operands ().size ();
3478
3478
3479
- // strip of the trailing two operands
3479
+ // strip off the trailing two operands
3480
3480
with_exprt tmp = expr;
3481
3481
tmp.operands ().resize (s-2 );
3482
3482
@@ -3515,7 +3515,7 @@ void smt2_convt::convert_with(const with_exprt &expr)
3515
3515
std::size_t sub_width=boolbv_width (array_type.subtype ());
3516
3516
std::size_t index_width=boolbv_width (expr.where ().type ());
3517
3517
3518
- // We mask out the updated bit with AND,
3518
+ // We mask out the updated bits with AND,
3519
3519
// and then OR-in the shifted new value.
3520
3520
3521
3521
out << " (let ((distance? " ;
@@ -3540,15 +3540,16 @@ void smt2_convt::convert_with(const with_exprt &expr)
3540
3540
3541
3541
out << " (bvor " ;
3542
3542
out << " (bvand " ;
3543
- out << " (bvlshr (_ bv" << power (2 , array_width)-1 << " "
3544
- << array_width << " ) " ;
3545
- out << " distance?) " ;
3543
+ out << " (bvnot " ;
3544
+ out << " (bvshl (_ bv" << power (2 , sub_width) - 1 << " " << array_width
3545
+ << " ) " ;
3546
+ out << " distance?)) " ; // bvnot, bvlshl
3546
3547
convert_expr (expr.old ());
3547
3548
out << " ) " ; // bvand
3548
- out << " (bvlshr " ;
3549
+ out << " (bvshl " ;
3549
3550
out << " ((_ zero_extend " << array_width-sub_width << " ) " ;
3550
3551
convert_expr (expr.new_value ());
3551
- out << " ) distance?)))" ; // zero_extend, bvlshr , bvor, let
3552
+ out << " ) distance?)))" ; // zero_extend, bvshl , bvor, let
3552
3553
}
3553
3554
}
3554
3555
else if (expr_type.id ()==ID_struct)
@@ -3588,8 +3589,9 @@ void smt2_convt::convert_with(const with_exprt &expr)
3588
3589
3589
3590
if (m.width ==struct_width)
3590
3591
{
3591
- // the struct is the same as the member, no concat needed
3592
- out << " ?withop" ;
3592
+ // the struct is the same as the member, no concat needed,
3593
+ // ?withop won't be used
3594
+ convert_expr (value);
3593
3595
}
3594
3596
else if (m.offset ==0 )
3595
3597
{
0 commit comments