3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-25 01:55:32 +00:00
This commit is contained in:
Nikolaj Bjorner 2021-04-02 11:48:44 -07:00
parent 1fc9a7ba84
commit cebf83c460
2 changed files with 12 additions and 2 deletions

View file

@ -2276,7 +2276,17 @@ namespace smt2 {
sort* const* sorts = sort_stack().c_ptr() + sort_spos;
expr* t = expr_stack().back();
if (is_fun) {
m_ctx.insert(id, num_vars, sorts, t);
expr_ref _t(t, m());
if (num_vars > 1) {
// variable ordering in macros follow non-standard ordering
// we have to reverse the ordering used by the parser.
var_subst sub(m(), true);
expr_ref_vector vars(m());
for (unsigned i = 0; i < num_vars; ++i)
vars.push_back(m().mk_var(i, sorts[i]));
_t = sub(_t, vars);
}
m_ctx.insert(id, num_vars, sorts, _t);
}
else {
m_ctx.model_add(id, num_vars, sorts, t);