mirror of
https://github.com/Z3Prover/z3
synced 2025-08-07 11:41:22 +00:00
remove unused features related to weighted check-sat
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
9f49905582
commit
bc6b3007de
16 changed files with 58 additions and 1656 deletions
|
@ -302,17 +302,7 @@ public:
|
|||
}
|
||||
|
||||
lbool check_sat(unsigned sz, expr* const* asms) {
|
||||
if (m_st == s_primal_dual && m_c.sat_enabled()) {
|
||||
rational max_weight = m_upper;
|
||||
vector<rational> weights;
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
weights.push_back(get_weight(asms[i]));
|
||||
}
|
||||
return inc_sat_check_sat(s(), sz, asms, weights.c_ptr(), max_weight);
|
||||
}
|
||||
else {
|
||||
return s().check_sat(sz, asms);
|
||||
}
|
||||
return s().check_sat(sz, asms);
|
||||
}
|
||||
|
||||
void found_optimum() {
|
||||
|
|
|
@ -20,9 +20,49 @@ Notes:
|
|||
#include "smt_literal.h"
|
||||
#include "ast_pp.h"
|
||||
#include "th_rewriter.h"
|
||||
#include "sat_sls.h"
|
||||
#include "sat_types.h"
|
||||
|
||||
namespace smt {
|
||||
|
||||
class index_set {
|
||||
|
||||
unsigned_vector m_elems;
|
||||
unsigned_vector m_index;
|
||||
public:
|
||||
unsigned num_elems() const { return m_elems.size(); }
|
||||
unsigned operator[](unsigned idx) const { return m_elems[idx]; }
|
||||
void reset() { m_elems.reset(); m_index.reset(); }
|
||||
bool empty() const { return m_elems.empty(); }
|
||||
|
||||
bool contains(unsigned idx) const {
|
||||
return
|
||||
(idx < m_index.size()) &&
|
||||
(m_index[idx] < m_elems.size()) &&
|
||||
(m_elems[m_index[idx]] == idx);
|
||||
}
|
||||
|
||||
void insert(unsigned idx) {
|
||||
m_index.reserve(idx+1);
|
||||
if (!contains(idx)) {
|
||||
m_index[idx] = m_elems.size();
|
||||
m_elems.push_back(idx);
|
||||
}
|
||||
}
|
||||
|
||||
void remove(unsigned idx) {
|
||||
if (!contains(idx)) return;
|
||||
unsigned pos = m_index[idx];
|
||||
m_elems[pos] = m_elems.back();
|
||||
m_index[m_elems[pos]] = pos;
|
||||
m_elems.pop_back();
|
||||
}
|
||||
|
||||
unsigned choose(random_gen& rnd) const {
|
||||
SASSERT(!empty());
|
||||
return m_elems[rnd(num_elems())];
|
||||
}
|
||||
};
|
||||
|
||||
struct pb_sls::imp {
|
||||
|
||||
struct clause {
|
||||
|
@ -73,8 +113,8 @@ namespace smt {
|
|||
expr_ref_vector m_trail;
|
||||
obj_map<expr, unsigned> m_decl2var; // map declarations to Boolean variables.
|
||||
ptr_vector<expr> m_var2decl; // reverse map
|
||||
sat::index_set m_hard_false; // list of hard clauses that are false.
|
||||
sat::index_set m_soft_false; // list of soft clauses that are false.
|
||||
index_set m_hard_false; // list of hard clauses that are false.
|
||||
index_set m_soft_false; // list of soft clauses that are false.
|
||||
unsigned m_max_flips; // maximal number of flips
|
||||
unsigned m_non_greedy_percent; // percent of moves to do non-greedy style
|
||||
random_gen m_rng;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue