mirror of
https://github.com/Z3Prover/z3
synced 2025-04-07 09:55:19 +00:00
replaced simplifier with rewriter at pull_quant.cpp
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
3e50a65dfc
commit
3711f8e42c
|
@ -30,7 +30,7 @@ def init_project_def():
|
||||||
# Simplifier module will be deleted in the future.
|
# Simplifier module will be deleted in the future.
|
||||||
# It has been replaced with rewriter module.
|
# It has been replaced with rewriter module.
|
||||||
add_lib('simplifier', ['rewriter', 'front_end_params'], 'ast/simplifier')
|
add_lib('simplifier', ['rewriter', 'front_end_params'], 'ast/simplifier')
|
||||||
add_lib('normal_forms', ['rewriter', 'simplifier'], 'ast/normal_forms')
|
add_lib('normal_forms', ['rewriter', 'front_end_params'], 'ast/normal_forms')
|
||||||
add_lib('core_tactics', ['tactic', 'normal_forms'], 'tactic/core')
|
add_lib('core_tactics', ['tactic', 'normal_forms'], 'tactic/core')
|
||||||
add_lib('sat_tactic', ['tactic', 'sat'], 'sat/tactic')
|
add_lib('sat_tactic', ['tactic', 'sat'], 'sat/tactic')
|
||||||
add_lib('arith_tactics', ['core_tactics', 'sat'], 'tactic/arith')
|
add_lib('arith_tactics', ['core_tactics', 'sat'], 'tactic/arith')
|
||||||
|
@ -41,7 +41,7 @@ def init_project_def():
|
||||||
add_lib('cmd_context', ['solver', 'rewriter'])
|
add_lib('cmd_context', ['solver', 'rewriter'])
|
||||||
add_lib('extra_cmds', ['cmd_context', 'subpaving_tactic', 'arith_tactics'], 'cmd_context/extra_cmds')
|
add_lib('extra_cmds', ['cmd_context', 'subpaving_tactic', 'arith_tactics'], 'cmd_context/extra_cmds')
|
||||||
add_lib('smt2parser', ['cmd_context', 'parser_util'], 'parsers/smt2')
|
add_lib('smt2parser', ['cmd_context', 'parser_util'], 'parsers/smt2')
|
||||||
add_lib('pattern', ['normal_forms', 'smt2parser'], 'ast/pattern')
|
add_lib('pattern', ['normal_forms', 'smt2parser', 'simplifier'], 'ast/pattern')
|
||||||
add_lib('macros', ['simplifier', 'front_end_params'], 'ast/macros')
|
add_lib('macros', ['simplifier', 'front_end_params'], 'ast/macros')
|
||||||
add_lib('proof_checker', ['rewriter', 'front_end_params'], 'ast/proof_checker')
|
add_lib('proof_checker', ['rewriter', 'front_end_params'], 'ast/proof_checker')
|
||||||
add_lib('bit_blaster', ['rewriter', 'simplifier', 'front_end_params'], 'ast/rewriter/bit_blaster')
|
add_lib('bit_blaster', ['rewriter', 'simplifier', 'front_end_params'], 'ast/rewriter/bit_blaster')
|
||||||
|
|
|
@ -16,8 +16,9 @@ Author:
|
||||||
Revision History:
|
Revision History:
|
||||||
|
|
||||||
--*/
|
--*/
|
||||||
|
|
||||||
#include"cnf.h"
|
#include"cnf.h"
|
||||||
|
#include"var_subst.h"
|
||||||
|
#include"ast_util.h"
|
||||||
#include"ast_pp.h"
|
#include"ast_pp.h"
|
||||||
#include"ast_ll_pp.h"
|
#include"ast_ll_pp.h"
|
||||||
|
|
||||||
|
|
|
@ -17,10 +17,22 @@ Notes:
|
||||||
|
|
||||||
--*/
|
--*/
|
||||||
#include"pull_quant.h"
|
#include"pull_quant.h"
|
||||||
|
#include"var_subst.h"
|
||||||
|
#include"rewriter_def.h"
|
||||||
#include"ast_pp.h"
|
#include"ast_pp.h"
|
||||||
#include"for_each_expr.h"
|
|
||||||
|
|
||||||
void pull_quant::pull_quant1(func_decl * d, unsigned num_children, expr * const * children, expr_ref & result) {
|
struct pull_quant::imp {
|
||||||
|
|
||||||
|
struct rw_cfg : public default_rewriter_cfg {
|
||||||
|
ast_manager & m_manager;
|
||||||
|
shift_vars m_shift;
|
||||||
|
|
||||||
|
rw_cfg(ast_manager & m):
|
||||||
|
m_manager(m),
|
||||||
|
m_shift(m) {
|
||||||
|
}
|
||||||
|
|
||||||
|
bool pull_quant1_core(func_decl * d, unsigned num_children, expr * const * children, expr_ref & result) {
|
||||||
ptr_buffer<sort> var_sorts;
|
ptr_buffer<sort> var_sorts;
|
||||||
buffer<symbol> var_names;
|
buffer<symbol> var_names;
|
||||||
symbol qid;
|
symbol qid;
|
||||||
|
@ -38,11 +50,11 @@ void pull_quant::pull_quant1(func_decl * d, unsigned num_children, expr * const
|
||||||
quantifier * q = to_quantifier(child);
|
quantifier * q = to_quantifier(child);
|
||||||
expr * body = q->get_expr();
|
expr * body = q->get_expr();
|
||||||
result = m_manager.update_quantifier(q, !q->is_forall(), m_manager.mk_not(body));
|
result = m_manager.update_quantifier(q, !q->is_forall(), m_manager.mk_not(body));
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
result = m_manager.mk_not(child);
|
return false;
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool found_quantifier = false;
|
bool found_quantifier = false;
|
||||||
|
@ -144,17 +156,25 @@ void pull_quant::pull_quant1(func_decl * d, unsigned num_children, expr * const
|
||||||
m_manager.mk_app(d, new_adjusted_children.size(), new_adjusted_children.c_ptr()),
|
m_manager.mk_app(d, new_adjusted_children.size(), new_adjusted_children.c_ptr()),
|
||||||
w,
|
w,
|
||||||
qid);
|
qid);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
SASSERT(!found_quantifier);
|
SASSERT(!found_quantifier);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void pull_quant1(func_decl * d, unsigned num_children, expr * const * children, expr_ref & result) {
|
||||||
|
if (!pull_quant1_core(d, num_children, children, result)) {
|
||||||
result = m_manager.mk_app(d, num_children, children);
|
result = m_manager.mk_app(d, num_children, children);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void pull_quant::pull_quant1(quantifier * q, expr * new_expr, expr_ref & result) {
|
|
||||||
|
void pull_quant1_core(quantifier * q, expr * new_expr, expr_ref & result) {
|
||||||
// The original formula was in SNF, so the original quantifiers must be universal.
|
// The original formula was in SNF, so the original quantifiers must be universal.
|
||||||
SASSERT(is_forall(q));
|
SASSERT(is_forall(q));
|
||||||
if (is_forall(new_expr)) {
|
SASSERT(is_forall(new_expr));
|
||||||
quantifier * nested_q = to_quantifier(new_expr);
|
quantifier * nested_q = to_quantifier(new_expr);
|
||||||
ptr_buffer<sort> var_sorts;
|
ptr_buffer<sort> var_sorts;
|
||||||
buffer<symbol> var_names;
|
buffer<symbol> var_names;
|
||||||
|
@ -171,23 +191,30 @@ void pull_quant::pull_quant1(quantifier * q, expr * new_expr, expr_ref & result)
|
||||||
std::min(q->get_weight(), nested_q->get_weight()),
|
std::min(q->get_weight(), nested_q->get_weight()),
|
||||||
q->get_qid());
|
q->get_qid());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void pull_quant1(quantifier * q, expr * new_expr, expr_ref & result) {
|
||||||
|
// The original formula was in SNF, so the original quantifiers must be universal.
|
||||||
|
SASSERT(is_forall(q));
|
||||||
|
if (is_forall(new_expr)) {
|
||||||
|
pull_quant1_core(q, new_expr, result);
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
SASSERT(!is_quantifier(new_expr));
|
SASSERT(!is_quantifier(new_expr));
|
||||||
result = m_manager.update_quantifier(q, new_expr);
|
result = m_manager.update_quantifier(q, new_expr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void pull_quant::pull_quant1(expr * n, expr_ref & result) {
|
void pull_quant1(expr * n, expr_ref & result) {
|
||||||
if (is_app(n))
|
if (is_app(n))
|
||||||
pull_quant1(to_app(n)->get_decl(), to_app(n)->get_num_args(), to_app(n)->get_args(), result);
|
pull_quant1(to_app(n)->get_decl(), to_app(n)->get_num_args(), to_app(n)->get_args(), result);
|
||||||
else if (is_quantifier(n))
|
else if (is_quantifier(n))
|
||||||
pull_quant1(to_quantifier(n), to_quantifier(n)->get_expr(), result);
|
pull_quant1(to_quantifier(n), to_quantifier(n)->get_expr(), result);
|
||||||
else
|
else
|
||||||
result = n;
|
result = n;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Code for proof generation...
|
// Code for proof generation...
|
||||||
void pull_quant::pull_quant2(expr * n, expr_ref & r, proof_ref & pr) {
|
void pull_quant2(expr * n, expr_ref & r, proof_ref & pr) {
|
||||||
pr = 0;
|
pr = 0;
|
||||||
if (is_app(n)) {
|
if (is_app(n)) {
|
||||||
expr_ref_buffer new_args(m_manager);
|
expr_ref_buffer new_args(m_manager);
|
||||||
|
@ -227,159 +254,135 @@ void pull_quant::pull_quant2(expr * n, expr_ref & r, proof_ref & pr) {
|
||||||
else {
|
else {
|
||||||
r = n;
|
r = n;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool pull_quant::visit_children(expr * n) {
|
br_status reduce_app(func_decl * f, unsigned num, expr * const * args, expr_ref & result, proof_ref & result_pr) {
|
||||||
bool visited = true;
|
if (!m_manager.is_or(f) && !m_manager.is_and(f) && !m_manager.is_not(f))
|
||||||
unsigned j;
|
return BR_FAILED;
|
||||||
switch(n->get_kind()) {
|
|
||||||
case AST_APP:
|
|
||||||
// This transformation is also applied after the formula
|
|
||||||
// has been converted into a SNF using only OR and NOT.
|
|
||||||
if (m_manager.is_or(n) || m_manager.is_and(n) || m_manager.is_not(n)) {
|
|
||||||
j = to_app(n)->get_num_args();
|
|
||||||
while (j > 0) {
|
|
||||||
--j;
|
|
||||||
visit(to_app(n)->get_arg(j), visited);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// This class assumes the formula is in skolem normal form.
|
|
||||||
SASSERT(!has_quantifiers(n));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case AST_QUANTIFIER:
|
|
||||||
if (to_quantifier(n)->is_forall())
|
|
||||||
visit(to_quantifier(n)->get_expr(), visited);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return visited;
|
|
||||||
}
|
|
||||||
|
|
||||||
void pull_quant::reduce1(expr * n) {
|
if (!pull_quant1_core(f, num, args, result))
|
||||||
switch(n->get_kind()) {
|
return BR_FAILED;
|
||||||
case AST_APP:
|
|
||||||
reduce1_app(to_app(n));
|
if (m_manager.proofs_enabled()) {
|
||||||
break;
|
result_pr = m_manager.mk_pull_quant(m_manager.mk_app(f, num, args),
|
||||||
case AST_VAR:
|
to_quantifier(result.get()));
|
||||||
cache_result(n, n, 0);
|
}
|
||||||
break;
|
return BR_DONE;
|
||||||
case AST_QUANTIFIER:
|
}
|
||||||
reduce1_quantifier(to_quantifier(n));
|
|
||||||
break;
|
bool reduce_quantifier(quantifier * old_q,
|
||||||
default:
|
expr * new_body,
|
||||||
|
expr * const * new_patterns,
|
||||||
|
expr * const * new_no_patterns,
|
||||||
|
expr_ref & result,
|
||||||
|
proof_ref & result_pr) {
|
||||||
|
|
||||||
|
if (old_q->is_exists()) {
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
break;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!is_forall(new_body))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
pull_quant1_core(old_q, new_body, result);
|
||||||
|
if (m_manager.proofs_enabled())
|
||||||
|
result_pr = m_manager.mk_pull_quant(old_q, to_quantifier(result.get()));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct rw : public rewriter_tpl<rw_cfg> {
|
||||||
|
rw_cfg m_cfg;
|
||||||
|
rw(ast_manager & m):
|
||||||
|
rewriter_tpl<rw_cfg>(m, m.proofs_enabled(), m_cfg),
|
||||||
|
m_cfg(m) {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
rw m_rw;
|
||||||
|
|
||||||
|
imp(ast_manager & m):
|
||||||
|
m_rw(m) {
|
||||||
|
}
|
||||||
|
|
||||||
|
void operator()(expr * n, expr_ref & r, proof_ref & p) {
|
||||||
|
m_rw(n, r, p);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
pull_quant::pull_quant(ast_manager & m) {
|
||||||
|
m_imp = alloc(imp, m);
|
||||||
}
|
}
|
||||||
|
|
||||||
void pull_quant::reduce1_app(app * n) {
|
pull_quant::~pull_quant() {
|
||||||
if (m_manager.is_or(n) || m_manager.is_and(n) || m_manager.is_not(n)) {
|
dealloc(m_imp);
|
||||||
ptr_buffer<expr> new_children;
|
|
||||||
ptr_buffer<proof> new_children_proofs;
|
|
||||||
unsigned num = n->get_num_args();
|
|
||||||
for (unsigned i = 0; i < num; i++) {
|
|
||||||
expr * new_child = 0;
|
|
||||||
proof * new_child_pr = 0;
|
|
||||||
get_cached(n->get_arg(i), new_child, new_child_pr);
|
|
||||||
new_children.push_back(new_child);
|
|
||||||
if (new_child_pr) {
|
|
||||||
new_children_proofs.push_back(new_child_pr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
expr_ref r(m_manager);
|
|
||||||
pull_quant1(n->get_decl(), new_children.size(), new_children.c_ptr(), r);
|
|
||||||
proof * pr = 0;
|
|
||||||
if (m_manager.fine_grain_proofs()) {
|
|
||||||
app * n_prime = m_manager.mk_app(n->get_decl(), new_children.size(), new_children.c_ptr());
|
|
||||||
TRACE("proof_bug", tout << mk_pp(n, m_manager) << "\n";
|
|
||||||
tout << mk_pp(n_prime, m_manager) << "\n";);
|
|
||||||
proof * p1 = n == n_prime ? 0 : m_manager.mk_congruence(n, n_prime,
|
|
||||||
new_children_proofs.size(), new_children_proofs.c_ptr());
|
|
||||||
proof * p2 = n_prime == r ? 0 : m_manager.mk_pull_quant(n_prime, to_quantifier(r));
|
|
||||||
pr = m_manager.mk_transitivity(p1, p2);
|
|
||||||
}
|
|
||||||
cache_result(n, r, pr);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
TRACE("proof_bug", tout << mk_pp(n, m_manager) << "\n";);
|
|
||||||
cache_result(n, n, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
void pull_quant::reduce1_quantifier(quantifier * q) {
|
|
||||||
if (q->is_forall()) {
|
|
||||||
expr * new_expr;
|
|
||||||
proof * new_expr_pr;
|
|
||||||
get_cached(q->get_expr(), new_expr, new_expr_pr);
|
|
||||||
expr_ref r(m_manager);
|
|
||||||
pull_quant1(q, new_expr, r);
|
|
||||||
proof * pr = 0;
|
|
||||||
if (m_manager.fine_grain_proofs()) {
|
|
||||||
quantifier * q_prime = m_manager.update_quantifier(q, new_expr);
|
|
||||||
proof * p1 = q == q_prime ? 0 : m_manager.mk_quant_intro(q, q_prime, new_expr_pr);
|
|
||||||
proof * p2 = q_prime == r ? 0 : m_manager.mk_pull_quant(q_prime, to_quantifier(r));
|
|
||||||
pr = m_manager.mk_transitivity(p1, p2);
|
|
||||||
}
|
|
||||||
cache_result(q, r, pr);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// should be unreachable, right?
|
|
||||||
UNREACHABLE();
|
|
||||||
cache_result(q, q, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
pull_quant::pull_quant(ast_manager & m):
|
|
||||||
base_simplifier(m),
|
|
||||||
m_shift(m) {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void pull_quant::operator()(expr * n, expr_ref & r, proof_ref & p) {
|
void pull_quant::operator()(expr * n, expr_ref & r, proof_ref & p) {
|
||||||
flush_cache();
|
(*m_imp)(n, r, p);
|
||||||
m_todo.push_back(n);
|
|
||||||
while (!m_todo.empty()) {
|
|
||||||
expr * n = m_todo.back();
|
|
||||||
if (is_cached(n))
|
|
||||||
m_todo.pop_back();
|
|
||||||
else if (visit_children(n)) {
|
|
||||||
m_todo.pop_back();
|
|
||||||
reduce1(n);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
expr * result;
|
|
||||||
proof * result_proof;
|
|
||||||
get_cached(n, result, result_proof);
|
|
||||||
|
|
||||||
r = result;
|
|
||||||
|
|
||||||
switch (m_manager.proof_mode()) {
|
|
||||||
case PGM_DISABLED:
|
|
||||||
p = m_manager.mk_undef_proof();
|
|
||||||
break;
|
|
||||||
case PGM_COARSE:
|
|
||||||
if (result == n)
|
|
||||||
p = m_manager.mk_reflexivity(n);
|
|
||||||
else
|
|
||||||
p = m_manager.mk_pull_quant_star(n, to_quantifier(result));
|
|
||||||
break;
|
|
||||||
case PGM_FINE:
|
|
||||||
SASSERT(result_proof || result == n);
|
|
||||||
p = result_proof ? result_proof : m_manager.mk_reflexivity(n);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool pull_nested_quant::visit_quantifier(quantifier * q) {
|
void pull_quant::reset() {
|
||||||
// do not recurse.
|
m_imp->m_rw.reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
void pull_quant::pull_quant2(expr * n, expr_ref & r, proof_ref & pr) {
|
||||||
|
m_imp->m_rw.cfg().pull_quant2(n, r, pr);
|
||||||
|
}
|
||||||
|
|
||||||
|
struct pull_nested_quant::imp {
|
||||||
|
|
||||||
|
struct rw_cfg : public default_rewriter_cfg {
|
||||||
|
pull_quant m_pull;
|
||||||
|
expr_ref m_r;
|
||||||
|
proof_ref m_pr;
|
||||||
|
|
||||||
|
rw_cfg(ast_manager & m):m_pull(m), m_r(m), m_pr(m) {}
|
||||||
|
|
||||||
|
bool get_subst(expr * s, expr * & t, proof * & t_pr) {
|
||||||
|
if (!is_quantifier(s))
|
||||||
|
return false;
|
||||||
|
m_pull(to_quantifier(s), m_r, m_pr);
|
||||||
|
t = m_r.get();
|
||||||
|
t_pr = m_pr.get();
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct rw : public rewriter_tpl<rw_cfg> {
|
||||||
|
rw_cfg m_cfg;
|
||||||
|
rw(ast_manager & m):
|
||||||
|
rewriter_tpl<rw_cfg>(m, m.proofs_enabled(), m_cfg),
|
||||||
|
m_cfg(m) {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
rw m_rw;
|
||||||
|
|
||||||
|
imp(ast_manager & m):
|
||||||
|
m_rw(m) {
|
||||||
|
}
|
||||||
|
|
||||||
|
void operator()(expr * n, expr_ref & r, proof_ref & p) {
|
||||||
|
m_rw(n, r, p);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
pull_nested_quant::pull_nested_quant(ast_manager & m) {
|
||||||
|
m_imp = alloc(imp, m);
|
||||||
}
|
}
|
||||||
|
|
||||||
void pull_nested_quant::reduce1_quantifier(quantifier * q) {
|
pull_nested_quant::~pull_nested_quant() {
|
||||||
expr_ref r(m_manager);
|
dealloc(m_imp);
|
||||||
proof_ref pr(m_manager);
|
|
||||||
m_pull(q, r, pr);
|
|
||||||
cache_result(q, r, pr);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void pull_nested_quant::operator()(expr * n, expr_ref & r, proof_ref & p) {
|
||||||
|
(*m_imp)(n, r, p);
|
||||||
|
}
|
||||||
|
|
||||||
|
void pull_nested_quant::reset() {
|
||||||
|
m_imp->m_rw.reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,7 @@ Notes:
|
||||||
#ifndef _PULL_QUANT_H_
|
#ifndef _PULL_QUANT_H_
|
||||||
#define _PULL_QUANT_H_
|
#define _PULL_QUANT_H_
|
||||||
|
|
||||||
#include"simplifier.h"
|
#include"ast.h"
|
||||||
#include"var_subst.h"
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Pull nested quantifiers in a formula.
|
\brief Pull nested quantifiers in a formula.
|
||||||
|
@ -32,22 +31,14 @@ Notes:
|
||||||
\remark If pull_quant(F) is a quantifier then its weight is
|
\remark If pull_quant(F) is a quantifier then its weight is
|
||||||
Min{weight(Q') | Q' is a quantifier nested in F}
|
Min{weight(Q') | Q' is a quantifier nested in F}
|
||||||
*/
|
*/
|
||||||
class pull_quant : public base_simplifier {
|
class pull_quant {
|
||||||
protected:
|
struct imp;
|
||||||
shift_vars m_shift;
|
imp * m_imp;
|
||||||
bool visit_children(expr * n);
|
|
||||||
void reduce1(expr *);
|
|
||||||
void reduce1_app(app * n);
|
|
||||||
void reduce1_quantifier(quantifier * q);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
pull_quant(ast_manager & m);
|
pull_quant(ast_manager & m);
|
||||||
virtual ~pull_quant() {}
|
~pull_quant();
|
||||||
void operator()(expr * n, expr_ref & r, proof_ref & p);
|
void operator()(expr * n, expr_ref & r, proof_ref & p);
|
||||||
void reset() { flush_cache(); }
|
void reset();
|
||||||
void pull_quant1(func_decl * d, unsigned num_children, expr * const * children, expr_ref & result);
|
|
||||||
void pull_quant1(quantifier * q, expr * new_expr, expr_ref & result);
|
|
||||||
void pull_quant1(expr * n, expr_ref & result);
|
|
||||||
void pull_quant2(expr * n, expr_ref & r, proof_ref & pr);
|
void pull_quant2(expr * n, expr_ref & r, proof_ref & pr);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -55,13 +46,14 @@ public:
|
||||||
\brief After applying this transformation the formula will not
|
\brief After applying this transformation the formula will not
|
||||||
contain nested quantifiers.
|
contain nested quantifiers.
|
||||||
*/
|
*/
|
||||||
class pull_nested_quant : public simplifier {
|
class pull_nested_quant {
|
||||||
pull_quant m_pull;
|
struct imp;
|
||||||
virtual bool visit_quantifier(quantifier * q);
|
imp * m_imp;
|
||||||
virtual void reduce1_quantifier(quantifier * q);
|
|
||||||
public:
|
public:
|
||||||
pull_nested_quant(ast_manager & m):simplifier(m), m_pull(m) { enable_ac_support(false); }
|
pull_nested_quant(ast_manager & m);
|
||||||
virtual ~pull_nested_quant() {}
|
~pull_nested_quant();
|
||||||
|
void operator()(expr * n, expr_ref & r, proof_ref & p);
|
||||||
|
void reset();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* _PULL_QUANT_H_ */
|
#endif /* _PULL_QUANT_H_ */
|
||||||
|
|
Loading…
Reference in a new issue