mirror of
https://github.com/Z3Prover/z3
synced 2025-04-29 11:55:51 +00:00
integrate lambda expressions
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
bf4edef761
commit
520ce9a5ee
139 changed files with 2243 additions and 1506 deletions
|
@ -109,10 +109,17 @@ protected:
|
|||
m_stats["quantifiers"]++;
|
||||
SASSERT(is_app(q->get_expr()));
|
||||
app * body = to_app(q->get_expr());
|
||||
if (q->is_forall())
|
||||
switch (q->get_kind()) {
|
||||
case forall_k:
|
||||
m_stats["forall-variables"] += q->get_num_decls();
|
||||
else
|
||||
break;
|
||||
case exists_k:
|
||||
m_stats["exists-variables"] += q->get_num_decls();
|
||||
break;
|
||||
case lambda_k:
|
||||
m_stats["lambda-variables"] += q->get_num_decls();
|
||||
break;
|
||||
}
|
||||
m_stats["patterns"] += q->get_num_patterns();
|
||||
m_stats["no-patterns"] += q->get_num_no_patterns();
|
||||
m_qdepth++;
|
||||
|
|
|
@ -31,7 +31,7 @@ class distribute_forall_tactic : public tactic {
|
|||
expr_ref & result,
|
||||
proof_ref & result_pr) {
|
||||
|
||||
if (!old_q->is_forall()) {
|
||||
if (!is_forall(old_q)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -49,8 +49,7 @@ class distribute_forall_tactic : public tactic {
|
|||
expr * not_arg = m.mk_not(arg);
|
||||
quantifier_ref tmp_q(m);
|
||||
tmp_q = m.update_quantifier(old_q, not_arg);
|
||||
expr_ref new_q(m);
|
||||
elim_unused_vars(m, tmp_q, params_ref(), new_q);
|
||||
expr_ref new_q = elim_unused_vars(m, tmp_q, params_ref());
|
||||
new_args.push_back(new_q);
|
||||
}
|
||||
result = m.mk_and(new_args.size(), new_args.c_ptr());
|
||||
|
@ -69,8 +68,7 @@ class distribute_forall_tactic : public tactic {
|
|||
expr * arg = to_app(new_body)->get_arg(i);
|
||||
quantifier_ref tmp_q(m);
|
||||
tmp_q = m.update_quantifier(old_q, arg);
|
||||
expr_ref new_q(m);
|
||||
elim_unused_vars(m, tmp_q, params_ref(), new_q);
|
||||
expr_ref new_q = elim_unused_vars(m, tmp_q, params_ref());
|
||||
new_args.push_back(new_q);
|
||||
}
|
||||
result = m.mk_and(new_args.size(), new_args.c_ptr());
|
||||
|
|
|
@ -337,12 +337,14 @@ expr_ref dom_simplify_tactic::simplify_and_or(bool is_and, app * e) {
|
|||
}
|
||||
args.reverse();
|
||||
}
|
||||
|
||||
pop(scope_level() - old_lvl);
|
||||
r = is_and ? mk_and(args) : mk_or(args);
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool dom_simplify_tactic::init(goal& g) {
|
||||
expr_ref_vector args(m);
|
||||
unsigned sz = g.size();
|
||||
|
|
|
@ -5,6 +5,7 @@ Module Name:
|
|||
|
||||
dom_simplify_tactic.cpp
|
||||
|
||||
|
||||
Abstract:
|
||||
|
||||
Dominator-based context simplifer.
|
||||
|
|
|
@ -79,11 +79,11 @@ class injectivity_tactic : public tactic {
|
|||
ast_manager & m() const { return m_manager; }
|
||||
|
||||
bool is_axiom(expr* n, func_decl* &f, func_decl* &g) {
|
||||
if (!is_quantifier(n))
|
||||
if (!is_forall(n))
|
||||
return false;
|
||||
|
||||
quantifier* const q = to_quantifier(n);
|
||||
if (!q->is_forall() || q->get_num_decls() != 1)
|
||||
if (q->get_num_decls() != 1)
|
||||
return false;
|
||||
|
||||
const expr * const body = q->get_expr();
|
||||
|
|
|
@ -474,7 +474,6 @@ class tseitin_cnf_tactic : public tactic {
|
|||
bool sign = m.is_not(_b, _b);
|
||||
if (!m.is_or(_b)) return NO;
|
||||
app* b = to_app(_b);
|
||||
unsigned num = b->get_num_args();
|
||||
if (first) {
|
||||
bool visited = true;
|
||||
visit(a, visited);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue