3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-07-19 19:02:02 +00:00
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2020-04-06 13:03:41 -07:00
parent 07413cc928
commit 5acf4b5968

View file

@ -45,12 +45,6 @@ namespace datalog {
for (auto const& kv : m_new2old) { for (auto const& kv : m_new2old) {
func_decl* old_p = kv.m_value; func_decl* old_p = kv.m_value;
func_decl* new_p = kv.m_key; func_decl* new_p = kv.m_key;
func_interp* old_fi = alloc(func_interp, m, old_p->get_arity());
if (new_p->get_arity() == 0) {
old_fi->set_else(md->get_const_interp(new_p));
}
else {
func_interp* new_fi = md->get_func_interp(new_p); func_interp* new_fi = md->get_func_interp(new_p);
expr_ref_vector subst(m); expr_ref_vector subst(m);
var_subst vs(m, false); var_subst vs(m, false);
@ -58,7 +52,6 @@ namespace datalog {
if (!new_fi) { if (!new_fi) {
TRACE("dl", tout << new_p->get_name() << " has no value in the current model\n";); TRACE("dl", tout << new_p->get_name() << " has no value in the current model\n";);
dealloc(old_fi);
continue; continue;
} }
for (unsigned i = 0; i < old_p->get_arity(); ++i) { for (unsigned i = 0; i < old_p->get_arity(); ++i) {
@ -66,10 +59,15 @@ namespace datalog {
} }
subst.push_back(a.mk_numeral(rational(1), a.mk_real())); subst.push_back(a.mk_numeral(rational(1), a.mk_real()));
// Hedge that we don't have to handle the general case for models produced
// by Horn clause solvers.
SASSERT(!new_fi->is_partial() && new_fi->num_entries() == 0); SASSERT(!new_fi->is_partial() && new_fi->num_entries() == 0);
tmp = vs(new_fi->get_else(), subst.size(), subst.c_ptr()); tmp = vs(new_fi->get_else(), subst.size(), subst.c_ptr());
if (old_p->get_arity() == 0) {
old_model->register_decl(old_p, tmp);
}
else {
func_interp* old_fi = alloc(func_interp, m, old_p->get_arity());
// Hedge that we don't have to handle the general case for models produced
// by Horn clause solvers.
old_fi->set_else(tmp); old_fi->set_else(tmp);
old_model->register_decl(old_p, old_fi); old_model->register_decl(old_p, old_fi);
} }