3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 17:15:31 +00:00

add qe_arith routine for LW projection on monomomes

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2013-09-12 12:19:46 -07:00
parent 0aaa67fa7d
commit 4af4466821
7 changed files with 422 additions and 7 deletions

View file

@ -151,6 +151,11 @@ namespace pdr {
public:
constr(ast_manager& m) : m(m), a(m), m_ineqs(m), m_time(0) {}
void reset() {
m_ineqs.reset();
m_coeffs.reset();
}
/** add a multiple of constraint c to the current constr */
void add(rational const & coef, app * c) {
bool is_pos = true;
@ -300,7 +305,6 @@ namespace pdr {
return r;
}
expr_ref extract_consequence(unsigned lo, unsigned hi) {
bool is_int = is_int_sort();
app_ref zero(a.mk_numeral(rational::zero(), is_int), m);
@ -373,6 +377,7 @@ namespace pdr {
farkas_learner::farkas_learner(smt_params& params, ast_manager& outer_mgr)
: m_proof_params(get_proof_params(params)),
m_pr(PROOF_MODE),
m_constr(0),
m_combine_farkas_coefficients(true),
p2o(m_pr, outer_mgr),
o2p(outer_mgr, m_pr)
@ -381,6 +386,10 @@ namespace pdr {
m_ctx = alloc(smt::kernel, m_pr, m_proof_params);
}
farkas_learner::~farkas_learner() {
dealloc(m_constr);
}
smt_params farkas_learner::get_proof_params(smt_params& orig_params) {
smt_params res(orig_params);
res.m_arith_bound_prop = BP_NONE;
@ -538,11 +547,14 @@ namespace pdr {
{
ast_manager& m = res.get_manager();
if (m_combine_farkas_coefficients) {
constr res_c(m);
for(unsigned i = 0; i < n; ++i) {
res_c.add(coeffs[i], lits[i]);
if (!m_constr) {
m_constr = alloc(constr, m);
}
res_c.get(res);
m_constr->reset();
for (unsigned i = 0; i < n; ++i) {
m_constr->add(coeffs[i], lits[i]);
}
m_constr->get(res);
}
else {
bool_rewriter rw(m);

View file

@ -42,6 +42,7 @@ class farkas_learner {
smt_params m_proof_params;
ast_manager m_pr;
scoped_ptr<smt::kernel> m_ctx;
constr* m_constr;
//
// true: produce a combined constraint by applying Farkas coefficients.
@ -80,6 +81,8 @@ class farkas_learner {
public:
farkas_learner(smt_params& params, ast_manager& m);
~farkas_learner();
/**
All ast objects have the ast_manager which was passed as
an argument to the constructor (i.e. m_outer_mgr)

View file

@ -143,8 +143,6 @@ namespace pdr {
*/
void reduce_disequalities(model& model, unsigned threshold, expr_ref& fml);
/**
\brief hoist non-boolean if expressions.
*/