@@ -403,14 +403,17 @@ static bool is_char_array(const namespacet &ns, const typet &type)
403
403
// / \param rhs: right and side of the equality
404
404
// / \return true if the assignemnt needs to be handled by the parent class
405
405
// / via `set_to`
406
- bool string_refinementt::add_axioms_for_string_assigns (
407
- const exprt &lhs, const exprt &rhs)
406
+ bool add_axioms_for_string_assigns (
407
+ replace_mapt& symbol_resolve,
408
+ std::map<exprt, std::list<exprt>> &reverse_symbol_resolve,
409
+ string_constraint_generatort& generator,
410
+ messaget::mstreamt &stream,
411
+ const namespacet &ns,
412
+ const exprt &lhs,
413
+ const exprt &rhs)
408
414
{
409
415
if (is_char_array (ns, rhs.type ()))
410
416
{
411
- for (const auto & lemma : set_char_array_equality (lhs, rhs))
412
- add_lemma (lemma, false );
413
-
414
417
if (rhs.id () == ID_symbol || rhs.id () == ID_array)
415
418
{
416
419
add_symbol_to_symbol_map (
@@ -440,7 +443,8 @@ bool string_refinementt::add_axioms_for_string_assigns(
440
443
}
441
444
else
442
445
{
443
- warning () << " ignoring char array " << from_expr (ns, " " , rhs) << eom;
446
+ stream << " ignoring char array " << from_expr (ns, " " , rhs)
447
+ << messaget::eom;
444
448
return true ;
445
449
}
446
450
}
@@ -651,8 +655,24 @@ void string_refinementt::set_to(const exprt &expr, bool value)
651
655
}
652
656
}
653
657
654
- if (value && !add_axioms_for_string_assigns (lhs, subst_rhs))
655
- return ;
658
+ if (value)
659
+ {
660
+ if (is_char_array (ns, rhs.type ()))
661
+ {
662
+ for (const auto & lemma : set_char_array_equality (lhs, rhs))
663
+ add_lemma (lemma, false );
664
+ }
665
+ const bool not_handled=add_axioms_for_string_assigns (
666
+ symbol_resolve,
667
+ reverse_symbol_resolve,
668
+ generator,
669
+ warning (),
670
+ ns,
671
+ lhs,
672
+ subst_rhs);
673
+ if (!not_handled)
674
+ return ;
675
+ }
656
676
657
677
// Push the substituted equality to the list of axioms to be given to
658
678
// supert::set_to.
0 commit comments