@@ -40,12 +40,12 @@ Author: Daniel Kroening, kroening@kroening.com
4040// General todos
4141#define SMT2_TODO (S ) PRECONDITION_WITH_DIAGNOSTICS(false , " TODO: " S)
4242
43- void smt2_convt::print_assignment (std::ostream &out ) const
43+ void smt2_convt::print_assignment (std::ostream &os ) const
4444{
4545 // Boolean stuff
4646
4747 for (std::size_t v=0 ; v<boolean_assignment.size (); v++)
48- out << " b" << v << " =" << boolean_assignment[v] << " \n " ;
48+ os << " b" << v << " =" << boolean_assignment[v] << " \n " ;
4949
5050 // others
5151}
@@ -93,41 +93,45 @@ void smt2_convt::write_header()
9393 out << " (set-logic " << logic << " )" << " \n " ;
9494}
9595
96- void smt2_convt::write_footer (std::ostream &out )
96+ void smt2_convt::write_footer (std::ostream &os )
9797{
98- out << " \n " ;
98+ os << " \n " ;
9999
100100 // add the assumptions, if any
101101 if (!assumptions.empty ())
102102 {
103- out << " ; assumptions\n " ;
103+ os << " ; assumptions\n " ;
104104
105105 forall_literals (it, assumptions)
106106 {
107- out << " (assert " ;
107+ os << " (assert " ;
108108 convert_literal (*it);
109- out << " )" << " \n " ;
109+ os << " )"
110+ << " \n " ;
110111 }
111112 }
112113
113114 // fix up the object sizes
114115 for (const auto &object : object_sizes)
115116 define_object_size (object.second , object.first );
116117
117- out << " (check-sat)" << " \n " ;
118- out << " \n " ;
118+ os << " (check-sat)"
119+ << " \n " ;
120+ os << " \n " ;
119121
120122 if (solver!=solvert::BOOLECTOR)
121123 {
122124 for (const auto &id : smt2_identifiers)
123- out << " (get-value (|" << id << " |))" << " \n " ;
125+ os << " (get-value (|" << id << " |))"
126+ << " \n " ;
124127 }
125128
126- out << " \n " ;
129+ os << " \n " ;
127130
128- out << " (exit)\n " ;
131+ os << " (exit)\n " ;
129132
130- out << " ; end of SMT2 file" << " \n " ;
133+ os << " ; end of SMT2 file"
134+ << " \n " ;
131135}
132136
133137void smt2_convt::define_object_size (
@@ -1503,8 +1507,6 @@ void smt2_convt::convert_expr(const exprt &expr)
15031507 DATA_INVARIANT (
15041508 expr.operands ().size () == 1 , " width expression should have one operand" );
15051509
1506- boolbv_widtht boolbv_width (ns);
1507-
15081510 std::size_t result_width=boolbv_width (expr.type ());
15091511 CHECK_RETURN (result_width != 0 );
15101512
@@ -2671,8 +2673,6 @@ void smt2_convt::convert_union(const union_exprt &expr)
26712673 const union_typet &union_type = to_union_type (ns.follow (expr.type ()));
26722674 const exprt &op=expr.op ();
26732675
2674- boolbv_widtht boolbv_width (ns);
2675-
26762676 std::size_t total_width=boolbv_width (union_type);
26772677 CHECK_RETURN_WITH_DIAGNOSTICS (
26782678 total_width != 0 , " failed to get union width for union" );
@@ -3633,8 +3633,6 @@ void smt2_convt::convert_with(const with_exprt &expr)
36333633
36343634 const exprt &value=expr.op2 ();
36353635
3636- boolbv_widtht boolbv_width (ns);
3637-
36383636 std::size_t total_width=boolbv_width (union_type);
36393637 CHECK_RETURN_WITH_DIAGNOSTICS (
36403638 total_width != 0 , " failed to get union width for with" );
@@ -4453,8 +4451,6 @@ void smt2_convt::convert_type(const typet &type)
44534451 }
44544452 else
44554453 {
4456- boolbv_widtht boolbv_width (ns);
4457-
44584454 std::size_t width=boolbv_width (type);
44594455 CHECK_RETURN_WITH_DIAGNOSTICS (
44604456 width != 0 , " failed to get width of vector" );
@@ -4471,8 +4467,6 @@ void smt2_convt::convert_type(const typet &type)
44714467 }
44724468 else if (type.id () == ID_union || type.id () == ID_union_tag)
44734469 {
4474- boolbv_widtht boolbv_width (ns);
4475-
44764470 std::size_t width=boolbv_width (type);
44774471 CHECK_RETURN_WITH_DIAGNOSTICS (width != 0 , " failed to get width of union" );
44784472
@@ -4529,8 +4523,6 @@ void smt2_convt::convert_type(const typet &type)
45294523 }
45304524 else
45314525 {
4532- boolbv_widtht boolbv_width (ns);
4533-
45344526 std::size_t width=boolbv_width (type);
45354527 CHECK_RETURN_WITH_DIAGNOSTICS (
45364528 width != 0 , " failed to get width of complex" );
@@ -4806,11 +4798,11 @@ void smt2_convt::collect_bindings(
48064798 seen_expressionst &map,
48074799 std::vector<exprt> &let_order)
48084800{
4809- seen_expressionst::iterator it = map.find (expr);
4801+ seen_expressionst::iterator entry = map.find (expr);
48104802
4811- if (it!= map.end ())
4803+ if (entry != map.end ())
48124804 {
4813- let_count_idt &count_id=it ->second ;
4805+ let_count_idt &count_id = entry ->second ;
48144806 ++(count_id.count );
48154807 return ;
48164808 }
0 commit comments