mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 17:15:31 +00:00
Merge remote-tracking branch 'origin/master' into polysat
This commit is contained in:
commit
8774952aeb
40 changed files with 708 additions and 189 deletions
|
@ -60,7 +60,7 @@ namespace recfun {
|
|||
func_decl_ref m_pred; //<! predicate used for this case
|
||||
expr_ref_vector m_guards; //<! conjunction that is equivalent to this case
|
||||
expr_ref m_rhs; //<! if guard is true, `f(t1...tn) = rhs` holds
|
||||
def * m_def; //<! definition this is a part of
|
||||
def * m_def = nullptr;; //<! definition this is a part of
|
||||
bool m_immediate = false; //<! does `rhs` contain no defined_fun/case_pred?
|
||||
|
||||
case_def(ast_manager& m):
|
||||
|
|
|
@ -90,7 +90,8 @@ public:
|
|||
* Freeze internal functions
|
||||
*/
|
||||
void freeze(expr* term);
|
||||
bool frozen(func_decl* f) const { return m_frozen.is_marked(f); }
|
||||
void freeze(expr_ref_vector const& terms) { for (expr* t : terms) freeze(t); }
|
||||
bool frozen(func_decl* f) const { return m_frozen.is_marked(f); }
|
||||
bool frozen(expr* f) const { return is_app(f) && m_frozen.is_marked(to_app(f)->get_decl()); }
|
||||
void freeze_suffix();
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ expr_ref dominator_simplifier::simplify_ite(app * ite) {
|
|||
if (is_subexpr(child, t) && !is_subexpr(child, e))
|
||||
simplify_rec(child);
|
||||
|
||||
pop(scope_level() - old_lvl);
|
||||
local_pop(scope_level() - old_lvl);
|
||||
expr_ref new_t = simplify_arg(t);
|
||||
reset_cache();
|
||||
if (!assert_expr(new_c, true)) {
|
||||
|
@ -50,7 +50,7 @@ expr_ref dominator_simplifier::simplify_ite(app * ite) {
|
|||
for (expr * child : tree(ite))
|
||||
if (is_subexpr(child, e) && !is_subexpr(child, t))
|
||||
simplify_rec(child);
|
||||
pop(scope_level() - old_lvl);
|
||||
local_pop(scope_level() - old_lvl);
|
||||
expr_ref new_e = simplify_arg(e);
|
||||
|
||||
if (c == new_c && t == new_t && e == new_e) {
|
||||
|
@ -159,7 +159,7 @@ expr_ref dominator_simplifier::simplify_and_or(bool is_and, app * e) {
|
|||
r = simplify_arg(arg);
|
||||
args.push_back(r);
|
||||
if (!assert_expr(r, !is_and)) {
|
||||
pop(scope_level() - old_lvl);
|
||||
local_pop(scope_level() - old_lvl);
|
||||
r = is_and ? m.mk_false() : m.mk_true();
|
||||
reset_cache();
|
||||
return true;
|
||||
|
@ -181,7 +181,7 @@ expr_ref dominator_simplifier::simplify_and_or(bool is_and, app * e) {
|
|||
args.reverse();
|
||||
}
|
||||
|
||||
pop(scope_level() - old_lvl);
|
||||
local_pop(scope_level() - old_lvl);
|
||||
reset_cache();
|
||||
return { is_and ? mk_and(args) : mk_or(args), m };
|
||||
}
|
||||
|
@ -191,7 +191,7 @@ expr_ref dominator_simplifier::simplify_not(app * e) {
|
|||
ENSURE(m.is_not(e, ee));
|
||||
unsigned old_lvl = scope_level();
|
||||
expr_ref t = simplify_rec(ee);
|
||||
pop(scope_level() - old_lvl);
|
||||
local_pop(scope_level() - old_lvl);
|
||||
reset_cache();
|
||||
return mk_not(t);
|
||||
}
|
||||
|
@ -245,7 +245,7 @@ void dominator_simplifier::reduce() {
|
|||
}
|
||||
m_fmls.update(i, dependent_expr(m, r, new_pr, d));
|
||||
}
|
||||
pop(scope_level());
|
||||
local_pop(scope_level());
|
||||
|
||||
// go backwards
|
||||
m_forward = false;
|
||||
|
@ -268,7 +268,7 @@ void dominator_simplifier::reduce() {
|
|||
}
|
||||
m_fmls.update(i, dependent_expr(m, r, new_pr, d));
|
||||
}
|
||||
pop(scope_level());
|
||||
local_pop(scope_level());
|
||||
}
|
||||
SASSERT(scope_level() == 0);
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ class dominator_simplifier : public dependent_expr_simplifier {
|
|||
expr* idom(expr *e) const { return m_dominators.idom(e); }
|
||||
|
||||
unsigned scope_level() { return m_simplifier->scope_level(); }
|
||||
void pop(unsigned n) { SASSERT(n <= m_simplifier->scope_level()); m_simplifier->pop(n); }
|
||||
void local_pop(unsigned n) { SASSERT(n <= m_simplifier->scope_level()); m_simplifier->pop(n); }
|
||||
bool assert_expr(expr* f, bool sign) { return m_simplifier->assert_expr(f, sign); }
|
||||
|
||||
|
||||
|
|
|
@ -567,9 +567,9 @@ void eliminate_predicates::try_find_macro(clause& cl) {
|
|||
return false;
|
||||
app* x = to_app(_x);
|
||||
return
|
||||
can_be_quasi_macro_head(x, cl.m_bound.size()) &&
|
||||
is_macro_safe(y) &&
|
||||
!occurs(x->get_decl(), y);
|
||||
can_be_quasi_macro_head(x, cl.m_bound.size()) &&
|
||||
is_macro_safe(y) &&
|
||||
!occurs(x->get_decl(), y);
|
||||
};
|
||||
|
||||
if (cl.is_unit() && m.is_eq(cl.atom(0), x, y)) {
|
||||
|
@ -592,7 +592,8 @@ void eliminate_predicates::try_find_macro(clause& cl) {
|
|||
}
|
||||
if (cl.is_unit()) {
|
||||
expr* body = cl.sign(0) ? m.mk_false() : m.mk_true();
|
||||
if (can_be_qdef(cl.atom(0), body)) {
|
||||
expr* x = cl.atom(0);
|
||||
if (can_be_qdef(x, body)) {
|
||||
insert_quasi_macro(to_app(x), body, cl);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -780,7 +780,6 @@ void demodulator_rewriter::operator()(expr_ref_vector const& exprs,
|
|||
|
||||
|
||||
demodulator_match_subst::demodulator_match_subst(ast_manager & m):
|
||||
m(m),
|
||||
m_subst(m) {
|
||||
}
|
||||
|
||||
|
|
|
@ -111,7 +111,6 @@ class demodulator_match_subst {
|
|||
typedef std::pair<expr *, expr *> expr_pair;
|
||||
typedef obj_pair_hashtable<expr, expr> cache;
|
||||
|
||||
ast_manager & m;
|
||||
substitution m_subst;
|
||||
cache m_cache;
|
||||
svector<expr_pair> m_todo;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue