File tree Expand file tree Collapse file tree 3 files changed +18
-15
lines changed
regression/ebmc/smv-netlist Expand file tree Collapse file tree 3 files changed +18
-15
lines changed Original file line number Diff line number Diff line change 11CORE
22s_until1.sv
33--smv-netlist
4- ^LTLSPEC \(\!node144\) U node151 $
5- ^LTLSPEC TRUE U node158 $
4+ ^LTLSPEC \(\!node144\) U node51 $
5+ ^LTLSPEC TRUE U node151 $
66^EXIT=0$
77^SIGNAL=0$
88--
Original file line number Diff line number Diff line change @@ -264,7 +264,22 @@ void convert_trans_to_netlistt::map_vars(
264264 }
265265 };
266266
267- for_all_module_symbols (symbol_table, module , update_dest_var_map);
267+ // get the symbols in the given module
268+ std::vector<const symbolt *> module_symbols;
269+
270+ for (const auto &symbol_it : symbol_table.symbols )
271+ if (symbol_it.second .module == module )
272+ module_symbols.push_back (&symbol_it.second );
273+
274+ // we sort them to get a stable netlist
275+ std::sort (
276+ module_symbols.begin (),
277+ module_symbols.end (),
278+ [](const symbolt *a, const symbolt *b)
279+ { return a->name .compare (b->name ) < 0 ; });
280+
281+ for (auto symbol_ptr : module_symbols)
282+ update_dest_var_map (*symbol_ptr);
268283}
269284
270285/* ******************************************************************\
Original file line number Diff line number Diff line change 1515
1616#include <solvers/sat/cnf.h>
1717
18- template <typename F>
19- void for_all_module_symbols (const symbol_tablet &symbol_table,
20- const irep_idt &module_name, F &&f) {
21- using symbol_pairt = typename symbol_tablet::iteratort::value_type;
22- std::for_each (symbol_table.begin (), symbol_table.end (),
23- [&module_name, &f](const symbol_pairt &symbol_pair) {
24- const auto &symbol = symbol_pair.second ;
25- if (symbol.module == module_name)
26- f (symbol);
27- });
28- }
29-
3018// This function is legacy, and will be gradually removed.
3119// Consider to_integer(constant_exprt, mp_integer &) or numerical_cast<mp_integer>(...).
3220inline bool to_integer_non_constant (const exprt & expr , mp_integer & int_value )
You can’t perform that action at this time.
0 commit comments