mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 09:05:31 +00:00
adding soft-assertions
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
e50e02e656
commit
552cbd840f
8 changed files with 30 additions and 5 deletions
|
@ -105,6 +105,10 @@ namespace opt {
|
|||
m_c.set_enable_sls(f);
|
||||
}
|
||||
|
||||
void maxsmt_solver_base::set_soft_assumptions() {
|
||||
m_c.set_soft_assumptions()
|
||||
}
|
||||
|
||||
app* maxsmt_solver_base::mk_fresh_bool(char const* name) {
|
||||
app* result = m.mk_fresh_const(name, m.mk_bool_sort());
|
||||
m_c.fm().insert(result->get_decl());
|
||||
|
|
|
@ -102,6 +102,7 @@ namespace opt {
|
|||
protected:
|
||||
void enable_sls(expr_ref_vector const& soft, weights_t& ws);
|
||||
void set_enable_sls(bool f);
|
||||
void set_soft_assumptions();
|
||||
void trace_bounds(char const* solver);
|
||||
|
||||
};
|
||||
|
|
|
@ -493,6 +493,13 @@ namespace opt {
|
|||
}
|
||||
}
|
||||
|
||||
void context::set_soft_assumptions() {
|
||||
if (m_sat_solver.get()) {
|
||||
m_params.set_bool("soft_assumptions", true);
|
||||
m_sat_solver->updt_params(m_params);
|
||||
}
|
||||
}
|
||||
|
||||
void context::enable_sls(expr_ref_vector const& soft, vector<rational> const& weights) {
|
||||
SASSERT(soft.size() == weights.size());
|
||||
if (m_sat_solver.get()) {
|
||||
|
|
|
@ -184,6 +184,7 @@ namespace opt {
|
|||
params_ref& params() { return m_params; }
|
||||
void enable_sls(expr_ref_vector const& soft, weights_t& weights);
|
||||
void set_enable_sls(bool f) { m_enable_sls = f; }
|
||||
void set_soft_assumptions();
|
||||
symbol const& maxsat_engine() const { return m_maxsat_engine; }
|
||||
void get_base_model(model_ref& m);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue