Skip to content

Commit

Permalink
disable unit tests relying on changed functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolajBjorner committed Dec 31, 2024
1 parent 3433b14 commit a511b8b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
2 changes: 2 additions & 0 deletions src/ast/sls/sls_bv_eval.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ namespace sls {
// unsigned ddt_orig(expr* e);

sls::bv_valuation& bv_eval::eval(app* e) const {
SASSERT(m_values.size() > e->get_id());
SASSERT(m_values[e->get_id()]);
auto& val = *m_values[e->get_id()];
eval(e, val);
return val;
Expand Down
21 changes: 12 additions & 9 deletions src/test/sls_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "ast/rewriter/th_rewriter.h"
#include "ast/reg_decl_plugins.h"
#include "ast/ast_pp.h"
#include "ast/for_each_expr.h"

namespace bv {

Expand Down Expand Up @@ -59,8 +60,8 @@ namespace bv {
sls::context ctx(m, solver);
sls::bv_terms terms(ctx);
sls::bv_eval ev(terms, ctx);
for (auto e : es)
ev.register_term(e);
for (auto e : subterms_postorder::all(es))
ev.register_term(e);
ev.init();
th_rewriter rw(m);
expr_ref r(e, m);
Expand All @@ -81,10 +82,11 @@ namespace bv {
VERIFY(n1 == n2);
}
else if (m.is_bool(e)) {
auto val1 = ev.bval0(e);
auto val1 = ev.bval1(to_app(e));
auto val2 = m.is_true(r);
if (val1 != val2) {
verbose_stream() << mk_pp(e, m) << " computed value " << val1 << " at odds with definition\n";
verbose_stream() << mk_pp(e, m) << " computed value " << val1
<< " at odds with definition " << val2 << "\n";
}
SASSERT(val1 == val2);
VERIFY(val1 == val2);
Expand Down Expand Up @@ -178,14 +180,14 @@ namespace bv {
sls::context ctx(m, solver);
sls::bv_terms terms(ctx);
sls::bv_eval ev(terms, ctx);
for (auto e : es)
for (auto e : subterms_postorder::all(es))
ev.register_term(e);
ev.init();

if (m.is_bool(e1)) {
SASSERT(m.is_true(r) || m.is_false(r));
auto val = m.is_true(r);
auto val2 = ev.bval0(e2);
auto val2 = ev.bval1(to_app(e2));
if (val != val2) {
ev.set(e2, val);
auto rep1 = ev.repair_down(to_app(e2), idx);
Expand All @@ -211,7 +213,8 @@ namespace bv {
verbose_stream() << "Not repaired " << mk_pp(e2, m) << "\n";
}
auto val3 = ev.wval(e2);
val3.commit_eval();
verbose_stream() << val3 << "\n";
VERIFY(val3.commit_eval_check_tabu());
if (!val3.eq(val1)) {
verbose_stream() << "Repaired but not corrected " << mk_pp(e2, m) << "\n";
}
Expand Down Expand Up @@ -273,7 +276,7 @@ static void test_repair1() {
}

void tst_sls_test() {
test_eval1();
test_repair1();
//test_eval1();
//test_repair1();

}

0 comments on commit a511b8b

Please sign in to comment.