3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-10-04 23:13:57 +00:00

add recfun rewriting, remove quantifier based recfun

This commit is contained in:
Nikolaj Bjorner 2020-04-26 12:59:51 -07:00
parent 7f1b147cba
commit f9193809ea
13 changed files with 94 additions and 143 deletions

View file

@ -0,0 +1,39 @@
/*++
Copyright (c) 2018 Microsoft Corporation
Module Name:
recfun_rewriter.cpp
Abstract:
Rewriter recursive function applications to values
Author:
Nikolaj Bjorner (nbjorner) 2020-04-26
--*/
#include "ast/rewriter/recfun_rewriter.h"
#include "ast/rewriter/var_subst.h"
br_status recfun_rewriter::mk_app_core(func_decl * f, unsigned num_args, expr * const * args, expr_ref & result) {
if (m_rec.is_defined(f)) {
for (unsigned i = 0; i < num_args; ++i) {
if (!m.is_value(args[i]))
return BR_FAILED;
}
recfun::def const& d = m_rec.get_def(f);
var_subst sub(m);
result = sub(d.get_rhs(), num_args, args);
return BR_REWRITE_FULL;
}
else {
return BR_FAILED;
}
}