20 std::pair<symbolst::iterator, bool> result=
22 symbolt &new_symbol=result.first->second;
29 if(!new_symbol.module.empty())
34 new_symbol.module, new_symbol.
name);
49 return std::make_pair(std::ref(new_symbol), result.second);
81 result.first.swap(symbol);
84 new_symbol=&result.first;
85 return !result.second;
92 const symbolt &symbol=entry->second;
100 "symbolt::base_name should not be changed "
101 "after it is added to the symbol_table "
106 if(!symbol.module.empty())
114 "symbolt::module should not be changed "
115 "after it is added to the symbol_table "
136 const auto &symbol =
elem.second;
140 vm, symbol.is_well_formed(),
"Symbol is malformed: ",
symbol_key);
146 "Symbol table entry must map to a symbol with the correct identifier",
147 "Symbol table key '",
149 "' maps to symbol '",
154 if(!symbol.base_name.empty())
162 [&
symbol_key](
const symbol_base_mapt::value_type &match) {
163 return match.second == symbol_key;
169 "The base_name of a symbol should map to itself",
170 "Symbol table key '",
172 "' has a base_name '",
174 "' which does not map to itself");
178 if(!symbol.module.empty())
185 [&
symbol_key](
const symbol_module_mapt::value_type &match) {
186 return match.second == symbol_key;
192 "Symbol table module map should map to symbol",
193 "Symbol table key '",
195 "' has a module name of '",
197 "' which does not map to itself");
207 "Symbol table base_name map entries must map to a symbol name",
208 "base_name map entry '",
210 "' maps to non-existant symbol name '",
221 "Symbol table module map entries must map to a symbol name",
222 "base_name map entry '",
224 "' maps to non-existant symbol name '",
237 std::vector<std::pair<irep_idt, irep_idt>>
v1(
240 std::vector<std::pair<irep_idt, irep_idt>>
v2(
244 std::sort(
v1.begin(),
v1.end());
245 std::sort(
v2.begin(),
v2.end());
252 std::vector<std::pair<irep_idt, irep_idt>>
v1(
255 std::vector<std::pair<irep_idt, irep_idt>>
v2(
259 std::sort(
v1.begin(),
v1.end());
260 std::sort(
v2.begin(),
v2.end());
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
const symbol_base_mapt & symbol_base_map
Read-only field, used to look up symbol names given their base names.
const symbol_module_mapt & symbol_module_map
Read-only field, used to look up symbol names given their modules.
const symbolst & symbols
Read-only field, used to look up symbols given their names.
bool has_symbol(const irep_idt &name) const
Check whether a symbol exists in the symbol table.
bool operator==(const symbol_tablet &other) const
symbolst internal_symbols
Value referenced by symbol_table_baset::symbols.
virtual void erase(const symbolst::const_iterator &entry) override
Remove a symbol from the symbol table.
symbol_module_mapt internal_symbol_module_map
Value referenced by symbol_table_baset::symbol_module_map.
virtual bool move(symbolt &symbol, symbolt *&new_symbol) override
Move a symbol into the symbol table.
symbol_base_mapt internal_symbol_base_map
Value referenced by symbol_table_baset::symbol_base_map.
virtual std::pair< symbolt &, bool > insert(symbolt symbol) override
Author: Diffblue Ltd.
void validate(const validation_modet vm=validation_modet::INVARIANT) const override
Check that the symbol table is well-formed.
irep_idt name
The unique identifier.
irep_idt irep_idt base_name
Name of module the symbol belongs to.
const std::string & id2string(const irep_idt &d)
#define INVARIANT(CONDITION, REASON)
This macro uses the wrapper function 'invariant_violated_string'.
#define DATA_CHECK_WITH_DIAGNOSTICS(vm, condition, message,...)