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

revising pd-maxres

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2015-08-23 10:53:39 -07:00
parent da0c12cdba
commit 546a9b8f03
9 changed files with 65 additions and 82 deletions

View file

@ -171,7 +171,7 @@ public:
}
void new_assumption(expr* e, rational const& w) {
IF_VERBOSE(3, verbose_stream() << "new assumption " << mk_pp(e, m) << " " << w << "\n";);
IF_VERBOSE(13, verbose_stream() << "new assumption " << mk_pp(e, m) << " " << w << "\n";);
TRACE("opt", tout << "insert: " << mk_pp(e, m) << " : " << w << "\n";);
m_asm2weight.insert(e, w);
m_asms.push_back(e);

View file

@ -20,6 +20,8 @@ Notes:
#include "maxsls.h"
#include "ast_pp.h"
#include "model_smt2_pp.h"
#include "opt_context.h"
#include "inc_sat_solver.h"
namespace opt {
@ -34,7 +36,7 @@ namespace opt {
IF_VERBOSE(1, verbose_stream() << "(opt.sls)\n";);
init();
enable_sls(true);
lbool is_sat = s().check_sat(0, 0);
lbool is_sat = check();
if (is_sat == l_true) {
s().get_model(m_model);
m_upper.reset();
@ -49,6 +51,16 @@ namespace opt {
}
return is_sat;
}
lbool check() {
if (m_c.sat_enabled()) {
return inc_sat_check_sat(
s(), m_soft.size(), m_soft.c_ptr(), m_weights.c_ptr(), m_upper);
}
else {
return s().check_sat(0, 0);
}
}
};