mirror of
https://github.com/Z3Prover/z3
synced 2025-06-28 08:58:44 +00:00
remove using insert_if_not_there2
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
9ea1cf3c5c
commit
a884201d62
47 changed files with 172 additions and 208 deletions
|
@ -65,14 +65,14 @@ std::ostream& expr_substitution::display(std::ostream& out) {
|
|||
}
|
||||
|
||||
void expr_substitution::insert(expr * c, expr * def, proof * def_pr, expr_dependency * def_dep) {
|
||||
obj_map<expr, expr*>::obj_map_entry * entry = m_subst.insert_if_not_there2(c, nullptr);
|
||||
expr*& value = m_subst.insert_if_not_there(c, nullptr);
|
||||
SASSERT(!def_pr || to_app(m_manager.get_fact(def_pr))->get_arg(0) == c);
|
||||
SASSERT(!def_pr || to_app(m_manager.get_fact(def_pr))->get_arg(1) == def);
|
||||
if (entry->get_data().m_value == nullptr) {
|
||||
if (value == nullptr) {
|
||||
// new entry
|
||||
m_manager.inc_ref(c);
|
||||
m_manager.inc_ref(def);
|
||||
entry->get_data().m_value = def;
|
||||
value = def;
|
||||
if (proofs_enabled()) {
|
||||
SASSERT(!m_subst_pr->contains(c));
|
||||
m_subst_pr->insert(c, def_pr);
|
||||
|
@ -87,8 +87,8 @@ void expr_substitution::insert(expr * c, expr * def, proof * def_pr, expr_depend
|
|||
else {
|
||||
// replacing entry
|
||||
m_manager.inc_ref(def);
|
||||
m_manager.dec_ref(entry->get_data().m_value);
|
||||
entry->get_data().m_value = def;
|
||||
m_manager.dec_ref(value);
|
||||
value = def;
|
||||
if (proofs_enabled()) {
|
||||
obj_map<expr, proof*>::obj_map_entry * entry_pr = m_subst_pr->find_core(c);
|
||||
SASSERT(entry_pr != nullptr);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue