@@ -916,15 +916,20 @@ namespace nlsat {
916
916
}
917
917
918
918
void log_lemma (std::ostream& out, unsigned n, literal const * cls, bool is_valid) {
919
+ ++m_lemma_count;
920
+ out << " (set-logic NRA)\n " ;
919
921
if (is_valid) {
920
922
display_smt2_bool_decls (out);
921
923
display_smt2_arith_decls (out);
922
924
}
923
925
else
924
926
display_smt2 (out);
925
- display_smt2 (out << " (assert (not " , n, cls) << " ))\n " ;
927
+ for (unsigned i = 0 ; i < n; ++i)
928
+ display_smt2 (out << " (assert " , ~cls[i]) << " )\n " ;
926
929
display (out << " (echo \" #" << m_lemma_count << " " , n, cls) << " \" )\n " ;
927
930
out << " (check-sat)\n (reset)\n " ;
931
+
932
+ TRACE (" nlsat" , display (tout << " (echo \" #" << m_lemma_count << " " , n, cls) << " \" )\n " );
928
933
}
929
934
930
935
clause * mk_clause_core (unsigned num_lits, literal const * lits, bool learned, _assumption_set a) {
@@ -941,10 +946,9 @@ namespace nlsat {
941
946
clause * mk_clause (unsigned num_lits, literal const * lits, bool learned, _assumption_set a) {
942
947
SASSERT (num_lits > 0 );
943
948
clause * cls = mk_clause_core (num_lits, lits, learned, a);
944
- ++m_lemma_count;
945
949
TRACE (" nlsat_sort" , display (tout << " mk_clause:\n " , *cls) << " \n " ;);
946
950
std::sort (cls->begin (), cls->end (), lit_lt (*this ));
947
- TRACE (" nlsat_sort " , display (tout << " # " << m_lemma_count << " after sort:\n " , *cls) << " \n " ;);
951
+ TRACE (" nlsat " , display (tout << " after sort:\n " , *cls) << " \n " ;);
948
952
if (learned && m_log_lemmas) {
949
953
log_lemma (verbose_stream (), *cls);
950
954
}
@@ -2100,6 +2104,9 @@ namespace nlsat {
2100
2104
if (m_check_lemmas) {
2101
2105
check_lemma (m_lemma.size (), m_lemma.data (), false , m_lemma_assumptions.get ());
2102
2106
}
2107
+
2108
+ if (m_log_lemmas)
2109
+ log_lemma (verbose_stream (), m_lemma.size (), m_lemma.data (), false );
2103
2110
2104
2111
// There are two possibilities:
2105
2112
// 1) m_lemma contains only literals from previous stages, and they
0 commit comments