@@ -3476,7 +3476,7 @@ void smt2_convt::convert_with(const with_exprt &expr)
34763476 {
34773477 std::size_t s=expr.operands ().size ();
34783478
3479- // strip of the trailing two operands
3479+ // strip off the trailing two operands
34803480 with_exprt tmp = expr;
34813481 tmp.operands ().resize (s-2 );
34823482
@@ -3515,7 +3515,7 @@ void smt2_convt::convert_with(const with_exprt &expr)
35153515 std::size_t sub_width=boolbv_width (array_type.subtype ());
35163516 std::size_t index_width=boolbv_width (expr.where ().type ());
35173517
3518- // We mask out the updated bit with AND,
3518+ // We mask out the updated bits with AND,
35193519 // and then OR-in the shifted new value.
35203520
35213521 out << " (let ((distance? " ;
@@ -3540,15 +3540,16 @@ void smt2_convt::convert_with(const with_exprt &expr)
35403540
35413541 out << " (bvor " ;
35423542 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
35463547 convert_expr (expr.old ());
35473548 out << " ) " ; // bvand
3548- out << " (bvlshr " ;
3549+ out << " (bvshl " ;
35493550 out << " ((_ zero_extend " << array_width-sub_width << " ) " ;
35503551 convert_expr (expr.new_value ());
3551- out << " ) distance?)))" ; // zero_extend, bvlshr , bvor, let
3552+ out << " ) distance?)))" ; // zero_extend, bvshl , bvor, let
35523553 }
35533554 }
35543555 else if (expr_type.id ()==ID_struct)
@@ -3588,8 +3589,9 @@ void smt2_convt::convert_with(const with_exprt &expr)
35883589
35893590 if (m.width ==struct_width)
35903591 {
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);
35933595 }
35943596 else if (m.offset ==0 )
35953597 {
0 commit comments