diff options
author | Morgan Deters <mdeters@cs.nyu.edu> | 2014-08-23 01:50:02 -0400 |
---|---|---|
committer | Morgan Deters <mdeters@cs.nyu.edu> | 2014-08-23 01:50:02 -0400 |
commit | 829b597108f64a97398c863d150905c6d203613f (patch) | |
tree | 71194e53b7536031cb6481320e0d109123deed37 /src/printer | |
parent | ba9a2a34e37f856774662b50a09b3a1d3b9ae89f (diff) |
Unsat core printing.
Diffstat (limited to 'src/printer')
-rw-r--r-- | src/printer/printer.cpp | 7 | ||||
-rw-r--r-- | src/printer/printer.h | 3 | ||||
-rw-r--r-- | src/printer/smt2/smt2_printer.cpp | 7 | ||||
-rw-r--r-- | src/printer/smt2/smt2_printer.h | 3 |
4 files changed, 19 insertions, 1 deletions
diff --git a/src/printer/printer.cpp b/src/printer/printer.cpp index 8f0f50daa..7a90f5a49 100644 --- a/src/printer/printer.cpp +++ b/src/printer/printer.cpp @@ -153,4 +153,11 @@ void Printer::toStream(std::ostream& out, const Model& m) const throw() { } }/* Printer::toStream(Model) */ +void Printer::toStream(std::ostream& out, const UnsatCore& core) const throw() { + for(UnsatCore::iterator i = core.begin(); i != core.end(); ++i) { + toStream(out, Node::fromExpr(*i), -1, false, -1); + out << std::endl; + } +}/* Printer::toStream(UnsatCore) */ + }/* CVC4 namespace */ diff --git a/src/printer/printer.h b/src/printer/printer.h index beb2438e2..9a9ee19d1 100644 --- a/src/printer/printer.h +++ b/src/printer/printer.h @@ -103,6 +103,9 @@ public: /** Write a Model out to a stream with this Printer. */ virtual void toStream(std::ostream& out, const Model& m) const throw(); + /** Write an UnsatCore out to a stream with this Printer. */ + virtual void toStream(std::ostream& out, const UnsatCore& core) const throw(); + };/* class Printer */ /** diff --git a/src/printer/smt2/smt2_printer.cpp b/src/printer/smt2/smt2_printer.cpp index 766db729a..543079576 100644 --- a/src/printer/smt2/smt2_printer.cpp +++ b/src/printer/smt2/smt2_printer.cpp @@ -771,6 +771,13 @@ void Smt2Printer::toStream(std::ostream& out, const CommandStatus* s) const thro }/* Smt2Printer::toStream(CommandStatus*) */ +void Smt2Printer::toStream(std::ostream& out, const UnsatCore& core) const throw() { + out << "(" << endl; + this->Printer::toStream(out, core); + out << ")" << endl; +} + + void Smt2Printer::toStream(std::ostream& out, const Model& m) const throw() { out << "(model" << endl; this->Printer::toStream(out, m); diff --git a/src/printer/smt2/smt2_printer.h b/src/printer/smt2/smt2_printer.h index e86b3cb2b..e825d3f4c 100644 --- a/src/printer/smt2/smt2_printer.h +++ b/src/printer/smt2/smt2_printer.h @@ -37,7 +37,6 @@ class Smt2Printer : public CVC4::Printer { void toStream(std::ostream& out, TNode n, int toDepth, bool types) const throw(); void toStream(std::ostream& out, const Model& m, const Command* c) const throw(); - void toStream(std::ostream& out, const Model& m) const throw(); public: Smt2Printer(Variant variant = no_variant) : d_variant(variant) { } using CVC4::Printer::toStream; @@ -46,6 +45,8 @@ public: void toStream(std::ostream& out, const CommandStatus* s) const throw(); void toStream(std::ostream& out, const Result& r) const throw(); void toStream(std::ostream& out, const SExpr& sexpr) const throw(); + void toStream(std::ostream& out, const Model& m) const throw(); + void toStream(std::ostream& out, const UnsatCore& core) const throw(); };/* class Smt2Printer */ }/* CVC4::printer::smt2 namespace */ |