File tree 2 files changed +17
-8
lines changed
2 files changed +17
-8
lines changed Original file line number Diff line number Diff line change @@ -4759,12 +4759,12 @@ exprt smt2_convt::letify_rec(
4759
4759
exprt current=let_order[i];
4760
4760
assert (map.find (current)!=map.end ());
4761
4761
4762
- if (map.find (current)->second .first < LET_COUNT)
4762
+ if (map.find (current)->second .count < LET_COUNT)
4763
4763
return letify_rec (expr, let_order, map, i+1 );
4764
4764
4765
4765
let_exprt let;
4766
4766
4767
- let.symbol () = map.find (current)->second .second ;
4767
+ let.symbol () = map.find (current)->second .let_symbol ;
4768
4768
let.value () = substitute_let (current, map);
4769
4769
let.where () = letify_rec (expr, let_order, map, i+1 );
4770
4770
@@ -4781,7 +4781,7 @@ void smt2_convt::collect_bindings(
4781
4781
if (it!=map.end ())
4782
4782
{
4783
4783
let_count_idt &count_id=it->second ;
4784
- ++(count_id.first );
4784
+ ++(count_id.count );
4785
4785
return ;
4786
4786
}
4787
4787
@@ -4797,7 +4797,7 @@ void smt2_convt::collect_bindings(
4797
4797
symbol_exprt let=
4798
4798
symbol_exprt (" _let_" +std::to_string (++let_id_count), expr.type ());
4799
4799
4800
- map.insert (std::make_pair (expr, std::make_pair (1 , let)));
4800
+ map.insert (std::make_pair (expr, let_count_idt (1 , let)));
4801
4801
4802
4802
let_order.push_back (expr);
4803
4803
}
Original file line number Diff line number Diff line change @@ -170,7 +170,17 @@ class smt2_convt:public prop_convt
170
170
void find_symbols_rec (const typet &type, std::set<irep_idt> &recstack);
171
171
172
172
// letification
173
- typedef std::pair<unsigned , symbol_exprt> let_count_idt;
173
+ struct let_count_idt
174
+ {
175
+ let_count_idt (std::size_t _count, const symbol_exprt &_let_symbol)
176
+ : count(_count), let_symbol(_let_symbol)
177
+ {
178
+ }
179
+
180
+ std::size_t count;
181
+ symbol_exprt let_symbol;
182
+ };
183
+
174
184
typedef std::unordered_map<exprt, let_count_idt, irep_hash> seen_expressionst;
175
185
unsigned let_id_count;
176
186
static const unsigned LET_COUNT=2 ;
@@ -185,10 +195,9 @@ class smt2_convt:public prop_convt
185
195
void operator ()(exprt &expr)
186
196
{
187
197
seen_expressionst::const_iterator it=let_map.find (expr);
188
- if (it!=let_map.end () &&
189
- it->second .first >=LET_COUNT)
198
+ if (it != let_map.end () && it->second .count >= LET_COUNT)
190
199
{
191
- symbol_exprt symb= it->second .second ;
200
+ const symbol_exprt & symb = it->second .let_symbol ;
192
201
expr=symb;
193
202
}
194
203
}
You can’t perform that action at this time.
0 commit comments