Skip to content

Commit f8a3b6f

Browse files
fix #7102
1 parent 2af1cff commit f8a3b6f

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

src/model/model_evaluator.cpp

+20-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Revision History:
2020
#include "ast/ast_util.h"
2121
#include "ast/for_each_expr.h"
2222
#include "ast/recfun_decl_plugin.h"
23+
#include "ast/polymorphism_util.h"
2324
#include "ast/rewriter/rewriter_types.h"
2425
#include "ast/rewriter/bool_rewriter.h"
2526
#include "ast/rewriter/arith_rewriter.h"
@@ -371,7 +372,20 @@ struct evaluator_cfg : public default_rewriter_cfg {
371372
bool get_macro(func_decl * f, expr * & def, quantifier * & , proof * &) {
372373
func_interp * fi = m_model.get_func_interp(f);
373374
def = nullptr;
374-
if (fi != nullptr) {
375+
if (fi) {
376+
if (fi->is_partial()) {
377+
if (m_model_completion) {
378+
sort * s = f->get_range();
379+
expr * val = m_model.get_some_value(s);
380+
fi->set_else(val);
381+
}
382+
else
383+
return false;
384+
}
385+
def = fi->get_interp();
386+
SASSERT(def != nullptr);
387+
}
388+
else if (f->is_polymorphic() && (fi = m_model.get_func_interp(m.poly_root(f)))) {
375389
if (fi->is_partial()) {
376390
if (m_model_completion) {
377391
sort * s = f->get_range();
@@ -382,7 +396,12 @@ struct evaluator_cfg : public default_rewriter_cfg {
382396
return false;
383397
}
384398
def = fi->get_interp();
399+
polymorphism::substitution subst(m);
400+
polymorphism::util util(m);
401+
util.unify(f, m.poly_root(f), subst);
402+
def = subst(def);
385403
SASSERT(def != nullptr);
404+
386405
}
387406
else if (m_model_completion &&
388407
(f->get_family_id() == null_family_id ||

0 commit comments

Comments
 (0)