@@ -826,35 +826,35 @@ std::string string_refinementt::string_of_array(const array_exprt &arr)
826826 return result.str ();
827827}
828828
829- // / Fill in `current_model` by mapping the variables created by the solver to
830- // / constant expressions given by the current model
831- void string_refinementt::fill_model ()
829+ // / Display part of the current model by mapping the variables created by the
830+ // / solver to constant expressions given by the current model
831+ void string_refinementt::debug_model ()
832832{
833+ const std::string indent (" " );
833834 for (auto it : symbol_resolve)
834835 {
835836 if (refined_string_typet::is_refined_string_type (it.second .type ()))
836837 {
838+ debug () << " - " << from_expr (ns, " " , to_symbol_expr (it.first )) << " :\n " ;
837839 string_exprt refined=to_string_expr (it.second );
838- // TODO: check whith this is necessary:
839- replace_expr (symbol_resolve, refined);
840+ debug () << indent << indent << " in_map: "
841+ << from_expr (ns, " " , refined) << eom;
842+ debug () << indent << indent << " resolved: "
843+ << from_expr (ns, " " , refined) << eom;
840844 const exprt &econtent=refined.content ();
841845 const exprt &elength=refined.length ();
842846
843847 exprt len=supert::get (elength);
844848 len=simplify_expr (len, ns);
845849 exprt arr=get_array (econtent, len);
846-
847- current_model[elength]=len;
848- current_model[econtent]=arr;
849- debug () << from_expr (ns, " " , to_symbol_expr (it.first )) << " ="
850- << from_expr (ns, " " , refined);
851-
852850 if (arr.id ()==ID_array)
853- debug () << " = \" " << string_of_array ( to_array_expr (arr))
854- << " \" (size: " << from_expr (ns, " " , len) << " ) " << eom ;
851+ debug () << indent << indent << " as_string: \" "
852+ << string_of_array ( to_array_expr (arr)) << " \"\n " ;
855853 else
856- debug () << " = " << from_expr (ns, " " , arr)
857- << " (size:" << from_expr (ns, " " , len) << " )" << eom;
854+ debug () << indent << indent << " as_char_array: "
855+ << from_expr (ns, " " , arr) << " \n " ;
856+
857+ debug () << indent << indent << " size: " << from_expr (ns, " " , len) << eom;
858858 }
859859 else
860860 {
@@ -865,32 +865,28 @@ void string_refinementt::fill_model()
865865 " handled" ));
866866 exprt arr=it.second ;
867867 replace_expr (symbol_resolve, arr);
868- replace_expr (current_model, arr);
868+ debug () << " - " << from_expr (ns, " " , to_symbol_expr (it.first )) << " :\n " ;
869+ debug () << indent << indent << " resolved: "
870+ << from_expr (ns, " " , arr) << " \n " ;
869871 exprt arr_model=get_array (arr);
870- current_model[it.first ]=arr_model;
871-
872- debug () << from_expr (ns, " " , to_symbol_expr (it.first )) << " ="
873- << from_expr (ns, " " , arr) << " = "
874- << from_expr (ns, " " , arr_model) << " " << eom;
872+ debug () << indent << indent << " char_array: "
873+ << from_expr (ns, " " , arr_model) << eom;
875874 }
876875 }
877876
878877 for (auto it : generator.boolean_symbols )
879878 {
880- debug () << " " << it.get_identifier () << " := "
879+ debug () << " - " << it.get_identifier () << " : "
881880 << from_expr (ns, " " , supert::get (it)) << eom;
882- current_model[it]=supert::get (it);
883881 }
884882
885883 for (auto it : generator.index_symbols )
886884 {
887- debug () << " " << it.get_identifier () << " := "
888- << from_expr (ns, " " , supert::get (it)) << eom;
889- current_model[it]=supert::get (it);
885+ debug () << " - " << it.get_identifier () << " : "
886+ << from_expr (ns, " " , supert::get (it)) << eom;
890887 }
891888}
892889
893-
894890// / Create a new expression where 'with' expressions on arrays are replaced by
895891// / 'if' expressions. e.g. for an array access arr[x], where: `arr :=
896892// / array_of(12) with {0:=24} with {2:=42}` the constructed expression will be:
@@ -1125,7 +1121,7 @@ bool string_refinementt::check_axioms()
11251121 << " ===========================================" << eom;
11261122 debug () << " string_refinementt::check_axioms: build the"
11271123 << " interpretation from the model of the prop_solver" << eom;
1128- fill_model ();
1124+ debug_model ();
11291125
11301126 // Maps from indexes of violated universal axiom to a witness of violation
11311127 std::map<size_t , exprt> violated;
0 commit comments