Skip to content

Commit

Permalink
update logging for lemmas
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolajBjorner committed Oct 29, 2020
1 parent 91511f7 commit ac4bcb9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
2 changes: 2 additions & 0 deletions src/smt/smt_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -1420,6 +1420,8 @@ namespace smt {
unsigned num_antecedent_eqs, enode_pair const * antecedent_eqs,
literal consequent = false_literal, symbol const& logic = symbol::null) const;

std::string mk_lemma_name() const;

void display_assignment_as_smtlib2(std::ostream& out, symbol const& logic = symbol::null) const;

void display_normalized_enodes(std::ostream & out) const;
Expand Down
26 changes: 15 additions & 11 deletions src/smt/smt_context_pp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -430,14 +430,12 @@ namespace smt {
out << "(check-sat)\n";
}


unsigned context::display_lemma_as_smt_problem(unsigned num_antecedents, literal const * antecedents, literal consequent, symbol const& logic) const {
std::stringstream strm;
std::thread::id this_id = std::this_thread::get_id();
strm << "lemma_" << this_id << "." << (++m_lemma_id) << ".smt2";
std::ofstream out(strm.str());
TRACE("lemma", tout << strm.str() << "\n";);
std::string name = mk_lemma_name();
std::ofstream out(name);
TRACE("lemma", tout << name << "\n";);
display_lemma_as_smt_problem(out, num_antecedents, antecedents, consequent, logic);
TRACE("non_linear", display_lemma_as_smt_problem(tout, num_antecedents, antecedents, consequent, logic););
out.close();
return m_lemma_id;
}
Expand Down Expand Up @@ -471,14 +469,20 @@ namespace smt {
out << "(check-sat)\n";
}

unsigned context::display_lemma_as_smt_problem(unsigned num_antecedents, literal const * antecedents,
unsigned num_eq_antecedents, enode_pair const * eq_antecedents,
literal consequent, symbol const& logic) const {
std::string context::mk_lemma_name() const {
std::stringstream strm;
std::thread::id this_id = std::this_thread::get_id();
strm << "lemma_" << this_id << "." << (++m_lemma_id) << ".smt2";
std::ofstream out(strm.str());
TRACE("lemma", tout << strm.str() << "\n";
return strm.str();
}


unsigned context::display_lemma_as_smt_problem(unsigned num_antecedents, literal const * antecedents,
unsigned num_eq_antecedents, enode_pair const * eq_antecedents,
literal consequent, symbol const& logic) const {
std::string name = mk_lemma_name();
std::ofstream out(name);
TRACE("lemma", tout << name << "\n";
display_lemma_as_smt_problem(tout, num_antecedents, antecedents, num_eq_antecedents, eq_antecedents, consequent, logic);
);
display_lemma_as_smt_problem(out, num_antecedents, antecedents, num_eq_antecedents, eq_antecedents, consequent, logic);
Expand Down

0 comments on commit ac4bcb9

Please sign in to comment.