mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 17:15:31 +00:00
tune initialization for wmax and sortmax
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
ea601dd403
commit
df0e3a100c
5 changed files with 32 additions and 12 deletions
|
@ -87,7 +87,7 @@ void theory_wmaxsat::init_search_eh() {
|
|||
m_propagate = true;
|
||||
}
|
||||
|
||||
bool_var theory_wmaxsat::assert_weighted(expr* fml, rational const& w) {
|
||||
expr* theory_wmaxsat::assert_weighted(expr* fml, rational const& w, bool is_true) {
|
||||
context & ctx = get_context();
|
||||
ast_manager& m = get_manager();
|
||||
app_ref var(m), wfml(m);
|
||||
|
@ -99,9 +99,11 @@ bool_var theory_wmaxsat::assert_weighted(expr* fml, rational const& w) {
|
|||
m_vars.push_back(var);
|
||||
m_fmls.push_back(fml);
|
||||
m_assigned.push_back(false);
|
||||
m_rmin_cost += w;
|
||||
if (!is_true) {
|
||||
m_rmin_cost += w;
|
||||
}
|
||||
m_normalize = true;
|
||||
return register_var(var, true);
|
||||
return ctx.bool_var2expr(register_var(var, true));
|
||||
}
|
||||
|
||||
bool_var theory_wmaxsat::register_var(app* var, bool attach) {
|
||||
|
|
|
@ -57,7 +57,7 @@ namespace smt {
|
|||
virtual ~theory_wmaxsat();
|
||||
void get_assignment(svector<bool>& result);
|
||||
virtual void init_search_eh();
|
||||
bool_var assert_weighted(expr* fml, rational const& w);
|
||||
expr* assert_weighted(expr* fml, rational const& w, bool is_true);
|
||||
bool_var register_var(app* var, bool attach);
|
||||
rational const& get_min_cost();
|
||||
class numeral_trail : public trail<context> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue