3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-26 13:06:05 +00:00

tuning pb/max

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2014-05-06 04:01:10 -07:00
parent 7ade3f2c04
commit d2db8007d8
9 changed files with 79 additions and 39 deletions

View file

@ -44,7 +44,7 @@ def_module_params(module_name='smt',
('arith.int_eq_branch', BOOL, False, 'branching using derived integer equations'),
('arith.ignore_int', BOOL, False, 'treat integer variables as real'),
('arith.dump_lemmas', BOOL, False, 'dump arithmetic theory lemmas to files'),
('pb.conflict_frequency', UINT, 0, 'conflict frequency for Pseudo-Boolean theory'),
('pb.conflict_frequency', UINT, 1000, 'conflict frequency for Pseudo-Boolean theory'),
('pb.learn_complements', BOOL, True, 'learn complement literals for Pseudo-Boolean theory'),
('pb.enable_compilation', BOOL, True, 'enable compilation into sorting circuits for Pseudo-Boolean'),
('pb.enable_simplex', BOOL, False, 'enable simplex to check rational feasibility'),

View file

@ -28,7 +28,7 @@ struct theory_pb_params {
bool m_pb_enable_compilation;
bool m_pb_enable_simplex;
theory_pb_params(params_ref const & p = params_ref()):
m_pb_conflict_frequency(0),
m_pb_conflict_frequency(1000),
m_pb_learn_complements(true),
m_pb_enable_compilation(true),
m_pb_enable_simplex(false)

View file

@ -790,7 +790,6 @@ namespace smt {
}
void setup::setup_card() {
// m_context.register_plugin(alloc(theory_card, m_manager));
m_context.register_plugin(alloc(theory_pb, m_manager, m_params));
}

View file

@ -187,8 +187,6 @@ namespace smt {
m_args[1].append(m_args[0]);
m_args[1].negate();
//m_args[0].display(std::cout);
//m_args[1].display(std::cout);
SASSERT(m_args[0].size() == m_args[1].size());
SASSERT(m_args[0].well_formed());
SASSERT(m_args[1].well_formed());
@ -284,8 +282,6 @@ namespace smt {
m_last_explain(last_explain) {}
virtual void undo(context& ctx) {
//std::cout << "undo bound: " << m_v << " " << m_last_explain;
//std::cout << (m_is_lower?" lower ":" upper ") << pb.m_mpq_inf_mgr.to_string(m_last_bound) << "\n";
if (m_is_lower) {
if (m_last_bound_valid) {
pb.m_simplex.set_lower(m_v, m_last_bound);
@ -318,7 +314,6 @@ namespace smt {
}
bool theory_pb::update_bound(bool_var v, literal explain, bool is_lower, mpq_inf const& bound) {
// std::cout << v << " " << explain << (is_lower?" lower ":" upper ") << m_mpq_inf_mgr.to_string(bound) << "\n";
if (is_lower) {
if (m_simplex.above_lower(v, bound)) {
scoped_eps_numeral last_bound(m_mpq_inf_mgr);
@ -411,6 +406,7 @@ namespace smt {
}
bool theory_pb::internalize_atom(app * atom, bool gate_ctx) {
ast_manager& m = get_manager();
SASSERT(m_util.is_at_most_k(atom) || m_util.is_le(atom) ||
m_util.is_ge(atom) || m_util.is_at_least_k(atom) ||
m_util.is_eq(atom));
@ -423,7 +419,6 @@ namespace smt {
SASSERT(!ctx.b_internalized(atom));
m_stats.m_num_predicates++;
ast_manager& m = get_manager();
unsigned num_args = atom->get_num_args();
bool_var abv = ctx.mk_bool_var(atom);
ctx.set_var_theory(abv, get_id());