Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
  • Loading branch information
NikolajBjorner committed Oct 30, 2023
1 parent 938a89e commit f97dd34
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/ast/rewriter/seq_rewriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -873,8 +873,8 @@ br_status seq_rewriter::mk_seq_length(expr* a, expr_ref& result) {
m_autil.is_numeral(y, r) && r.is_zero() &&
m_autil.is_numeral(z, r) && r >= 0) {
expr* len_x = str().mk_length(x);
expr* zero = m_autil.mk_int(0);
result = m().mk_ite(m_autil.mk_le(len_x, z), len_x, z);
// expr* zero = m_autil.mk_int(0);
// result = m().mk_ite(m_autil.mk_le(z, zero), zero, result);
return BR_REWRITE_FULL;
}
Expand Down
26 changes: 22 additions & 4 deletions src/math/lp/int_solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,8 @@ namespace lp {

void int_solver::simplify(std::function<bool(unsigned)>& is_root) {

#if 0
return;
#if 1

// in-processing simplification can go here, such as bounds improvements.

Expand All @@ -699,6 +700,20 @@ namespace lp {
return;
}


#endif

#if 1
lp::explanation exp;
m_ex = &exp;
m_t.clear();
m_k.reset();

if (has_inf_int())
local_gomory();
#endif

#if 0
stopwatch sw;
explanation exp1, exp2;

Expand Down Expand Up @@ -919,8 +934,7 @@ namespace lp {
}

lia_move int_solver::local_gomory() {
for (unsigned i = 0; i < 4; ++i) {

for (unsigned i = 0; i < 2 && has_inf_int() && !settings().get_cancel_flag(); ++i) {
m_ex->clear();
m_t.clear();
m_k.reset();
Expand All @@ -939,11 +953,15 @@ namespace lp {
lra.get_infeasibility_explanation(*m_ex);
return lia_move::conflict;
}
//r = m_patcher();
//if (r != lia_move::undef)
// return r;
}
m_ex->clear();
m_t.clear();
m_k.reset();

if (!has_inf_int())
return lia_move::sat;
return lia_move::undef;
}

Expand Down
2 changes: 1 addition & 1 deletion src/math/lp/nla_basics_lemmas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ bool basics::basic_lemma_for_mon_neutral_derived(const monic& rm, const factoriz
for (auto fc : f) {
lpvar j = var(fc);
all_int &= c().var_is_int(j);
if (j == null_lpvar && abs(val(j)) == abs_mv &&
if (u == null_lpvar && abs(val(j)) == abs_mv &&
c().vars_are_equiv(j, mon_var) &&
(mon_var_is_sep_from_zero || c().var_is_separated_from_zero(j)))
u = j;
Expand Down
2 changes: 0 additions & 2 deletions src/math/lp/nla_grobner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ namespace nla {
}

bool grobner::is_conflicting() {
bool is_conflict = false;
for (auto eq : m_solver.equations()) {
if (is_conflicting(*eq)) {
lp_settings().stats().m_grobner_conflicts++;
Expand Down Expand Up @@ -677,7 +676,6 @@ namespace nla {
nex_creator& nc = m_nex_creator;
nc.pop(0);
nex_creator::sum_factory sum(nc);
unsigned row_index = 0;
u_map<nex_var*> var2nex;
for (auto v : eq.poly().free_vars())
var2nex.insert(v, nc.mk_var(v));
Expand Down
2 changes: 0 additions & 2 deletions src/math/lp/nra_solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,11 +286,9 @@ struct solver::imp {

bool check_constraint(unsigned idx) {
auto& c = lra.constraints()[idx];
auto& pm = m_nlsat->pm();
auto k = c.kind();
auto offset = -c.rhs();
auto lhs = c.coeffs();
auto sz = lhs.size();

scoped_anum val(am()), mon(am());
am().set(val, offset.to_mpq());
Expand Down
2 changes: 1 addition & 1 deletion src/smt/theory_lra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1091,7 +1091,7 @@ class theory_lra::imp {

void restart_eh() {
m_arith_eq_adapter.restart_eh();
#if 0
#if 1
// experiment
if (m_lia) {
std::function<bool(unsigned)> is_root = [&](unsigned j) {
Expand Down

0 comments on commit f97dd34

Please sign in to comment.