3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-24 01:25:31 +00:00

remove warnings in scaler and use m_cut_solver_cycle_on_var

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

detect slow propagations

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

fiddle with the stop conditions

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

get rid of constraint->m_predecessors, fix a bug in push/pop with lemmas

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

clean detection of stale lemmas in pop

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

add constraints lazily to cut_solver

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

refactor some of cut_solver classes into include files

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

prepare to index constraint from 0 to to n - 1, where n is the number of constraints

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

prepare for constraint priority

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

use priorities in active_set

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

remove unnecesessary parameters

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

speedup bound propagations

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

restore tactics

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

speedup bound propagation by avoiding some calls to propagate_constraint_only_one_unlim

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

fixes by Nikolaj

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

fix print lp_core_solver

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

work on gomory test, subs terms indices correctly

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

correct const_iterator for lar_term

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

improve static_matrix with iterators

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

make row_strip a struct

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

move row_strip outside of static_matrix

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

add const_iterator to row_strip

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

remove the hierarchy of iterators - use std::iterators

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

adding gcd_test stats and taking care of for iterators

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

restore qflia_tactic.cpp

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

run gcd_test according to settings()

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

experiment with picking a narrow or random branch

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
Lev Nachmanson 2018-02-25 10:52:53 -08:00
parent 6202b2f2e4
commit 2bb94ed4fe
55 changed files with 1715 additions and 1347 deletions

View file

@ -307,7 +307,7 @@ class theory_lra::imp {
m_solver->settings().bound_propagation() = BP_NONE != propagation_mode();
m_solver->set_track_pivoted_rows(lp.bprop_on_pivoted_rows());
m_solver->settings().m_int_branch_cut_gomory_threshold = ctx().get_fparams().m_arith_branch_cut_ratio;
m_solver->settings().m_int_branch_cut_solver = std::max(4u, ctx().get_fparams().m_arith_branch_cut_ratio);
m_solver->settings().m_int_branch_cut_solver = std::max(8u, ctx().get_fparams().m_arith_branch_cut_ratio);
m_solver->settings().m_run_gcd_test = ctx().get_fparams().m_arith_gcd_test;
m_solver->settings().set_random_seed(ctx().get_fparams().m_random_seed);
//m_solver->settings().set_ostream(0);
@ -672,6 +672,10 @@ class theory_lra::imp {
}
theory_var internalize_def(app* term, scoped_internalize_state& st) {
if (ctx().e_internalized(term)) {
IF_VERBOSE(0, verbose_stream() << "repeated term\n";);
return mk_var(term, false);
}
linearize_term(term, st);
if (is_unit_var(st)) {
return st.vars()[0];
@ -1252,17 +1256,21 @@ public:
}
// create a bound atom representing term <= k
app_ref mk_bound(lp::lar_term const& term, rational const& k) {
app_ref mk_bound(lp::lar_term const& term, rational const& k, bool lower_bound) {
app_ref t = mk_term(term, k.is_int());
app_ref atom(a.mk_le(t, a.mk_numeral(k, k.is_int())), m);
app_ref atom(m);
if (lower_bound) {
atom = a.mk_ge(t, a.mk_numeral(k, k.is_int()));
}
else {
atom = a.mk_le(t, a.mk_numeral(k, k.is_int()));
}
expr_ref atom1(m);
proof_ref atomp(m);
ctx().get_rewriter()(atom, atom1, atomp);
atom = to_app(atom1);
TRACE("arith", tout << atom << "\n";
m_solver->print_term(term, tout << "bound atom: "); tout << " <= " << k << "\n";
display(tout);
);
m_solver->print_term(term, tout << "bound atom: "); tout << " <= " << k << "\n";);
ctx().internalize(atom, true);
ctx().mark_as_relevant(atom.get());
return atom;
@ -1276,12 +1284,15 @@ public:
lp::lar_term term;
lp::mpq k;
lp::explanation ex; // TBD, this should be streamlined accross different explanations
switch(m_lia->check(term, k, ex)) {
bool upper;
switch(m_lia->check(term, k, ex, upper)) {
case lp::lia_move::ok:
return l_true;
case lp::lia_move::branch: {
(void)mk_bound(term, k);
app_ref b = mk_bound(term, k, upper);
// branch on term >= k + 1
// branch on term <= k
// TBD: ctx().force_phase(ctx().get_literal(b));
// at this point we have a new unassigned atom that the
// SAT core assigns a value to
return l_false;
@ -1289,7 +1300,7 @@ public:
case lp::lia_move::cut: {
++m_stats.m_gomory_cuts;
// m_explanation implies term <= k
app_ref b = mk_bound(term, k);
app_ref b = mk_bound(term, k, upper);
m_eqs.reset();
m_core.reset();
m_params.reset();
@ -1298,7 +1309,11 @@ public:
set_evidence(ev.second);
}
}
assign(literal(ctx().get_bool_var(b), false));
literal lit(ctx().get_bool_var(b), false);
TRACE("arith",
ctx().display_lemma_as_smt_problem(tout << "new cut:\n", m_core.size(), m_core.c_ptr(), m_eqs.size(), m_eqs.c_ptr(), lit);
display(tout););
assign(lit);
return l_false;
}
case lp::lia_move::conflict:
@ -2725,6 +2740,8 @@ public:
if (m_solver) {
m_solver->print_constraints(out);
m_solver->print_terms(out);
// auto pp = lp ::core_solver_pretty_printer<lp::mpq, lp::impq>(m_solver->m_mpq_lar_core_solver.m_r_solver, out);
// pp.print();
}
unsigned nv = th.get_num_vars();
for (unsigned v = 0; v < nv; ++v) {
@ -2793,6 +2810,8 @@ public:
st.update("cut_solver-true", m_solver->settings().st().m_cut_solver_true);
st.update("cut_solver-false", m_solver->settings().st().m_cut_solver_false);
st.update("cut_solver-undef", m_solver->settings().st().m_cut_solver_undef);
st.update("gcd_calls", m_solver->settings().st().m_gcd_calls);
st.update("gcd_conflict", m_solver->settings().st().m_gcd_conflicts);
}
};