Skip to content

Commit 8555f25

Browse files
add todo note, and log more lemmas
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
1 parent f4474a3 commit 8555f25

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/nlsat/nlsat_solver.cpp

+10-6
Original file line numberDiff line numberDiff line change
@@ -1853,9 +1853,12 @@ namespace nlsat {
18531853
tout << "new valid clause:\n";
18541854
display(tout, m_lazy_clause.size(), m_lazy_clause.data()) << "\n";);
18551855

1856+
1857+
if (m_log_lemmas)
1858+
log_lemma(verbose_stream(), m_lazy_clause.size(), m_lazy_clause.data(), true);
1859+
18561860
if (m_check_lemmas) {
18571861
check_lemma(m_lazy_clause.size(), m_lazy_clause.data(), true, nullptr);
1858-
log_lemma(verbose_stream(), m_lazy_clause.size(), m_lazy_clause.data(), true);
18591862
m_valids.push_back(mk_clause_core(m_lazy_clause.size(), m_lazy_clause.data(), false, nullptr));
18601863
}
18611864

@@ -3163,7 +3166,6 @@ namespace nlsat {
31633166
if (a.i() == 1 && m_pm.degree(a.p(), a.x()) == 1)
31643167
return display_linear_root_smt2(out, a, proc);
31653168
#if 1
3166-
// A first approximation: this encoding assumes roots are distinct
31673169
out << "(exists (";
31683170
for (unsigned j = 0; j < a.i(); ++j) {
31693171
std::string y = std::string("y") + std::to_string(j);
@@ -3180,14 +3182,16 @@ namespace nlsat {
31803182
std::string y2 = std::string("y") + std::to_string(j+1);
31813183
out << "(< " << y1 << " " << y2 << ")\n";
31823184
}
3183-
std::string y0 = "y0";
3185+
// TODO we need (forall z : z < yn . p(z) => z = y1 or ... z = y_{n-1})
3186+
// to say y1, .., yn are the first n distinct roots.
3187+
//
31843188
std::string yn = "y" + std::to_string(a.i() - 1);
31853189
switch (a.get_kind()) {
3186-
case atom::ROOT_LT: out << "(< "; proc(out, a.x()); out << " " << y0 << ")"; break;
3190+
case atom::ROOT_LT: out << "(< "; proc(out, a.x()); out << " " << yn << ")"; break;
31873191
case atom::ROOT_GT: out << "(> "; proc(out, a.x()); out << " " << yn << ")"; break;
3188-
case atom::ROOT_LE: out << "(<= "; proc(out, a.x()); out << " " << y0 << ")"; break;
3192+
case atom::ROOT_LE: out << "(<= "; proc(out, a.x()); out << " " << yn << ")"; break;
31893193
case atom::ROOT_GE: out << "(>= "; proc(out, a.x()); out << " " << yn << ")"; break;
3190-
case atom::ROOT_EQ: out << "(= "; proc(out, a.x()); out << " " << y0 << ")"; NOT_IMPLEMENTED_YET(); break;
3194+
case atom::ROOT_EQ: out << "(= "; proc(out, a.x()); out << " " << yn << ")"; NOT_IMPLEMENTED_YET(); break;
31913195
}
31923196
out << "))";
31933197
return out;

0 commit comments

Comments
 (0)